Skip to content

feat(tui): order and hide session sidebar sections from tui.json - #53201

Closed
Nowaker wants to merge 1 commit into
anomalyco:devfrom
Nowaker:tui-sidebar-order
Closed

Nowaker wants to merge 1 commit into
anomalyco:devfrom
Nowaker:tui-sidebar-order

Conversation

@Nowaker

@Nowaker Nowaker commented Oct 4, 2026 •

Copy link
Copy Markdown

Note: I'm aware v1 is now the maintenance branch and new features go to v2 only. This PR is here for others who want to use it on v1. I will submit a v2 version once I've migrated my plugin setup to v2.

Issue for this PR

Closes #53198

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds sidebar.order and sidebar.hidden to tui.json so session sidebar sections can be reordered and hidden.

  • Sections are named context, mcp, lsp, todo, files (the built-in internal:sidebar-* ids without the prefix), or by a plugin's slot registration id, so plugin sections work too.
  • Listed sections render first in the given order. Unlisted sections keep their default order after them, so a future section is never dropped silently. The title (sidebar_title) is untouched and stays first.
  • No config means no change.

How: slot order in the opentui registry belongs to a whole registration, not to one slot. When the option is set, createSlots().register (packages/tui/src/plugin/slots.tsx) splits a registration's sidebar_content into its own registration with the configured order, or drops it when hidden, and leaves the registration's other slots (e.g. sidebar_footer) where they were. The config reaches the host through setupSlots(api, config.sidebar).

How did you verify your code works?

  • New tests in packages/tui/test/plugin/slots.test.tsx render a real slot registry: default order unchanged, order with unlisted sections falling through, hidden by built-in name and plugin id while the plugin's footer slot stays. Config decode test in packages/tui/test/config.test.tsx.
  • bun typecheck in packages/tui and packages/opencode.
  • Ran the TUI with an isolated config (tui.json: {"sidebar": {"order": ["mcp", "context"], "hidden": ["lsp"]}}) against dev and this branch.

Screenshots / recordings

Sidebar text captured from tmux with the config above.

dev (option ignored):

New session - 2026-10-04T17:47:47.104Z
Context
0 tokens
0% used
$0.00 spent
MCP
• demo-a MCP error -32000: Connection closed
• demo-b MCP error -32000: Connection closed
LSP
LSPs are disabled

This branch:

New session - 2026-10-04T18:20:01.747Z
MCP
• demo-a MCP error -32000: Connection closed
• demo-b MCP error -32000: Connection closed
Context
0 tokens
0% used
$0.00 spent

Checklist

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

This PR is AI generated, but under direct supervision and on request of @Nowaker.

Add `sidebar.order` and `sidebar.hidden` to tui.json. Sections are named
`context`, `mcp`, `lsp`, `todo`, `files`, or by the slot id a plugin's
registration received, so plugin-contributed sidebar sections can be
ordered and hidden the same way as built-in ones.

Listed sections render first, in the given order; every unlisted section
keeps its default order after them, so a section added later is never
silently dropped. The session title is a separate slot and always stays
first. Without the option nothing changes.

Slot order belongs to a whole registration, so the host moves a
registration's `sidebar_content` into its own registration and leaves
its other slots (e.g. `sidebar_footer`) where they were.
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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

@Nowaker

Nowaker commented Oct 4, 2026

Copy link
Copy Markdown
Author

Follow-up with mouse drag-and-drop reordering, stacked on this PR: #53217

Nowaker added a commit to Nowaker/opencode that referenced this pull request Oct 4, 2026
Feature and session records for `sidebar.order` / `sidebar.hidden` and
drag-and-drop reordering (bc5aa4e, dc68262), upstream issue anomalyco#53198
and PRs anomalyco#53201 / anomalyco#53217, and the 1.18.34-vt-80-907b3bc518 build on
desktop and m4max. The compact Context feature gets a timeline row for
its header now toggling through the shared drag-aware click handler.

AI-Tool: opencode 1.18.33-vt-60-2fa3363c92
AI-Model: anthropic/claude-opus-5-5
AI-Variant: high
AI-Platform: linux
AI-Harness: Vibeterm 3ae7f02
AI-Session-ID: ses_ef81ad30fffeo7m3HoZisuJdli
@Nowaker
Nowaker force-pushed the tui-sidebar-order branch from 0406a6a to 9804e2c Compare October 7, 2026 11:13
@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@thdxr thdxr closed this Oct 10, 2026
Nowaker added a commit to Nowaker/opencode that referenced this pull request Oct 11, 2026
Feature and session records for `sidebar.order` / `sidebar.hidden` and
drag-and-drop reordering (bc5aa4e, dc68262), upstream issue anomalyco#53198
and PRs anomalyco#53201 / anomalyco#53217, and the 1.18.34-vt-80-907b3bc518 build on
desktop and m4max. The compact Context feature gets a timeline row for
its header now toggling through the shared drag-aware click handler.

AI-Tool: opencode 1.18.33-vt-60-2fa3363c92
AI-Model: anthropic/claude-opus-5-5
AI-Variant: high
AI-Platform: linux
AI-Harness: Vibeterm 3ae7f02
AI-Session-ID: ses_ef81ad30fffeo7m3HoZisuJdli
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.

[FEATURE]: reorder and hide session sidebar sections via tui.json

2 participants