jackwener/OpenCLI · error · CommandExecutionError

View all button not visible

Error message

View all button not visible

What it means

The Qoder 'view-all' (credits detail) UI command clicks a visible element containing the text 'View all'. When clickByTextScript returns {ok:false} — no visible button/tab/anchor matches — the command throws CommandExecutionError('View all button not visible'). This means the credits-detail 'View all' control was not present when the script ran.

Source

Thrown at clis/qoder/ui.js:217

            { Field: 'Info', Value: info || '(no popover detected after click)' },
        ];
    },
});

// -------- view-all --------
cli({
    site: 'qoder',
    name: 'view-all',
    access: 'write',
    description: 'Click "View all" to show all Quests.',
    domain: 'localhost',
    strategy: Strategy.UI,
    browser: true,
    args: [],
    columns: ['Status'],
    func: async (page) => {
        const res = await evaluateQoder(page, clickByTextScript(['View all']));
        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'View all button not visible', '');
        return [{ Status: 'clicked' }];
    },
});

// -------- add-workspace --------
cli({
    site: 'qoder',
    name: 'add-workspace',
    access: 'write',
    description: 'Click "Add Workspace" — opens the folder picker. Note: this opens a system file-picker dialog that Qoder controls; the actual folder selection must be done in the UI by the user.',
    domain: 'localhost',
    strategy: Strategy.UI,
    browser: true,
    args: [],
    columns: ['Status'],
    func: async (page) => {
        const res = await evaluateQoder(page, clickByTextScript(['Add Workspace']));
        if (!res?.ok) throw new CommandExecutionError(res?.reason || 'Add Workspace button not found', '');

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Run the 'credits' command first so the Credits Usage popover is open, then run view-all immediately.
  2. Reduce the delay between opening the popover and clicking (or add a wait ensuring the popover is still visible).
  3. Add alternate text patterns ('See all', 'View All') to the clickByTextScript call if the label differs.
  4. Check for a localized UI; match the exact rendered label via CDP DevTools.
  5. Re-run if a transient focus change dismissed the popover.

Example fix

// before
clickByTextScript(['View all'])
// after: tolerate label variants
clickByTextScript(['View all', 'View All', 'See all'])
Defensive patterns

Strategy: validation

Validate before calling

async function viewAllVisible(page) {
  const probe = await page.evaluate(`(() => {
    const el = Array.from(document.querySelectorAll('button, [role="button"], a'))
      .find(b => (b.innerText||'').trim().toLowerCase() === 'view all');
    return !!el && el.getBoundingClientRect().width > 0;
  })()`);
  if (probe !== true) throw new Error('Open the Credits Usage popover first (run qoder credits).');
}

Type guard

function isClickResult(res) {
  return res !== null && typeof res === 'object' && typeof res.ok === 'boolean';
}

Try / catch

try {
  await cli.run(['qoder', 'credits']);
  await cli.run(['qoder', 'view-all']);   // immediately after credits
} catch (e) {
  if (String(e.message).includes('View all button not visible')) {
    console.error('Popover closed early — run credits then view-all without delay.');
  } else throw e;
}

Prevention

When it happens

Trigger: Running 'view-all' without first opening the Credits Usage popover (precondition of the flow), the popover closed before the click, Qoder renamed the button, or the 'View all' text is rendered in an element type clickByTextScript does not consider.

Common situations: Calling view-all standalone instead of after the credits command; popover auto-dismissed (click outside, Escape) between steps; localized UI where the label is not literally 'View all'; Qoder update changed wording to 'See all' or an icon.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/0af780244c67029b. Report an issue: GitHub.