{"record":{"id":"1b97371a6f92635e","repo":"jackwener/OpenCLI","slug":"settings-click-failed","errorCode":null,"errorMessage":"settings click failed","messagePattern":"settings click failed","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/antigravity/audit-extras.js","lineNumber":191,"sourceCode":"});\n\n// -------- settings --------\ncli({\n    site: 'antigravity',\n    name: 'settings',\n    access: 'write',\n    description: 'Click the Antigravity settings button (matched by data-testid=\"settings-button\").',\n    domain: '127.0.0.1',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [],\n    columns: ['Status'],\n    func: async (page) => {\n        const res = unwrapEvaluateResult(await page.evaluate(clickFirstScript([\n            '[data-testid=\"settings-button\"]',\n            'button[aria-label=\"Settings\"]',\n        ])));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'settings click failed', '');\n        await page.wait(0.6);\n        return [{ Status: `clicked via ${res.sel}` }];\n    },\n});\n\n// -------- sidebar-toggle --------\ncli({\n    site: 'antigravity',\n    name: 'sidebar-toggle',\n    access: 'write',\n    description: 'Click Toggle Sidebar (collapses/expands the Antigravity sidebar).',\n    domain: '127.0.0.1',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [],\n    columns: ['Status'],\n    func: async (page) => {\n        const res = unwrapEvaluateResult(await page.evaluate(clickFirstScript(['button[aria-label=\"Toggle Sidebar\"]'])));","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/antigravity/audit-extras.js#L173-L209","documentation":"CommandExecutionError thrown by the 'settings' command when its clickFirstScript over the selectors '[data-testid=\"settings-button\"]' and 'button[aria-label=\"Settings\"]' reports `ok: false`. The fallback message 'settings click failed' appears when the page-side script gives no `reason`. It means the settings button could not be located or clicked in the current page state.","triggerScenarios":"`page.evaluate(clickFirstScript([...]))` returns { ok: false } or null: neither selector matched, the button is inside a closed menu, the page hasn't finished loading, or evaluate failed (navigation, crash).","commonSituations":"Antigravity redesigned its settings entry point (data-testid/aria-label changed); the command runs before the app shell mounts; user not logged in so the main UI (with settings) never renders; the button is behind a hover-revealed menu.","solutions":["Wait for the app to fully load, then re-run the command.","Confirm the settings button exists in the DOM (devtools) and check its current data-testid / aria-label.","Log in to Antigravity if the app shell did not render.","Add the new selector to the clickFirstScript selector list in audit-extras.js.","On success the command reports 'clicked via <sel>' — use that to confirm which selector worked."],"exampleFix":"// before\nclickFirstScript(['[data-testid=\"settings-button\"]', 'button[aria-label=\"Settings\"]'])\n\n// after\nclickFirstScript(['[data-testid=\"settings-button\"]', 'button[aria-label=\"Settings\"]', 'button[aria-label=\"Open settings\"]'])","handlingStrategy":"validation","validationCode":"const hasSettings = await page.evaluate(\n  \"!!document.querySelector('[data-testid=\\\"settings-button\\\"], button[aria-label=\\\"Settings\\\"]')\"\n);\nif (!hasSettings) throw new Error('Settings button not rendered — wait for app shell to load.');","typeGuard":"function clickSucceeded(res) {\n  return res != null && typeof res === 'object' && res.ok === true && typeof res.sel === 'string';\n}","tryCatchPattern":"try {\n  await runCmd('antigravity settings');\n} catch (e) {\n  if (e.code === 'EXEC' && /settings click failed/i.test(e.message)) {\n    await sleep(1000); // allow app shell to mount\n    await runCmd('antigravity settings');\n  } else throw e;\n}","preventionTips":["Wait for full app initialization before clicking chrome buttons.","Verify data-testid/aria-label after Antigravity updates.","Confirm login state — unauthenticated pages lack the settings button.","Log the successful selector ('clicked via <sel>') to detect drift early."],"tags":["dom-click","selector-not-found","ui-automation"],"backgroundTag":"element-click-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}