{"record":{"id":"c9b239c4f71c000e","repo":"jackwener/OpenCLI","slug":"leftbar-svg-not-visible","errorCode":null,"errorMessage":"LeftBar svg not visible","messagePattern":"LeftBar svg not visible","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/kimi/ui.js","lineNumber":84,"sourceCode":"});\n\n// -------- sidebar-toggle --------\ncli({\n    site: 'kimi',\n    name: 'sidebar-toggle',\n    access: 'write',\n    description: 'Click the LeftBar svg to toggle the Kimi sidebar.',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [],\n    columns: UI_COLUMNS,\n    func: async (page) => {\n        await ensureOnKimi(page);\n        const res = await page.evaluate(clickBySvgNameScript('LeftBar', { last: false }));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'LeftBar svg not visible', '');\n        return [{ Status: 'toggled' }];\n    },\n});\n\n// -------- view-all-history --------\ncli({\n    site: 'kimi',\n    name: 'view-all-history',\n    access: 'write',\n    description: 'Navigate to /chat/history (full conversation list page).',\n    domain: KIMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [],\n    columns: UI_COLUMNS,\n    func: async (page) => {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/kimi/ui.js#L66-L102","documentation":"The toggle-sidebar command injects a script that locates the SVG icon named 'LeftBar' on the Kimi page and clicks it. If the script reports failure (res.ok false), the command throws CommandExecutionError with the script's reason, defaulting to 'LeftBar svg not visible'. The library throws this because the DOM element needed to toggle the sidebar could not be found or is not visible/clickable.","triggerScenarios":"page.evaluate(clickBySvgNameScript('LeftBar')) returns { ok:false } — the LeftBar svg is absent, hidden (display:none/zero size), or inside a collapsed header at the time of the click.","commonSituations":"Kimi UI updated and renamed the icon; page not fully rendered yet (invoked right after navigation without waiting); browser window too narrow so the sidebar toggle is replaced by a different layout; already-on-kimi check passed but the page is an error/blank state.","solutions":["Add a short wait or wait-for-selector after ensureOnKimi/page.goto before toggling so the icon has rendered.","Verify you are on a Kimi page that actually renders the LeftBar icon (not a login or error page).","Update the library if Kimi changed its icon names.","Retry the command once — transient render timing is a common cause."],"exampleFix":"// before\nawait page.evaluate(clickBySvgNameScript('LeftBar', { last: false }));\n// after\nawait page.wait(1); // let the UI render\nconst res = await page.evaluate(clickBySvgNameScript('LeftBar', { last: false }));\nif (!res?.ok) throw new Error(res?.reason);","handlingStrategy":"retry","validationCode":"// wait until the icon exists before toggling\nawait page.waitForSelector('svg[name=\"LeftBar\"]');","typeGuard":"const isClickResult = (r) => !!r && typeof r === 'object' && r.ok === true;","tryCatchPattern":"try {\n  return await toggleSidebar(page);\n} catch (e) {\n  if (/LeftBar svg not visible/.test(e.message)) {\n    await page.wait(1);\n    return await toggleSidebar(page);\n  }\n  throw e;\n}","preventionTips":["Always wait for page render (wait-for-selector or short delay) before DOM interactions.","Run against a window size where the sidebar toggle is present.","Check for login/error pages before UI commands."],"tags":["dom","ui-automation","kimi"],"backgroundTag":"element-not-visible","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}