Repository navigation
feat(workspace): simplify thread tabs and the file toolbar - #711
Merged
Merged
Conversation
Thread is always visible as the first tab. The other tabs fill the row around the active one, which keeps its full name, and a +N chip lists the rest only when they do not fit. The header has no plus and no permanent tab menu any more. A file shows one row with its path, Source and Rendered for Markdown, Edit (Save and Discard in the same place while editing) and one menu for everything else, from Keep tab and Go to line to the tab actions, with Delete file last. Related: #640
nixuuu
force-pushed
the
feat/workspace-v3-2
branch
from
November 14, 2026 11:59
10d9917 to
2903de8
Compare
nixuuu
marked this pull request as ready for review
November 14, 2026 12:39
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
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)**
- A refresh of a directory that already has entries adds no row.
Watch-triggered revalidation used to append `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 of `Load
more` under the same key.
- First load: skeleton rows on the tree grid, also while the tree chunk
loads (with the header strip).
- Git status, live-update status and errors are a pill over the bottom
of the list. The list gets bottom scroll room, so rows never move.
- Rows: `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 to `WorkspaceTreeRow` /
`WorkspaceTreeSkeleton`.
**File view**
- One 40px bar for every file type. The path holds the left edge and
controls keep their order from the right. `Source`/`Rendered` is shown
from the file name (disabled until the text loads), so it no longer pops
in.
- Notices (`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.
- The reader fixes its frame from the first paint, using one pass over
the text (`@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.
- The reader module is loaded once for all tabs, so a loaded tab mounts
in the same frame (no empty `{#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 with `t-rise`. Reduced motion is
respected.
- Polish: 8px text inset, `bg-surface` behind both the gutter and the
text, subtle line numbers, a selection colour, and a `path:31` range
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-shift` entries are summed, including those with
`hadRecentInput`.
- rAF sampling covers the first line's y, the text x and the bar height
(all within the same document), the tree row count and the last row's y.
| Run | CLS sum | First-line y moves | Text x moves | Bar height changes
| Tree row-count changes | Last tree row moves |
| --- | --- | --- | --- | --- | --- | --- |
| dev, dark, 1440 | 0.137 | 60 px | 45 px | 0 | 28 | 1120 px |
| **this PR**, dark, 1440 | **0** | **0** | **0** | 0 | **0** | **0** |
| dev, light, 1100 | 0.203 | 40 px | 23 px | 0 | 27 | 1184 px |
| **this PR**, light, 1100 | **0** | **0** | **0** | 0 | **0** | **0** |
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:
- small, large (plain), markdown (Source/Rendered), lockfile, binary,
image and long files;
- a `31-33` highlight;
- Files sheet on phone.
Not in this PR's scope: at 390 px the thread header's active tab name
overlaps the `Files` button. That belongs to the header/tabs, not the
file view.
## Copy audit (docs/copy.md §8)
| Before | After | Reason |
| --- | --- | --- |
| `Large files are shown as plain text to keep them responsive.` (row) |
Pill `Plain text`, same sentence in the tooltip | Short state label; the
sentence is kept |
| `Enable highlighting` | Same; `Highlight` in a narrow bar | Verb
first; a short form for limited width |
| `Preparing the rest of the file…` | `Preparing the file…` | Shorter;
one idea |
| `Showing the first 2 MB. This file is read only.` (row) | Pill
`Showing the first 2 MB`, full text in the tooltip | Docs term kept |
| `This line is outside the preview. Choose a visible line.` (row) |
Pill `Line outside the preview` + `Go to line`, full text in the tooltip
| The action replaces the instruction |
| `Unsaved changes` (row while editing) | Same text, as the pill | No
text change |
| `Loading files…` (row) | Skeleton row, same text for screen readers |
No visible text change |
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.
- Tests: `packages/syntax/src/layout.test.ts` (new, pure layout logic),
`tests/integration/thread-directory.test.ts` and
`tests/integration/thread-watch.test.ts` pass.
- The web build passes.
- `expo export` passes for iOS and Android.
- I did not run the full `check:tmp`.
Related: #640, #711
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.
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
The thread header now separates project and action chrome from a rounded tab surface that continues into thread and file content. Tabs gain quieter inactive surfaces, separators, reserved close slots, hover feedback and reduced-motion-aware transitions while retaining #737 overflow behaviour. Windows and Linux use custom window controls (`titleBarStyle: hidden`, no native title-bar overlay); they inherit the chrome palette and retain the existing reserved width. macOS keeps left traffic lights. Summary-card internals and column centring are unchanged. Related: #711, #737 Validation passed: `bun install`, `bun run typecheck`, `bun run lint`, `bun run format:check`, and `bun run --filter @canopy/web build`. The final CSS adjustment was rechecked with web typecheck, lint, format:check and the web build. Checks ran with `nice` and private temporary files outside the repository. Browser review used a disposable remote stack, isolated database and synthetic files, constrained to one CPU. Light/dark, Thread + three file tabs, active file, 390 px phone, 640/768/1024/1440 px, short/long names, overflow selection, summary and Files were reviewed. Header bounds stayed at y=0 / height=48 before and after tab switches at every measured width; page scroll width matched the viewport. Hovering an inactive tab preserved its label bounds. Opaque reverse corners were reviewed at DPR 1 and actual DPR 2 (2880×1800 PNGs for a 1440×900 viewport). Browser development mode emitted the existing `derived_inert` warnings on both base and changed code, with no errors in the completed review. Windows/Linux browser simulation rendered the actual custom controls: header and controls resolved to the same chrome colour, with a 120 px reserve. With Files open that reserve moved to the panel's header. Computed app regions were `drag` on the header and `no-drag` on tab buttons; the macOS simulation retained an 88 px left clearance with the sidebar hidden. These checks do not exercise a native Electron window. PNG screenshots are retained outside git in `/var/tmp/canopy-tabs-shots/`: `{before,after}-{light,dark}-{1440,390}-{thread,file}.png`, plus `after-{light,dark}-1440-{thread,file}-2x.png`, summary/Files captures and Windows/Linux/macOS simulations. The path index is `paths.txt` in that directory. The disposable stack and review directory are cleaned after capture. No UI test suites were added or run. Copy audit: not applicable; no user-facing text changed. The documentation update describes the new surfaces only. Native manual checks before merge: 1. Windows/Linux: drag from empty left/right chrome; tab buttons, close buttons, menus and Files must stay clickable without dragging. 2. Minimize, maximize/restore and close; verify the Close red hover, light/dark appearance changes and alignment after zoom/fullscreen changes. 3. Open/close Files and the sidebar; window controls must retain chrome backing and never overlap action buttons. 4. macOS: traffic-light alignment and dragging with the sidebar open/closed, including zoom/fullscreen changes.
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.
Change
Stage 2 of the workspace v3 redesign, based on stage 1.
Tabs.
Threadis always visible as the first tab.+Nchip lists the rest, with full paths and unsaved marks, only when they do not fit.+and no permanent⌄tab menu.File toolbar.
Source/Renderedfor Markdown, andEdit. While editing,Discard changes/Stop editingandSave filetake the same place.⋯menu holds Keep tab, Reload, Go to line, Copy path, Copy text, Open in default app, the tab actions (Move left/right, Close tab, Close other tabs, Close saved tabs) and, last after a separator, Delete file.copyTextis now one shared clipboard helper.Related: #640
Verification
Thread, the long-named tab truncated, the activetab-1.tsin full, and+2. The overflow menu lists the hidden tabs. The file menu order and the disabled states (Move left on the first tab, Close other tabs with one tab) were checked.Copy audit (§8)
Render Markdown/View sourceSource/Rendered(labelView)Delete filebutton in the barDelete filelast inFile actions, after a separatorSwitch tab (N)button with a menu, plusSearch and commands+Nchip (N more tabs), menuMore tabsCopy path,Copy textmenu itemsReload,Keep tab,Go to linebuttonsNo new error or empty-state texts. Checked with short, long and very long file names at 1440, 1100 and 390 px.