Repository navigation
Conversation
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.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
3 of 6 tasks
Nowaker
force-pushed
the
tui-sidebar-drag
branch
from
October 4, 2026 20:22
ad25bdd to
24d4dd2
Compare
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
Dragging a sidebar section by its header onto another section moves it there. The resulting order is saved in kv (`sidebar_order`) and wins over `sidebar.order` from tui.json until "Reset sidebar order" in the command palette clears it. Reordering applies live through the slot registry's `updateOrder`, for built-in and plugin sections alike. Every `sidebar_content` contribution is now wrapped in a host box that handles the drag. The box is hidden while the section renders nothing, so empty sections still take no space. Only a press on the section's first line, its header, starts a drag; a drag that starts anywhere below it never moves the section. opentui captures the renderable under the pointer at the first drag event, which may be a gap between sections, so the dragged section is the one pressed on mouse down and a drag is recognized from `over` events that carry a drag source. A press on selectable text starts a text selection instead, so the drag handle is the header's section name and arrow, which are non-selectable, plus its blank cells. Everything else stays selectable text as before, including the collapsed MCP summary, which moves into its own text so "(N active, M errors)" can be copied. Collapsible headers toggle only when pressed and released on the same cell, so a click still collapses while a drag, or a drop onto a header, does not; this also keeps the collapsed summary on screen while it is being selected.
Nowaker
force-pushed
the
tui-sidebar-drag
branch
from
October 5, 2026 10:52
24d4dd2 to
937fde8
Compare
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 5, 2026
dc68262 made each sidebar section header the drag handle by marking the whole header text unselectable. That took copy-on-select away from the values merged onto those headers since: the compact Context line (tokens, percent, cost), the MCP status summary and counts, the Todo summary, and "are disabled" after the LSP heading. It also let a press on any blank cell of a section, such as the gap after an MCP row's bullet, start a section drag. Only the section name and its arrow stay unselectable now; the values after them on the header line are their own selectable text. A drag reorders only when it starts on the section's first line, its header. Clicking anywhere on the header, values included, still toggles it, because toggling needs a press and release on the same cell, which a drag-select never is. This is the same handle rule as the amended upstream PR anomalyco#53217 head 937fde8. AI-Tool: opencode 1.18.33-vt-60-2fa3363c92 AI-Model: anthropic/claude-opus-5-5 AI-Variant: max AI-Platform: linux AI-Harness: Vibeterm bd50370 AI-Session-ID: ses_ef81ad30fffeo7m3HoZisuJdli
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 5, 2026
…g handle Session record for the 2026-10-05 fix 1c06f29: the values merged onto sidebar header lines (compact Context, MCP counts and summary, Todo summary, "are disabled") copy on drag-select again, only section names and arrows stay the drag handle, and a drag starts only on a section's first line. PR anomalyco#53217 head amended to 937fde8; desktop runs 1.18.34-vt-101-907b3bc518 and m4max 1.18.34-vt-100-907b3bc518. The section-order feature gains the change row, and the compact Context, MCP summary, Todo summary and LSP one-line features gain timeline rows. AI-Tool: opencode 1.18.33-vt-60-2fa3363c92 AI-Model: anthropic/claude-opus-5-5 AI-Variant: max AI-Platform: linux AI-Harness: Vibeterm 50691e9 AI-Session-ID: ses_ef81ad30fffeo7m3HoZisuJdli
Nowaker
force-pushed
the
tui-sidebar-drag
branch
from
October 7, 2026 11:13
937fde8 to
0577ff5
Compare
1 task done
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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
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
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 11, 2026
dc68262 made each sidebar section header the drag handle by marking the whole header text unselectable. That took copy-on-select away from the values merged onto those headers since: the compact Context line (tokens, percent, cost), the MCP status summary and counts, the Todo summary, and "are disabled" after the LSP heading. It also let a press on any blank cell of a section, such as the gap after an MCP row's bullet, start a section drag. Only the section name and its arrow stay unselectable now; the values after them on the header line are their own selectable text. A drag reorders only when it starts on the section's first line, its header. Clicking anywhere on the header, values included, still toggles it, because toggling needs a press and release on the same cell, which a drag-select never is. This is the same handle rule as the amended upstream PR anomalyco#53217 head 937fde8. AI-Tool: opencode 1.18.33-vt-60-2fa3363c92 AI-Model: anthropic/claude-opus-5-5 AI-Variant: max AI-Platform: linux AI-Harness: Vibeterm bd50370 AI-Session-ID: ses_ef81ad30fffeo7m3HoZisuJdli
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 11, 2026
…g handle Session record for the 2026-10-05 fix 1c06f29: the values merged onto sidebar header lines (compact Context, MCP counts and summary, Todo summary, "are disabled") copy on drag-select again, only section names and arrows stay the drag handle, and a drag starts only on a section's first line. PR anomalyco#53217 head amended to 937fde8; desktop runs 1.18.34-vt-101-907b3bc518 and m4max 1.18.34-vt-100-907b3bc518. The section-order feature gains the change row, and the compact Context, MCP summary, Todo summary and LSP one-line features gain timeline rows. AI-Tool: opencode 1.18.33-vt-60-2fa3363c92 AI-Model: anthropic/claude-opus-5-5 AI-Variant: max AI-Platform: linux AI-Harness: Vibeterm 50691e9 AI-Session-ID: ses_ef81ad30fffeo7m3HoZisuJdli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Refs #53198. Builds on #53201: this branch contains that PR's commit too. Review only the last commit, 937fde8 "reorder session sidebar sections by dragging their headers". Kept separate because drag-and-drop is the more opinionated part.
Type of change
What does this PR do?
Drag a session sidebar section by its header onto another section to move it there. The order is saved in kv (
sidebar_order, like other runtime TUI toggles), applies immediately through the slot registry'supdateOrder, and takes precedence oversidebar.orderuntil Reset sidebar order (command palette) clears it. Works for plugin sections as well.sidebar_contentcontribution is wrapped in a host box that handles the drag. It is hidden while the section renders nothing, so empty sections (Todo, Modified Files) still take no space.overevents that carry a dragsource.What is the drag handle, and what stays copyable. In opentui a press on selectable text starts a text selection and never a capture drag, so a cell can be a drag handle or copyable text, not both. The handle is the header's section name and arrow (
▼ MCP,Context), madeselectable={false}, plus the header's blank cells. Everything else is selectable text exactly as ondev: section rows, and data after a name on the header line. That data includes the collapsed MCP summary, which this PR moves into its own text so(N active, M errors)can be copied. Ondevthat summary cannot actually be copied, because the press that starts the selection also expands the section and removes the summary. Toggling on release fixes that too. The only text that stops being selectable is the section names themselves, which carry no information worth copying.How did you verify your code works?
packages/tui/test/plugin/slots.test.tsxdrive the real slot host withmockMouse: a drag from a header reorders; a drag from a non-text cell below the header does not; a drag over the data after a header name selects it (•3) and does not reorder; on the real MCP section, a click collapses it, a drag selects(0 activefrom the summary, and a click on the summary expands it again. The second and the last test fail without this commit's handle rule and summary split. Plus tests for the move function and the click handler.bun typecheckinpackages/tuiandpackages/opencode.(0 activeand shows "Copied to clipboard"; the Context lines and MCP rows copy too;MCPheading word onto Context → MCP, Context, LSP; MCP stays expanded; kvsidebar_order=["mcp","context","lsp","todo","files"];Screenshots / recordings
Sidebar after dragging the MCP header onto Context (captured from tmux):
Checklist
This PR is AI generated, but under direct supervision and on request of @Nowaker.