Skip to content

feat(ui): sidebar toggles in the Ribbon, keyboard chords, and drag-to-hide - #78

Merged
nmrtist merged 1 commit into
nmrtist:mainfrom
Limdongcheng:up/sidebar-toggle-ux
Aug 30, 2026
Merged

feat(ui): sidebar toggles in the Ribbon, keyboard chords, and drag-to-hide#78
nmrtist merged 1 commit into
nmrtist:mainfrom
Limdongcheng:up/sidebar-toggle-ux

Conversation

@Limdongcheng

Copy link
Copy Markdown
Contributor

Summary

Hiding or restoring a sidebar required the View menu; nothing on the always-visible chrome showed the current layout or offered a fast path.

The Ribbon task row gains an always-visible toggle pair whose glyphs mirror the window layout — the side band fills while that sidebar is shown, so the buttons double as a live layout indicator. Cmd+B / Cmd+Shift+B (the VS Code convention) bind the existing TogglePrimarySidebar / ToggleSecondarySidebar commands as the fast path. Dragging a sidebar's resize edge well past its minimum width (a 60 px slack, so overshooting a fast resize does not hide it by accident) also hides it, and the status bar names the command that brings it back.

Hidden panels burn one egui auto-id slot and the central workspace renders inside a globally salted scope, so sibling container ids do not shift when a sidebar toggles — widget state (scroll positions, collapses) survives layout changes.

Validation

  • cargo pr-check passes on current main (fmt, source sizes, dependency policy, default-frontends build, clippy -D warnings, reference-backend test suite).
  • npm run build in docs/ passes.

UI display logic

  • New or changed actions go through the command catalog (CommandId + describe) and are searchable in the command palette. (Reuses the registered TogglePrimarySidebar / ToggleSecondarySidebar commands; the chords and Ribbon buttons are new bindings/surfaces for them.)
  • Hiding happens only at Ribbon-group level (dataset kind or width budget); transient states disable with a disabled_reason that says how to unblock. (The toggle pair is always visible; its width is budgeted in the task-row compaction estimate.)
  • No layout changes from background events; panels are never auto-closed. (Sidebars change only on explicit clicks, chords, or resize drags; the status bar hint names the restore command.)
  • New panels or empty regions show an empty state with a next step. (No new panels.)
  • Docs updated in docs/ (English and zh-CN) for user-visible behavior. (Shortcut reference, UI overview, and quick tour in both languages.)

…-hide

Hiding or restoring a sidebar required the View menu; nothing on the
always-visible chrome showed the current layout or offered a fast path.

The Ribbon task row gains an always-visible toggle pair whose glyphs
mirror the window layout — the side band fills while that sidebar is
shown, so the buttons double as a live layout indicator. Cmd+B /
Cmd+Shift+B (the VS Code convention) bind the existing
TogglePrimarySidebar / ToggleSecondarySidebar commands as the fast
path. Dragging a sidebar's resize edge well past its minimum width (a
60 px slack so overshooting a fast resize does not hide it by
accident) also hides it, and the status bar names the command that
brings it back.

Hidden panels burn one egui auto-id slot and the central workspace
renders inside a globally salted scope, so sibling container ids do
not shift when a sidebar toggles — widget state (scroll positions,
collapses) survives layout changes.

The shortcut reference, UI overview, and quick tour document the new
surfaces (EN + zh-CN).
@nmrtist
nmrtist merged commit c580130 into nmrtist:main Aug 30, 2026
11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants