Repository navigation
feat(desktop): #5685 draggable sash to resize Opened files - #5807
Conversation
Jocs
left a comment
There was a problem hiding this comment.
Requesting changes: the common path works, but I reproduced two runtime cases that violate the stated resize behavior, and the new E2E coverage is stateful.
-
High: reopening the list can remove the project tree entirely. tree.vue:364 sets listHeightLimit to Infinity while the list is hidden. Shrinking the window then produces a ResizeObserver callback, but expanding the list does not change the observed tree-view size, so the limit is never recomputed. Reproduction: choose a 448px list, collapse Opened files, shrink the window to 420px, then expand it. The list returns at 448px and the project tree is 0px high. Recalculate the limit after showOpenedFiles changes, ideally after nextTick, and cover this sequence in E2E.
-
Medium: a narrow-window drag overwrites the remembered height. tree.vue:377 clamps listHeight to the temporary viewport limit, then tree.vue:382 persists that clamped value. Reproduction: choose 448px, shrink the window, nudge the handle, restore the window. The list remains around 136px instead of returning to 448px. Keep the requested height separate from the rendered and viewport-clamped height.
-
Medium: the new tests are order-dependent. issue-5685-opened-files-resize.spec.ts:78 relies on the preceding test to open more than four tabs. Running only the dragging test with -g times out waiting for the handle. The final test also relies on state from earlier tests. Each test should establish its own tabs and starting height.
-
Suggestion: the sash is mouse-only. The handle at tree.vue:71 is a non-focusable div with only mousedown. Consider role=separator, aria-orientation, tabindex=0, and Arrow Up/Down resizing.
CI is green, but the added tests do not exercise cases 1 and 2. The branch is also currently conflicting with develop; merge-tree reports a conflict in tree.vue, primarily from the later comment-removal changes. Please rebase while addressing the findings.
Once more than four files are open, a handle under the sidebar Opened files list lets it be dragged taller. The height is clamped between four rows and the rows' own height, always leaves room for the project tree (also when the window shrinks), and is kept in localStorage.
…equested height, a11y + isolated e2e
6bdd445 to
e902873
Compare
|
Thanks for the thorough review, all four points addressed in the rebased branch (
Rebased onto current |
Closes #5685
Related: #5353, #5473
Summary
Add a draggable, keyboard-accessible separator below Opened files when more than four files are open. The list defaults to four rows and never leaves empty space when tabs close.
The list remembers the user's chosen height across sidebar view changes and application restarts. Automatic viewport and content limits only affect the rendered height: shrinking the window and restoring it brings back the chosen height. An explicit drag or keyboard adjustment starts from the currently visible height and saves the new choice. Dragging beyond either bound does not accumulate hidden distance, so reversing direction responds immediately.
Reserve 150px for the project section, including the separator's height. In very short windows, allow the file list to show fewer than four rows to preserve that space. Recalculate the limit after expanding the list, enabling Opened files in preferences, showing the sidebar, or returning from Search.
Pointer capture handles dragging, cancellation, and cleanup. The separator supports Arrow keys, Shift+Arrow for four rows, Home/End, a visible focus indicator, and current ARIA bounds. Resize state and interaction live in
useOpenedFilesResize.ts;tree.vueowns the layout.Merged current develop and resolved conflicts while retaining its multi-folder sidebar.
Before / after:
Type of change
Validation
pnpm build:unpack)pnpm lint: no errors (existing warnings)pnpm typecheckThe previous narrow-window nudge test now checks the agreed interaction: an explicit adjustment replaces the remembered height; passive viewport changes preserve it.