Skip to content

fix(panels,review): use single-pane panelSidebar below 420 pt and wrap empty-state text - #1997

Merged
Hona merged 1 commit into
devfrom
fix/narrow-panel-sidebar-and-text-wrap
Dec 1, 2026
Merged

Hona merged 1 commit into
devfrom
fix/narrow-panel-sidebar-and-text-wrap

Conversation

@Hona

@Hona Hona commented Dec 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Switch ui.panelSidebar (used by Review and Files) to a single full-width pane when the panel width is below 420 pt (SINGLE_PANE_W), using an explicit NarrowPane (Main / Sidebar) state on PanelSidebar so the persisted wide-window sidebarOpened preference stays intact across resizes.
  • Add .clip_soft(0.0) to {id}-body, {id}-sidebar, and {id}-main in ui.panelSidebar to match official packages/session-ui/src/v2/components/session-review-v2.css (overflow: hidden).
  • Return the narrow single-pane sidebar to Main when picking a file from the Review or Files tree.
  • Add explicit text wrapping (wrap = true / .wrap()) to empty, loading, error, and stat text across plugins/review/panel.luau, plugins/file/panel.luau, plugins/context/tab.luau, plugins/details/lists.luau, features/review/src/mobile.rs, and features/panels/src/view/pane.rs, plus shrink/compact spacing on Review's source picker and toolbar when narrow.

Root Cause

  • The side panel in wide mode (>= 768 pt, or whenever side_width narrows to ~330 pt) previously rendered ui.panelSidebar with a fixed MIN_W = 200 pt sidebar beside the main pane, squeezing the two columns side by side (e.g. 200 pt sidebar with "No changed files. Use Open file to browse the workspace." beside a ~126 pt main pane with "项目变更将显示在此处").
  • Rune's ui.text defaults to unwrapped single-line layout (unlike CSS's default wrapping), so Review's empty-state description and related empty/status texts clipped mid-character at panel edges instead of wrapping.

Verification

  • Passed pwsh scripts/guardrails.ps1 (11/11 checks, including plugin-props, arch-check, tables-check, and cursor-allow).
  • Passed cargo check -p opencode-feature-review -p opencode-feature-panels -p opencode-desktop --lib --bins (including Luau plugin compilation in apps/desktop/build.rs).
  • Passed cargo clippy -p opencode-feature-review -p opencode-feature-panels --lib --no-deps -- -D warnings and verified zero clippy diagnostics in all touched opencode-desktop files.
  • Not verified locally: interactive GUI resize testing on Linux (Wayland/Hyprland) or live desktop windows was not run on this machine.

Fixes #1985

…p empty-state text

When the side panel narrows below 420 pt (e.g. ~330 pt wide on narrow wide-mode
layouts or split panes), `ui.panelSidebar` previously kept its 200 pt file sidebar
beside the main column, squeezing the main pane down to ~130 pt or less while
unwrapped empty-state and status text clipped mid-character at panel edges.

- Add an explicit `NarrowPane` state on `PanelSidebar` so `ui.panelSidebar`
  switches to a single full-width pane below 420 pt (`SINGLE_PANE_W`) without
  clobbering the persisted wide-window `sidebarOpened` preference.
- Clip `{id}-body`, `{id}-sidebar`, and `{id}-main` in `ui.panelSidebar` to
  match official `session-review-v2.css` `overflow: hidden`.
- Return the narrow single-pane sidebar to its main view when picking a file
  from the Review or Files tree.
- Enable text wrapping (`wrap = true` / `.wrap()`) on empty, loading, error,
  and stat labels across Review, Files, Context, Details, narrow Changes, and
  empty side panes, and tighten/shrink Review's title and toolbar when narrow.

Fixes #1985
Copilot AI balanced review requested due to automatic review settings December 1, 2026 10:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Hona
Hona merged commit f8f5024 into dev Dec 1, 2026
8 checks passed
@Hona
Hona deleted the fix/narrow-panel-sidebar-and-text-wrap branch December 1, 2026 10:35
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.

Narrow window: context and review panels squeeze side by side, text clips at panel edges

2 participants