feat(desktop): restore a resizable sidebar that collapses below 160px - #611
Merged
Merged
Conversation
ADR 0141's right-edge handle returns to the expanded sidebar: pointer motion previews a 240..520px width anchored at the press position, release persists the preferred width, and ArrowLeft/ArrowRight (16px), Home, and End resize from the keyboard. Escape, cancellation, lost capture, and unmount restore the press-time width. The handle is visible again on every platform. Dragging below 160px now collapses the sidebar immediately instead of leaving a cramped column. The collapse keeps the previewed width for the exit animation, persists nothing, and reopens at the last committed preferred width, so a collapsing drag never overwrites the user's column. The live maximum is the three-column remainder after MainChat's 450px floor and an occupying work panel's requested width, so a user-chosen sidebar width cannot trip D408's sidebar yield. Work-panel growth and window shrink still collapse the expanded sidebar at that threshold, and a manual reopen still spends work-panel width first. Renderer only: the existing pi.desktop.sidebarWidth preference, no IPC, native window, or storage-schema change. See ADR 0290, D451, and E2E-168.
This branch was successfully deployed
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.
Why
ADR 0141 made the expanded sidebar a persisted
240..520pxcolumn, then D408 /ADR 0238 pinned it at 275px and hid the handle so the three-column budget could
treat the left dock as a constant. The inspection and space-reclaiming need ADR
0141 recorded is still real, and the live budget can cap a user-chosen width
without freezing it. Dragging past a usable minimum should fold the column
instead of leaving a cramped strip.
What changed
width anchored at the press position; release persists it. ArrowLeft/ArrowRight
step 16px, Home/End select the live bounds, and keyboard changes commit
immediately. Escape, cancellation, lost capture, and unmount restore the
press-time width. Pressing the handle never resizes the column.
160pxcollapses the sidebar immediately as a useraction. The collapse keeps the previewed width for the exit animation,
persists nothing, and reopens at the last committed preferred width, so a
collapsing drag never overwrites the user's column. Keyboard resize never
collapses;
Cmd/Ctrl+Bremains the keyboard fold.and an occupying work panel's requested width, so a user-chosen sidebar width
cannot trip D408's yield. Work-panel growth and window shrink still collapse
the expanded sidebar at that threshold, and a manual reopen still spends
work-panel width first.
pi.desktop.sidebarWidthpreference. No IPC,native window bounds, host protocol, or storage-schema change.
New:
apps/desktop/src/lib/sidebar-resize.ts(clamp/collapse math and the livebudget),
apps/desktop/test/sidebar-resize-math.test.mjs, ADR 0290 with decisionlog entry D451, plus the spec, E2E-168, and three-column layout check updates.
Validation
pnpm lint(biome + style-token check) — passpnpm --filter @pi-desktop/desktop typecheck— passpnpm build:js— passpnpm -r --if-present test— pass (desktop: 2212 tests)node scripts/check-architecture.mjsagainst the PR base — passRendered desktop drag/relaunch journey (E2E-168) is still documented as pending,
as it needs a native window; unit and source-contract coverage is in place.