{"record":{"id":"5847e95ba61711f7","repo":"jackwener/OpenCLI","slug":"open-panel-failed","errorCode":null,"errorMessage":"open-panel failed","messagePattern":"open-panel failed","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/qoder/ui.js","lineNumber":54,"sourceCode":"        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'sidebar-toggle failed', '');\n        return [{ Status: `clicked: ${res.matched}` }];\n    },\n});\n\n// -------- open-panel --------\ncli({\n    site: 'qoder',\n    name: 'open-panel',\n    access: 'write',\n    description: 'Open / close the Qoder bottom panel (Output / Terminal / Debug Console). ⌥⌘B equivalent.',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [],\n    columns: ['Status'],\n    func: async (page) => {\n        const res = await evaluateQoder(page, clickByTextScript(['Open Panel', 'Close Panel']));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'open-panel failed', '');\n        return [{ Status: `clicked: ${res.matched}` }];\n    },\n});\n\n// -------- search --------\ncli({\n    site: 'qoder',\n    name: 'search',\n    access: 'read',\n    description: 'Open Qoder Search palette (⌘P), type a query, return matched options.',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'query', positional: true, required: true, help: 'Search text' },\n        { name: 'limit', type: 'int', required: false, default: 20 },\n    ],\n    columns: ['Index', 'Item'],","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/qoder/ui.js#L36-L72","documentation":"Thrown by the qoder open-panel UI command when clicking visible text 'Open Panel'/'Close Panel' fails. As with the other UI commands, CommandExecutionError carries res.reason if the injected script reported one, else the generic fallback message. The panel toggle control didn't match the scripted text.","triggerScenarios":"Panel button text/label changed in the Qoder UI; the panel feature is not present on the current page; the button is icon-only with no matching text node; the page hadn't mounted the panel control yet.","commonSituations":"Qoder update renamed the panel toggle; running on a page variant (e.g. a different Qoder surface) without the panel; slow load so the button isn't in the DOM when clicked; localized UI text.","solutions":["Verify the exact button text in the live UI and update the clickByTextScript strings.","Add an aria-label/title-based fallback via clickFirstScript.","Add a wait for page readiness before running the command.","Confirm the current Qoder page actually has the panel feature."],"exampleFix":"// before\nconst res = await evaluateQoder(page, clickByTextScript(['Open Panel', 'Close Panel']));\nif (!res?.ok) throw new CommandExecutionError(res?.reason || 'open-panel failed', '');\n// after\nlet res = await evaluateQoder(page, clickByTextScript(['Open Panel', 'Close Panel']));\nif (!res?.ok) res = await evaluateQoder(page, clickFirstScript(['[aria-label=\"Open Panel\"]', '[aria-label=\"Close Panel\"]']));\nif (!res?.ok) throw new CommandExecutionError(res?.reason || 'open-panel failed', '');","handlingStrategy":"try-catch","validationCode":"const panelBtn = await page.evaluate(`Array.from(document.querySelectorAll('button')).some(b => /Panel/.test(b.textContent || ''))`);\nif (!panelBtn) console.warn('Panel toggle not present on this page');","typeGuard":"function isClickOk(res) { return Boolean(res && res.ok === true); }","tryCatchPattern":"try {\n  await openPanel(page);\n} catch (e) {\n  if (/open-panel failed/.test(String(e.message))) console.warn('Panel control unavailable; skipping');\n  else throw e;\n}","preventionTips":["Verify panel button labels against the deployed Qoder build.","Wait for page load before invoking UI commands.","Confirm the current page surface supports the panel.","Add attribute-based fallback selectors."],"tags":["ui-automation","dom-selector","click-failed"],"backgroundTag":"selector-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}