Repository navigation
fix(workspace): keep the file view and tree frame stable - #735
Merged
Merged
Conversation
nixuuu
force-pushed
the
fix/workspace-file-stability
branch
from
November 14, 2026 16:35
afbaeab to
a475514
Compare
nixuuu
marked this pull request as ready for review
November 14, 2026 16:35
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
Long active file names could extend outside the workspace tab strip and overlap Files at phone widths. The non-shrinking active tab was introduced in #711. The title now gives space to tabs first. Thread keeps its slot, file names truncate within the available strip, and extra tabs collapse into +N using a rem-based width budget. Files uses an icon with an accessible name and tooltip below 40 rem. Its slot and the existing thread actions stay fixed when tabs open or close. The responsive Files control is extracted into WorkspaceFilesToggle; workspace documentation reflects the behavior. Fixes: #711 ### Validation - Passed with nice and TMPDIR under /var/tmp: bun install, bun run typecheck (including Svelte: 0 errors/warnings), bun run lint, bun run format:check, bun run --filter @canopy/web build. Ran bun run format after edits. - Browser review against a disposable remote stack: light and dark at 320, 390, 768, 1100 and 1440 px, plus 1920 px bounds. Checked short/typical/164-character titles, 11 kept file tabs, the long active filename, Thread and its summary pill. No page-level horizontal overflow; active tabs stay inside the strip. - Files x positions before/after closing/reopening a tab were unchanged: 280, 350, 684.5, 1016.5, 1356.5 and 1836.5 px respectively at 320/390/768/1100/1440/1920 px. The +N menu selects the long file and returns focus to its visible tab. - No UI test suites added or run. Review servers, database container, tunnel and temporary directories cleaned up. ### Copy audit (§8) Files text button → Files icon-only on phones; the same English accessible name is preserved and becomes the tooltip. Desktop copy is unchanged. No new error or empty-state text. Checked short and long labels at phone and desktop widths; the icon is not the only accessible cue. Based on dev including #734. #735 was still open during validation; its files-view changes are not included in this PR.
This was referenced Nov 16, 2026
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.
Files panel and file tab view: one stable frame. Before this, opening a file made the tree add and drop a "Loading files…" row, notices pushed the text down, and the text reflowed when highlighting arrived.
What changed
Tree (web, mobile shares the domain fix)
Loading files…after every open. The directory row shows a spinner in its chevron slot; for the root, the spinner sits in a reserved slot in the panel header. A state row now appears only for a directory's first read (as a skeleton row where its entries will appear) or for a next page, in place ofLoad moreunder the same key.density-chrome, a fixed chevron slot, folder/folder-open/file icons, indentation guides, inset rounded hover/selected, a fixed status-letter slot, truncated names. Extracted toWorkspaceTreeRow/WorkspaceTreeSkeleton.File view
Source/Renderedis shown from the file name (disabled until the text loads), so it no longer pops in.Plain text+Enable highlighting, preparing a large file,Showing the first 2 MB, line outside the preview +Go to line,Unsaved changes, watch status) are one compact pill in the bar (FileNoticePill), with the full sentence in its tooltip. In a narrow bar it shows the icon and a short action; at phone width the action moves to the⋯menu and Edit becomes an icon. Conflict and error banners stay, because they need a decision.@canopy/syntax/layout: line count, longest line, UTF-8 size). The gutter is at least 3 digits, so files up to 999 lines share one width, and longer files get their width from the known count. The plain-text decision and the scroll height no longer change when indexing finishes. Highlighting only recolours.Preparing the file…appears only when indexing takes more than 300 ms.{#await}flash). A file that is still loading shows an empty surface, then, after 300 ms, skeleton lines on the reader grid. Text fades in witht-rise. Reduced motion is respected.bg-surfacebehind both the gutter and the text, subtle line numbers, a selection colour, and apath:31range with a tinted gutter and a 2px accent marker.Mobile: the reader's notices and the tree's status and errors became an overlay pill. The plain-text decision is known before indexing. This is JS-only: the iOS/Android fingerprints match
dev(138e0c6…,906dc94…).Layout-shift measurements
The fixture repo has 10 files, opened by clicking in the tree in this order: AGENTS.md (4 lines), CHANGENOTES.md (260 KB, plain), CLAUDE.md (modified), CURRENT_TASK.md, PROGRESS.md (1,500 lines), README.md, yarn.lock (864 KB lockfile), logo.png, src/app.ts, src/generated.ts (12,000 lines). Measured in Chromium per click over 2.5 s:
layout-shiftentries are summed, including those withhadRecentInput.Text x still changes between two different files when one has ≥1000 lines (a wider gutter). Within a file it never changes.
Browser review
Done on a review machine with a disposable stack and fixture repo, both removed afterwards. It covered light and dark at 1440 and 1100, and phone at 390:
31-33highlight;Not in this PR's scope: at 390 px the thread header's active tab name overlaps the
Filesbutton. That belongs to the header/tabs, not the file view.Copy audit (docs/copy.md §8)
Large files are shown as plain text to keep them responsive.(row)Plain text, same sentence in the tooltipEnable highlightingHighlightin a narrow barPreparing the rest of the file…Preparing the file…Showing the first 2 MB. This file is read only.(row)Showing the first 2 MB, full text in the tooltipThis line is outside the preview. Choose a visible line.(row)Line outside the preview+Go to line, full text in the tooltipUnsaved changes(row while editing)Loading files…(row)The glossary is unchanged. Every new button starts with a verb, and no fact is repeated. Short and long paths were checked at desktop and phone widths. Status letters keep their accessible labels.
Checks
bun install,gen:check,typecheck,lint,format:check: clean.packages/syntax/src/layout.test.ts(new, pure layout logic),tests/integration/thread-directory.test.tsandtests/integration/thread-watch.test.tspass.expo exportpasses for iOS and Android.check:tmp.Related: #640, #711