Skip to content

docs(www): list the keybinds missing from the reference - #54711

Closed
paoValle wants to merge 1 commit into
anomalyco:devfrom
paoValle:fix/keybind-defaults-v2
Closed

paoValle wants to merge 1 commit into
anomalyco:devfrom
paoValle:fix/keybind-defaults-v2

Conversation

@paoValle

@paoValle paoValle commented Oct 12, 2026 •

Copy link
Copy Markdown

Issue for this PR

No issue. This ports the change asked for in #53557 ("If you think this is still relevant, please port it over and open it for V2").

Type of change

  • Documentation

What does this PR do?

The V2 keybind reference was missing 13 of the 236 keybinds the TUI accepts. This adds them to the section they belong to, in the order of Definitions in packages/tui/src/config/keybind.ts, with the descriptions from the registry:

  • Application: location.reload
  • Appearance and navigation: pane.focus.left, pane.focus.right, terminal.select, terminal.close
  • Sessions: session.copy.id, session.verbosity.cycle
  • Composer: composer.terminal.up, composer.terminal.down, composer.terminal.select
  • Dialogs: dialog.integration.rename, dialog.integration.delete, dialog.plugins.error

This replaces the earlier revision of this branch, which changed the V1 docs page (packages/web/src/content/docs/keybinds.mdx, the tui.json reference) instead of the V2 reference under services/www. Nothing else on the page changes: the five retired diff.* entries stay in the prose note below the diff table, and the four description drifts that predate this PR (app.clear, session.move, diff.switch_source, dialog.plugins.check) are left alone.

How did you verify your code works?

Extracted every ID and default from the page's tables and compared them with Definitions in packages/tui/src/config/keybind.ts:

  • 236 active IDs: 223 listed before, 236 now, 0 absent.
  • 0 documented defaults differ from the registry.
  • Five IDs are in no table: diff.toggle, diff.expand, diff.expand_all, diff.collapse, diff.switch_focus — still accepted, no longer registering shortcuts, and named in that sentence.

From services/www:

  • bun run typecheck — Result (31 files): 0 errors, 0 warnings, 0 hints.
  • bun run build — exit 0, 63 pages indexed, link validation clean.

Screenshots / recordings

N/A — table rows added to one documentation page.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked each addition with a script against Definitions in packages/tui/src/config/v1/keybind.ts. All 55 keys and defaults match, the JSON block still parses (206 keys), and no existing line changes. Public API is unchanged (docs only).

Two things worth looking at before this goes in:

  • Which registry the page follows. On dev, v1/keybind.ts is the legacy schema that packages/cli/src/config/migrate.ts uses to rename old keys. The TUI itself reads packages/tui/src/config/keybind.ts, which uses dotted command names (session.tab.next, diff.open, …) and rejects unknown keys, and v2 config lives in cli.json. So the new entries document legacy names. Updating the page for v2 is a separate, bigger job and a maintainer call. But it means this PR adds 55 more names to legacy docs rather than syncing the page with what the TUI reads.
  • The sync is partial. Even against v1/keybind.ts, the block still lists 24 keys that file doesn't define (which_key_*, plugin_install, plugin_manager, workspace_set, tool_details, session_child_cycle, session_child_cycle_reverse, session_toggle_timestamps, input_paste, console_org_switch, …). It also has 8 values that differ: agent_cycle (tab vs shift+tab), agent_cycle_reverse, session_child_first (<leader>down vs down), messages_first, messages_last_user, input_buffer_home, input_buffer_end, plugins.toggle (space vs return). If the goal is to match that registry, these need fixing too. Otherwise readers copying the example still get the wrong defaults.

"command_list": "ctrl+p",
"help_show": "none",
"docs_open": "none",
"diff_open": "none",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These defaults match packages/tui/src/config/v1/keybind.ts. On dev that file is the legacy schema used by packages/cli/src/config/migrate.ts. The TUI reads packages/tui/src/config/keybind.ts instead, where these are diff.open, diff.close, …, session.tab.next, session.quick_switch.1, and so on, and unknown names are rejected. Maintainers should decide which names this page documents before more v1 names are added.

"queued_prompt_delete": "ctrl+d",
"session_toggle_timestamps": "none",
"session_toggle_generic_tool_output": "none",
"session_child_first": "<leader>down",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This existing line doesn't match the registry this PR syncs to: session_child_first is down in v1/keybind.ts, not <leader>down. Seven other values differ the same way (agent_cycle, agent_cycle_reverse, messages_first, messages_last_user, input_buffer_home, input_buffer_end, plugins.toggle), and 24 documented keys aren't in the registry at all. For a sync, please fix or remove those too.

I compared every ID and default in `cli/keybinds.mdx` with `Definitions` in
`packages/tui/src/config/keybind.ts`: 13 of the 236 active IDs were absent from the page, and no
default it documents differs. They are added to the section they belong to, in registry order, with the
descriptions from the registry. The five retired `diff.*` entries stay in the prose note below the
diff table.
@paoValle
paoValle force-pushed the fix/keybind-defaults-v2 branch from cfb155d to 91429fd Compare October 12, 2026 07:34
@paoValle paoValle changed the title docs: sync the keybind defaults with the TUI registry docs(www): list the keybinds missing from the reference Oct 12, 2026
@paoValle

Copy link
Copy Markdown
Author

Both points check out, and the second one made me look in the wrong place.

packages/web/src/content/docs/keybinds.mdx is the OpenCode 1 documentation: it documents tui.json, which on this branch is only read by packages/cli/src/config/migrate.ts. The V2 reference is services/www/src/docs/content/cli/keybinds.mdx — cli.json with the dotted IDs. Checking it against Definitions in packages/tui/src/config/keybind.ts turns up the same defect: 13 of the 236 active IDs were not listed, and no default it documents differs.

This branch now makes that change instead (91429fdb0e): all 236 active IDs are listed, the five retired diff.* IDs stay in the prose note, and prompt.paste is still the only object default. In services/www, bun run typecheck is 0 errors/0 warnings/0 hints and bun run build exits 0.

@AdityaZxxx

Copy link
Copy Markdown

Small heads-up on overlap: #57307 also edits the Composer table in this file. It adds composer.tab.previous, composer.tab.next and composer.subagent.toggle-activity — new ids introduced in that PR, which the review there asked to be documented — and it adds the same three composer.terminal.* rows as this PR (byte-identical, including the up,k / down,j defaults).

Nothing else overlaps: the other ten ids this PR adds are in sections #57307 doesn't touch.

Whoever merges second will need to rebase this table, but resolving it is just dropping the duplicate three terminal rows. Prettier widens the Description column either way because composer.subagent.toggle-activity is longer than the current column, so expect the whole table to reflow rather than a clean three-line append.

@paoValle

Copy link
Copy Markdown
Author

Checked the overlap: #57307 does add the same three rows — composer.terminal.up / .down / .select with the same up,k / down,j / return defaults — so rebasing this table after yours lands is dropping those three rows and letting prettier reflow the Description column, exactly as you said. Nothing else in the ten ids this PR adds is touched there, and the diff.* prose note is untouched.

I'll rebase on top of #57307 if it merges first; if this one merges first, the same three lines are what yours drops.

@opencode-agent opencode-agent Bot mentioned this pull request Oct 23, 2026
3 of 6 tasks
@Tarquinen

Copy link
Copy Markdown
Member

Thanks for the PR! #58280 added these keybinds to the reference, so I'm closing this as superseded.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@Tarquinen Tarquinen closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants