Skip to content

feat(workspace): open thread files in persistent tabs - #640

Merged
nixuuu merged 2 commits into
devfrom
feat/workspace-file-tabs
Nov 13, 2026
Merged

nixuuu merged 2 commits into
devfrom
feat/workspace-file-tabs

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Final integration rebase including history/fold recovery

Rebased all seven layers of stack #643 onto dev 8e78568c7e86c188039743dde6cb879c34de4a6e, including #671 provider warnings, #673 reconnect/backoff, #670 connector refresh, #674 deterministic steer recovery and #672 empty-work/history recovery. Two thread-page conflicts were resolved in their introducing stages: preserve the conversation/file tab wrapper together with history loading rows/actions, prefetch, fold synchronization/coverage, diagnostics and scroll anchors. Feed, history and fold implementation files retain the merged dev behavior. Earlier generated-descriptor conflicts were resolved through bun run gen; proto additions and field numbers are preserved. The independently confirmed five workspace fixes are unchanged. No pending Git or gh-stack rebase operation.

Verification scope on the final heads: install, explicit gen, gen:check, full typecheck, lint, format:check, production web build and focused workspace/feed tests at every stage. Commands run detached with setsid nohup and nice; heavy files run serially through check:tmp. Stage 1 integration files: thread-file-previews.test.ts, thread-scroll.test.ts. Existing feed logic files: feed-rows.test.ts, work-history-gaps.test.ts. No UI/component test suite added.

All seven PRs remain ready as requested. The maintainer merges the complete stack after CI is green on every head; no merge is performed here. Device check remains pending as previously authorized. No product copy change in this integration rebase.

Everything below is historical evidence from before this final integration rebase, including earlier draft statuses and export/fingerprint measurements.

Change

Stage 1 of the approved seven-stage workspace stack. File links in a thread open one replaceable preview tab beside the pinned Thread tab. Edit, Keep tab, double-click or Move keeps it. The shared header handles overflow; native mobile uses a tab switcher sheet.

Adds device-local tab metadata, in-memory drafts, close guards, line/range navigation and restoration of file scroll and web editor undo. Existing file RPCs and SHA-256 mutation checks remain in use. Links outside a thread keep their current viewer.

Related: #613

Current-head rebase verification

Rebased onto dev 4bb71c80142e0c1d0616502ce428ca2bf19d8cad. The workspace wrapper retains dev's thread scroll-memory preparation and loaded-view gates on web and mobile. The existing interrupt request/error handling moved into the thread-command module to keep the page within the code-size limit, with unchanged behavior and UI copy. No manual feed/work-fold changes.

Current-head install, gen:check, full typecheck, lint, format:check, production web build and iOS/Android exports passed with nice. Both nightly native fingerprints match dev. Current-head CI is green, including all four test shards. Initial thread JS is 765,684 gzip bytes versus dev 756,367: +9.10 KiB, within the 15 KiB budget.

The final stack head was reviewed in a production browser on the separate review machine in light/dark at 1440/820/390 px, including short/long names, source ranges, file-tab switching and file-scroll restoration. The merged thread-scroll domain integration passed separately on that head. Device check pending. Every implementation PR stays a draft in stack #643. Current full-suite fallback and the serial corrective integrations are recorded in #648; interrupted local runs are not passes.

Earlier implementation verification (historical)

  • Passed locally with nice: install, gen:check, typecheck, lint, format:check and web production build.
  • Full check:tmp: 2748 passed, 166 skipped, 0 failed; temp directory clean. The newly rebased mobile foreground integration test also passed separately.
  • Local iOS and Android exports passed with one Metro worker. Fingerprints equal the same dev baseline (bd89660d5) with CANOPY_CHANNEL=nightly: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9. No native dependency/configuration changes.
  • Device check pending. Device support reports Could not communicate with device support. Try refreshing devices. Refresh did not restore it. The maintainer explicitly authorized continuing later stages with typecheck, both exports and unchanged fingerprints; consolidated iOS/Android device review remains required before the stack is merged. No native performance results are claimed.
  • Production browser measurements on the separate review machine at e668c19dc: thread-route JS +9269 bytes gzip (9.05 KiB, budget 15 KiB); 100 warm switches p50 35.5 ms / p95 41.5 ms with 0 file reads; retained heap +72480 bytes after 20 open/edit/discard/close cycles following warm-up (budget 5 MiB). Earlier exploratory warm p95 ranged 41.3–56.5 ms; these are not omitted from the evidence.
  • File 100 KiB, 30 cold document opens: first plain paint p50 125.4 ms / p95 139 ms (250 ms budget); DOM p95 92 ms; second-frame stability p95 299.5 ms. The latter includes subsequent syntax work and is not reported as first plain paint.
  • Three alternating baseline/current two-minute renderer runs completed: handler p95 0.4/0.5 ms, 0.4/0.6 ms and 0.5/0.5 ms. Long-task totals were 3682/3836, 3609/3760 and 3679/3779 ms; runs lasted 120.2–120.9 s. A separate 30-minute renderer run completed 209 cycles / 41,800 messages: handler p95 0.6 ms, 244 long tasks / 54,489 ms total; sampled heap 263,495,772 → 262,438,198 bytes and DOM 19,838 → 19,657 nodes. These are streaming/scroll fixtures, not the complete file-switch/undo/offline resource scenario, which remains for final stack verification. Sampled heap is not retained heap after GC.
  • No protocol or database migration; no UI test suite added.

This PR stays a draft. The maintainer merges the whole stack only after all seven stages are finished and verified.

Copy audit — docs/copy.md §8

  • Repeated modal title → compact file tab with the full path in its tooltip/switcher. Short, sentence-case actions use verbs: Keep tab, Move left/right, Close saved tabs and Go to line.
  • Unsaved state → Unsaved changes in a reserved slot and accessible tab name. Save/Discard/Keep editing repeat the confirmation's action; deletion names the file and computer.
  • Limits and storage failures state the problem and a next action. No new humorous copy or inspiration references.
  • Short, typical and long names checked in the real browser in light/dark at desktop, narrow and phone widths, including 320 px. At 12 tabs the active long name remains reachable with no page overflow; opening another file gives an actionable limit message. Repeated file links reuse their tab. Oversized edits restore the accepted content and cannot save a different draft.

@nixuuu
nixuuu force-pushed the feat/workspace-file-tabs branch 6 times, most recently from b61dec9 to e668c19 Compare November 13, 2026 12:56
@nixuuu
nixuuu added this pull request to stack #643 November 13, 2026 13:37
@nixuuu
nixuuu force-pushed the feat/workspace-file-tabs branch 3 times, most recently from e3b46de to 1e99c8e Compare November 13, 2026 20:27
@nixuuu
nixuuu marked this pull request as ready for review November 13, 2026 20:39
@nixuuu
nixuuu force-pushed the feat/workspace-file-tabs branch 2 times, most recently from 0f212b0 to d67911a Compare November 13, 2026 22:29
@nixuuu
nixuuu force-pushed the feat/workspace-file-tabs branch from d67911a to c303427 Compare November 13, 2026 22:41
@nixuuu
nixuuu merged commit 5cb9518 into dev Nov 13, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/workspace-file-tabs branch November 13, 2026 23:01
nixuuu added a commit that referenced this pull request Nov 13, 2026
## Final integration rebase including history/fold recovery

Rebased all seven layers of stack #643 onto dev
`8e78568c7e86c188039743dde6cb879c34de4a6e`, including #671 provider
warnings, #673 reconnect/backoff, #670 connector refresh, #674
deterministic steer recovery and #672 empty-work/history recovery. Two
thread-page conflicts were resolved in their introducing stages:
preserve the conversation/file tab wrapper together with history loading
rows/actions, prefetch, fold synchronization/coverage, diagnostics and
scroll anchors. Feed, history and fold implementation files retain the
merged dev behavior. Earlier generated-descriptor conflicts were
resolved through `bun run gen`; proto additions and field numbers are
preserved. The independently confirmed five workspace fixes are
unchanged. No pending Git or gh-stack rebase operation.

Verification scope on the final heads: install, explicit gen, gen:check,
full typecheck, lint, format:check, production web build and focused
workspace/feed tests at every stage. Commands run detached with `setsid
nohup` and `nice`; heavy files run serially through `check:tmp`. Stage 2
integration files: `thread-file-previews.test.ts`,
`computer-relay.test.ts`. Existing feed logic files:
`feed-rows.test.ts`, `work-history-gaps.test.ts`. No UI/component test
suite added.

All seven PRs remain ready as requested. The maintainer merges the
complete stack after CI is green on every head; no merge is performed
here. Device check remains pending as previously authorized. No product
copy change in this integration rebase.

Everything below is historical evidence from before this final
integration rebase, including earlier draft statuses and
export/fingerprint measurements.

## Change

Stage 2 of the approved seven-stage workspace stack, based on #640. The
header's + opens Pull requests, Tasks or Connectors in a full tab. The
right icon rail selects a minimal module, whose header offers a module
chip, +, Open in tab and Collapse panel. Tab and panel metadata stay
local to the device.

Thread details dock by default when the panel has no module. Selecting a
module leaves details closed behind their header button; the floating
card closes on outside click or Escape and returns focus. Narrow layouts
use separate bottom sheets. The panel supports keyboard/pointer resizing
and respects the available main-area width. Existing PR refresh content
retention and shared reads remain in use; task output can occupy a full
tab. Mobile mirrors the module/switcher/sheet model with the native
viewer and editor.

Related: #613

## Current-head rebase verification

Rebased onto corrected stage 1 and dev
`4bb71c80142e0c1d0616502ce428ca2bf19d8cad`, retaining merged thread
scroll memory and default tool-group folding. Current-head install,
gen:check, full typecheck, lint, format:check, production web build and
iOS/Android exports passed with `nice`; both nightly native fingerprints
match dev. Current-head CI is green, including all four test shards.
Initial thread JS is 768,471 gzip bytes versus dev 756,367: cumulative
+11.82 KiB, within the 15 KiB budget.

The final stack head was reviewed again in a production browser on the
separate review machine in light/dark at 1440/820/390 px. The summary
docks without an active module, floats when Files occupies the desktop
panel, and opens as a sheet at narrow/phone widths; Escape closes it.
Files panel/sheet, long names and the phone tab-switcher sheet were
inspected with no horizontal page overflow. No new UI copy in the
rebase; the original copy audit remains applicable. **Device check
pending**. This PR remains a draft in stack #643; full-suite fallback
and serial corrective evidence are recorded in #648.

## Earlier implementation verification (historical)

- Passed with `nice`: install, gen:check, typecheck, lint, format:check
and production web build. Full check:tmp: 2759 passed, 166 skipped, 0
failed; temporary directory clean. No protocol/database changes and no
UI test suite.
- Both final iOS/Android exports passed. Fingerprints unchanged from the
dev baseline: iOS `6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9` (`CANOPY_CHANNEL=nightly`).
No native dependency/configuration changes.
- **Device check pending**: Device support remains unavailable. The
maintainer authorized continuing with typecheck, both exports and
unchanged fingerprints. Consolidated device review is required before
merging the stack; native runtime/performance and PR scroll restoration
are not claimed as verified.
- Real browser: light/dark, 1440/1280/900/390/320 px, short and long
thread/tab names; module toggles, maximize into a tab, close module →
details dock, floating details placement, outside/Escape and focus
restoration, collapse/restore, keyboard resize bounds and narrow sheets.
Linux window-control CSS reserves were checked; Electron runtime was not
launched. Two review setups were already running on the second machine,
so this stage used the authorized local fallback.
- Thread-route initial JS: 766900 bytes gzip versus 754751 baseline;
cumulative +12149 bytes (11.9 KiB), within 15 KiB. Production browser,
1440×900, 100 warm Thread/Tasks switches after 10 warm-ups: p50 32.2 ms
/ p95 32.4 ms, budget 50 ms, zero thread API requests during the sample.
The local integration run was still active; these results do not replace
the final paired streaming/resource scenario. No initial editor/grammar
dependency added.
- Authenticated PR mutations were not exercised: the private fixture has
no linked account. Existing gateway/integration coverage and retained PR
components cover the unchanged contract; a real-account flow remains a
final QA gap.

This PR stays a draft. The maintainer merges all seven stages together
after complete verification.

## Copy audit — docs/copy.md §8

- Mixed thread-panel sections → Pull requests, Tasks and Connectors with
a separate Thread details surface. Existing glossary terms stay intact.
- Ambiguous panel actions → Open sidebar module, Open in tab, Close
module and Collapse panel. Icon labels describe the same action as their
tooltips; the chip retains an accessible full label when truncated.
- Missing task history → a short explanation and instruction to open
Tasks. Module tab limit errors explain the limit and ask to close a tab.
Existing permission/offline notices remain actionable.
- No humorous copy or inspiration references. Short/long labels and
header controls were checked in both themes and at desktop/narrow/phone
widths; native device coverage is pending as stated above.
nixuuu added a commit that referenced this pull request Nov 13, 2026
Dodaje „Edit from here”: cofnięcie rozmowy przed własną wiadomością w
tym samym wątku Canopy. Oryginalne tury pozostają jako superseded;
trwałe zdarzenie i upserty synchronizują urządzenia oraz lustra
przyrostowo po seq. Undo przywraca poprzednią sesję przed kolejną turą.
Cofnięte wiadomości nie wracają do modelu, również przy generowaniu
tytułu.

Projekt i źródła przypiętych harnessów: `docs/threads.md`, sekcja „Edit
from here”. Claude SDK 0.3.316 tworzy prefiks sesji i opcjonalnie
przywraca checkpointy plików. Codex 0.164.0 tworzy prefiks przez
`thread/fork`; przypięty `thread/revert` nie zapewnia odwracalności.
Grok CLI 1.0.70 nie ma zweryfikowanego kontraktu ACP rewind i zwraca
jawną odmowę. Rozmowa nie cofa plików bez wyboru użytkownika.
Odtwarzanie załączników zachowuje metadane wideo.

Gateway egzekwuje właściciela, blokadę przyjęcia pracy i granice
celów/harmonogramów, również przy Undo. Wątki botów, automatyczne i
odziedziczone punkty są wyłączone; aktywne dzieci trzeba zatrzymać. Stop
and edit zatrzymuje turę i zadania w tle oraz anuluje kolejkę, steery i
interakcje. Zamiar rewindu pozostaje dostarczalny do ACK również po TTL
outboxu. Starszy worker dostaje polecenie aktualizacji przez addytywną
capability, bez zmiany WORKER_LINK_PROTOCOL.

Poprawka P1 znajduje się w tej warstwie: rewind unieważnia generację
startów i czeka także na StartTurn przygotowywany przed turn_started.
Claude sprawdza anulowanie przed utworzeniem procesu i przekazaniem
wejścia; Codex sprawdza aktualność sesji po asynchronicznym wyborze
ustawień. Testy zatrzymują admission przy uzyskiwaniu runtime,
przygotowaniu Claude i ustawieniach Codex. Oryginalna sesja nie
otrzymuje anulowanej ani edytowanej wiadomości.

Cały stos przebazowany przez gh stack na dev `dcd13faaa`, obejmujący
workspace #640–#648 i filtrowanie pustych segmentów z #672. Zachowane
provider warnings i interrupt z #671, odświeżanie konektorów z #670,
odzyskiwanie live updates z #673 i poprawka testu steera #674. Konflikty
wygenerowanych kontraktów rozwiązane przez bun run gen z połączonych
addytywnych proto; RPC workspace i rewind pozostają dostępne. Parametry
sesji Codex zachowują MCP przy start/resume/fork, a kontrola generacji
Claude działa po odświeżeniu konektorów. Fixture Codex obsługuje katalog
MCP; testy admission używają agent bus. Migracja pozostaje 0136 po
najwyższej 0135 na dev. Brak pozostałego stanu rebase.

Walidacja na dev dcd13fa: bun install, gen:check, pełny typecheck,
lint i format:check przeszły z nice. Sprawdzenia odłączone od sesji
terminala; ciężkie testy kolejno po jednym pliku. Wynik: 38 pass, 0 fail
w 5 plikach — work-history-gaps, thread-rewind, thread-rewind-mirrors,
thread-file-previews i thread-root-checkpoint; katalogi tymczasowe
czyste. Pierwszy typecheck wymagał bun install dla nowego pakietu
workspace @canopy/syntax; ponowiony pełny przebieg przeszedł.
Wcześniejsze live: Codex 9 asercji, Claude 13 asercji, w tym
przywrócenie pliku i brak cofniętych wiadomości w kontekście. Bieżący
rebase nie powtarza pełnego check:tmp ani testów live.

Copy audit §8: brak akcji → „Edit from here” (cel edycji); brak
checkpointu → „Files stay as they are.” (jawny skutek); stary worker →
„Update this thread's worker to use Edit from here.” (przyczyna i
następny krok). Angielski sentence case, bez nowych synonimów i bez
polegania wyłącznie na ikonie.

Warstwa 1/3 stosu #662: #655 → #656 → #661. Ready; maintainer scala cały
stos atomowo.
nixuuu added a commit that referenced this pull request Nov 13, 2026
Dodaje „Edit from here” w akcjach własnej wysłanej wiadomości:
kompaktowe potwierdzenie, zatrzymanie aktywnej pracy i wybór cofnięcia
rozmowy lub rozmowy z checkpointowanymi plikami. Tekst, cytaty, wzmianki
i załączniki wracają do composera. Poprzedni szkic pozostaje w pamięci
karty i można go odzyskać przez Swap drafts.

Cofnięte tury i ich późne zdarzenia są schowane pod „N messages rewound
· Show”. Undo działa przed kolejną turą; Edit message odzyskuje trwały
szkic po ponownym otwarciu. Niepewna odpowiedź sieciowa zachowuje klucz
idempotencji i pozwala sprawdzić wynik. Gateway egzekwuje uprawnienia i
granice automatyzacji.

Poprawka P2 znajduje się w tej warstwie: Swap drafts jest nieaktywne
podczas wysyłania, uploadu, błędu załącznika i rewindu. Handler sprawdza
tę samą blokadę, zgodnie z mobile. Odpowiedź wysłania B nie może
wyczyścić podmienionego szkicu A. Wcześniejszy przegląd w prawdziwej
przeglądarce z wstrzymaną odpowiedzią potwierdził blokadę i odzyskanie A
z załącznikiem.

Rebase całego stosu przez gh stack na dev `dcd13faaa` zachowuje karty
workspace, pliki, moduły i panele z #640–#648. Rozmowa i composer
pozostają zamontowane w swoim panelu przy przełączaniu kart; blokada
rewindu działa w nowym położeniu composera. Zachowane filtrowanie
pustych segmentów, kontrolki brakującej historii, prefetch i kotwiczenie
feedu z #672 oraz Edit from here. Obie ścieżki feedu dostają granice
brakującej pracy i diagnostykę. Wiersze work-gap cofniętej tury chowają
się razem z nią; Show pozwala pobrać brakujące itemy. Regresja sprawdza
ukrycie, Show, prefetch i te same segmenty po stronicowaniu. Zachowane
#670, #671, #673 i #674. Migracja nadal 0136 po najwyższej 0135 na dev.
Brak pozostałego stanu rebase.

Walidacja na dev dcd13fa: bun install, gen:check, pełny typecheck
(Svelte: 0 błędów i ostrzeżeń), lint i format:check przeszły z nice.
Wynik testów: 38 pass, 0 fail w 5 plikach — work-history-gaps,
thread-rewind, thread-rewind-mirrors, thread-file-previews i
thread-root-checkpoint. Sprawdzenia odłączone od sesji terminala, testy
kolejno przez check:tmp; katalogi tymczasowe czyste. Typecheck przeszedł
po instalacji nowego pakietu workspace @canopy/syntax. Regresja #672
rozszerza istniejący test projekcji danych, bez testów komponentów i
przeglądarki. Wcześniej przeszedł web build; obecny rebase nie deklaruje
nowego pełnego przebiegu ani buildu.

Wcześniejszy przegląd przeglądarkowy: jasny i ciemny motyw, desktop
1280×800 i telefon 390×844; potwierdzenie, oba warianty plików, długie
ścieżki, odtwarzanie i zachowanie szkiców, Show/Hide, Undo i wysłanie
edytowanej wiadomości w tym samym wątku. Bez poziomego przewijania.
Przegląd z testowym workerem; prawdziwe harnessy i checkpointy
sprawdzono w backendzie. Środowisko przeglądu usunięte.

Copy audit §8: „Edit from here” (cel), „Stop and edit” (zatrzymanie),
„Conversation only” / „Conversation and files” (zakres), „Your previous
draft is saved.” + „Swap drafts” (odzyskanie). Potwierdzenie ma formę
pytania; tooltip i przycisk zachowują nazwę akcji. „will stop” → „stop”,
„will be cancelled” → „Canopy cancels”: czas teraźniejszy i aktywny
głos. Angielski sentence case, krótkie zdania, błędy z następnym
krokiem, techniczne szczegóły za Show details. Układ sprawdzony z
długimi nazwami plików.

Warstwa 2/3 stosu #662: #655 → #656 → #661. Ready; maintainer scala cały
stos atomowo.
nixuuu added a commit that referenced this pull request Nov 13, 2026
Dodaje „Edit from here” w menu przytrzymanej wiadomości na iOS i
Androidzie. Kompaktowy arkusz pokazuje zakres cofnięcia, zatrzymywaną
pracę, anulowane żądania oraz „Conversation only” / „Conversation and
files”, gdy agent ma checkpointy. Gateway egzekwuje uprawnienia i
dostępność.

Tekst, cytaty i załączniki wracają do composera, zachowując bieżące
ustawienia modelu i uprawnień. Wcześniejsze szkice pozostają w pamięci
ekranu i są dostępne przez Swap saved drafts. Historia jest zwinięta pod
licznikiem z Show/Hide, Undo i odzyskaniem wiadomości. Ponowienie po
zerwaniu transportu sprawdza trwały wynik. Opuszczenie ekranu anuluje
lokalne oczekiwanie.

Cały stos przebazowany przez gh stack na dev `dcd13faaa`, z workspace
#640–#648 i #670–#674. ThreadScreen zachowuje WorkspaceContext, karty
plików i modułów, VisibilityScope oraz obsługę przycisku Back. Arkusz
rewindu działa wewnątrz tego samego kontekstu. Nagłówek pomija cofnięte
tury, a composer uwzględnia blokadę rewindu. Oś czasu zachowuje
normalizację provider warnings i dni z widocznych tur rewindu. Memo
obejmuje editFrom i state.turns; thread_rewound nie pojawia się drugi
raz jako luźny komunikat. Poprawki P1 i P2 pozostają w #655/#656.
Migracja nadal 0136 po najwyższej 0135 na dev. Brak pozostałego stanu
rebase.

Walidacja na dev dcd13fa: bun install, gen:check, pełny typecheck
monorepo (w tym mobile), lint i format:check przeszły z nice. Wynik
testów: 38 pass, 0 fail w 5 plikach — work-history-gaps, thread-rewind,
thread-rewind-mirrors, thread-file-previews i thread-root-checkpoint.
Sprawdzenia odłączone od sesji terminala, testy kolejno przez check:tmp;
katalogi tymczasowe czyste. Typecheck przeszedł po instalacji nowego
pakietu workspace @canopy/syntax. Rewind nie dodaje zależności ani
konfiguracji natywnej względem nowej bazy. Wcześniej przeszły web build
i eksporty Hermes iOS/Android. Wcześniejsze fingerprinty: iOS
`74705db3a68907bc28379bb9b1080a227bc0755b`, Android
`7d38be8f5c9bf842d62060c75820a206f99c87e3`. Obecny rebase nie deklaruje
nowych eksportów, fingerprintów ani pełnego przebiegu testów.

Sprawdzenie urządzenia pozostaje pending: „Could not communicate with
device support”, zgodnie ze znaną blokadą w zadaniu. Nie deklaruję
natywnego przeglądu wizualnego. Dodatkowy Expo ESLint ma zastane błędy
React Hooks; obowiązkowy lint oxlint jest czysty.

Copy audit §8: „Edit from here” (cel), „Stop and edit” (zatrzymanie),
„Conversation only” / „Conversation and files” (zakres), „N messages
rewound” + „Show”/„Hide” (odwracalny odczyt), „Swap saved drafts”
(odzyskanie). Potwierdzenia mają znak zapytania. „will stop” → „stop”,
„will be cancelled” → „Canopy cancels”: czas teraźniejszy i aktywny
głos. Angielski sentence case, etykiety dostępności, błędy z następnym
krokiem. Istniejący arkusz i tokeny ruchu; przegląd na urządzeniu
pending.

Warstwa 3/3 stosu #662: #655 → #656 → #661. Ready; maintainer scala cały
stos atomowo.
nixuuu added a commit that referenced this pull request Nov 14, 2026
Thread details on mobile again has everything the summary had at hand,
so connectors, pull requests with Link and Create, schedules and
background tasks sit beside placement, secrets and lineage. The header
opens Files directly instead of a modules sheet, and the module picker
is gone. Pull request and task rows still open full tabs.

The shared workspace model drops the per-thread panel state and the
removed Files and Connectors module tabs. Saved layouts from older
versions keep their tabs and ignore the old panel fields.

Related: #640
nixuuu added a commit that referenced this pull request Nov 14, 2026
Thread details on mobile again has everything the summary had at hand,
so connectors, pull requests with Link and Create, schedules and
background tasks sit beside placement, secrets and lineage. The header
opens Files directly instead of a modules sheet, and the module picker
is gone. Pull request and task rows still open full tabs.

The shared workspace model drops the per-thread panel state and the
removed Files and Connectors module tabs. Saved layouts from older
versions keep their tabs and ignore the old panel fields.

Related: #640
nixuuu added a commit that referenced this pull request Nov 14, 2026
…#710)

## Change

Stage 1 of the workspace v3 redesign (option C, approved by the user),
based on the workspace stack #640–#648.

**Thread summary is its own element.**
- A fixed 20 rem card in the thread area's top-right corner. It is no
longer the right panel's empty state, so it never changes width with the
panel and never jumps between threads.
- It collapses to a pill showing the branch, the newest pull request
with its checks, and the subagent count. Expanded or collapsed is one
device-wide choice (`threadPanelCollapsed` in the device view).
- It again has everything the summary had at hand before #640:
  - placement: computer, directory or worktree, branch, Manage worktree;
- pull requests with state, checks and the current branch's PR
highlighted, plus Link and Create;
- background tasks, and schedules with pause/resume/cancel plus
"Schedule a task";
  - connectors with availability plus Manage;
  - secrets, fork, lineage and subagents.
- The duplicate title row is gone.
- The chat column centres left of the card's lane (`chat-column`,
`--chat-lane`). The lane depends only on the area width, so toggling the
card never moves text. Where both do not fit, the column keeps left and
the card floats over it with a shadow. Below 32 rem the pill opens a
sheet. Escape in the card collapses it and returns focus to the pill.

**The right panel holds Files only.**
- One top-bar `Files` toggle (a sheet on narrow screens).
- Removed: the icon rail, the module dropdown, the panel `+`, pop-out,
both extra collapse buttons and the top-bar info button, together with
the Pull requests, Tasks and Connectors panel modules. PR and task rows
still open full tabs.
- Files open state and width (256–480 px) are device-wide. The old
per-thread values are no longer read.

**Motion.**
- The workspace grid eases the Files column (`t-panel-column`, 400 ms
open / 350 ms close, `--ease-smooth-out`). The panel content stays
mounted at a fixed width and only fades (`t-panel`), clipped by the
shrinking column.
- The summary grows from its pill (`t-summary`, `--duration-fast`, from
`--scale-large`) and shrinks back on `--duration-quick`.
- The double "rise" on module switches is gone.
- `prefers-reduced-motion` makes all of it instant; resizing disables
the column transition.

`docs/workspace.md` (Polish) describes the v3 model: the summary is a
separate element, not part of the panel.

Related: #640

## Verification

Run with `nice` and temp in `/var/tmp`, on the stack head:
- `bun install`, `gen:check`, full `typecheck`, `lint`, `format:check`,
the web production build and both mobile exports pass. iOS and Android
fingerprints are identical to `dev`.
- Focused test: `tests/integration/device-view.test.ts` now also covers
the Files width bounds.
- Full `check:tmp` passed on the stack head (see #712).

Browser checks used a private bench stack seeded with a long branch, PR
#412 with checks, 19 subagents, schedules and a long Polish title, in
light and dark at 1440, 1100 and 390 px:
- The card sits in its lane at 1440 and floats over the column at 1100.
The pill shows branch, PR and checks, and subagents. The sheet opens at
phone width.
- Mid-animation frames show the Files column easing (for example
`1013/138 px` → `885/266 px`) while the panel content fades inside it.
- Switching threads with Files open keeps the grid at `864px 288px` and
the card at the same x and width on every sample, so nothing jumps.

## Copy audit (§8)

| Before | After | Reason |
| --- | --- | --- |
| `Collapse panel` / `Show panel` / `Open modules` (top bar), `Collapse
panel` / `Close modules` (panel) | `Files` toggle (pressed state) | One
control. The label names the panel, like the sidebar toggles. |
| `Thread details` (top-bar info button) | `Show thread details` (pill),
`Collapse thread details` (card) | Verb first. The pill and the card
each have one action. |
| `Toggle thread details` (palette) | `Toggle thread details`, `Toggle
Files` | One command per element. |
| `Resize workspace panel` | `Resize Files` | Names what resizes. |
| `Working directory` (tree header) | `Files` + directory name | Says
what the panel is and whose files they are. |
| `Open module`, `Open sidebar module`, `Open in tab`, `Close module`,
`Thread details ▾` | removed | Mechanisms removed. |
| `Open Tasks to choose another task.` | `Choose another task in Thread
details.` | The Tasks module no longer exists. |
| (none) | `This tab is no longer available` / `Close it to continue.` |
Empty state for a restored tab of a removed module: a title plus one
sentence with the action. |

Glossary terms are unchanged ("thread", "subagent", "worktree"). No new
error texts. No text relies on colour alone: PR state and checks have
accessible labels. Checked with short and long titles and branches at
desktop and phone widths.
nixuuu added a commit that referenced this pull request Nov 14, 2026
## Change

Stage 2 of the workspace v3 redesign, based on stage 1.

**Tabs.**
- `Thread` is always visible as the first tab.
- The other tabs fill the row around the active one, which keeps its
full name (up to 12 rem) while the others truncate first.
- A `+N` chip lists the rest, with full paths and unsaved marks, only
when they do not fit.
- The header has no `+` and no permanent `⌄` tab menu.
- Delete closes a focused tab, double-click keeps a preview, and the
roving tabindex is unchanged.

**File toolbar.**
- One 40 px row: the path (muted directory, emphasised name, both
selectable), `Source`/`Rendered` for Markdown, and `Edit`. While
editing, `Discard changes`/`Stop editing` and `Save file` take the same
place.
- One `⋯` 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.
- The repeated file name and the two identical copy buttons are gone.
- `copyText` is now one shared clipboard helper.

Related: #640

## Verification

- Checks as in stage 1 (typecheck, lint, format, web build) on this
head.
- In the browser, with the bench workspace fixture: 4 kept tabs at 1100
px dark and light show `Thread`, the long-named tab truncated, the
active `tab-1.ts` in 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)

| Before | After | Reason |
| --- | --- | --- |
| `Render Markdown` / `View source` | Segmented `Source` / `Rendered`
(label `View`) | Shows the state, not a toggle verb. |
| `Delete file` button in the bar | `Delete file` last in `File
actions`, after a separator | Destructive action away from view toggles.
No ellipsis, because §2 reserves it for ongoing actions. |
| `Switch tab (N)` button with a menu, plus `Search and commands` | `+N`
chip (`N more tabs`), menu `More tabs` | Exists only on overflow. Search
stays in the thread menu and the palette. |
| two copy icons | `Copy path`, `Copy text` menu items | Verb-first
labels. |
| `Reload`, `Keep tab`, `Go to line` buttons | same labels, now menu
items | Unchanged wording. |

No new error or empty-state texts. Checked with short, long and very
long file names at 1440, 1100 and 390 px.
nixuuu added a commit that referenced this pull request Nov 14, 2026
…712)

## Change

Stage 3 of the workspace v3 redesign, with mobile parity. JS only,
shipped over the air.

- **Thread details** on mobile again has what it had before #640:
  - connectors with availability and Manage;
  - placement;
  - pull requests with Link and Create;
  - secrets;
  - schedules with their actions;
  - background tasks;
  - lineage and subagents.

  PR and task rows still open full tabs of the current thread.
- The header opens **Files** directly (a sheet with the tree) instead of
a Modules sheet. The module picker (`+`), `Open in tab` and `Close
module` are gone.
- Shared domain: `Workspace` drops the per-thread panel state
(`sidebar`, `panelCollapsed`, `panelWidth`, `setSidebar`,
`collapsePanel`, `sizePanel`). The module list keeps only the full-tab
kinds (pull requests and tasks). Saved layouts from older versions keep
their file and PR tabs and ignore the old fields and removed module
tabs.
- `docs/workspace.md`: the mobile surfaces match the new model.

Related: #640

## Verification

- `bun install`, `gen:check`, full `typecheck` (web and mobile), `lint`,
`format:check` and the web production build pass on this head.
- `expo export` for iOS and Android passes.
- `@expo/fingerprint` gives identical hashes for this head and `dev`:
iOS `138e0c6b…`, Android `906dc944…`. The change is OTA-safe.
- Full `check:tmp` passed: 3002 pass, 175 skip, 0 fail across 570 files,
with nothing left in the temp dir. It ran before two later fixes that
touch only styles and a label (summary card height, "Delete file"
without an ellipsis).
- **Device check pending.** I did not run the app on a simulator or
device. The sheet contents reuse the pre-#640 components unchanged.

## Copy audit (§8)

| Before | After | Reason |
| --- | --- | --- |
| `Modules` (header icon), sheet title `Modules` | `Files` | Names the
only remaining panel, as on web. |
| `Open module`, `Open sidebar module`, `Open in tab`, `Close module` |
removed | Mechanisms removed. |
| (none) | `This tab is no longer available. Close it to continue.` |
Notice for a restored tab of a removed module, with the action. |

No other text changes. Glossary terms are unchanged.
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 15, 2026
nixuuu added a commit that referenced this pull request Nov 15, 2026
Writable text files now open directly in the editor. Typing pins a
preview tab; saving and discarding keep the editor, cursor and undo
state mounted. Files without write permission, linked or offline
computers, images, binary files and files above the edit limit stay read
only. Dirty drafts remain visible when editing becomes unavailable.

Scrolling used to replace the reader token map and debounce editor
decorations for each viewport. The tokenizer kept grammar checkpoints
but discarded line tokens. Both web surfaces now consume persistent line
tokens from one background executor, which prepares the file in bounded
batches and invalidates the grammar suffix after edits. Token memory and
execution time stay bounded; pathological long lines retain readable
plain text. Mobile removes the same edit toggle and retains/prefetches
highlight windows in its existing JS reader. Its native TextInput still
uses plain text while typing and highlighted Preview changes.

Related: #640, #648

Validation: install, generated-contract check, full typecheck, lint,
formatting check and web production build passed. The syntax regression
tests passed (5 tests, 112 assertions), covering a 20k-line multiline
grammar revisit, edits and JSON/YAML/Python. Browser review used an
isolated synthetic stack: light/dark, desktop/390px phone,
small/20k-line files, a 50k-character line, TypeScript/Python/JSON/YAML,
permission/size/binary/image read-only cases, dirty availability loss,
save/discard and close protection. No UI suites or full
integration/check:tmp run. Native device behavior and generated Expo
fingerprint hashes were not measured; native dependency/config/module
inputs and lockfile are unchanged.

Scroll measurements (Chromium 157, 1280×800, Vite, 20,000 lines/308,889
bytes, 360 rAF frames forward/back, without recording):

| Surface | Before p95 | After p95 | Plain visible-line samples before →
after |
| --- | --- | --- | --- |
| Reader, warm cache | 16.8 ms | 16.7 ms | 12,583/12,652 → 0/12,652 |
| Editor | 16.7 ms | 16.7 ms | 1,002/11,802 → 0/11,802 |

Final editor maximum was 16.8 ms, with no intervals above 33.4 ms. These
are rAF intervals, not compositor presentation timings. First coloring
is asynchronous: an immediate cold reader sweep still sampled
2,073/12,652 plain lines during grammar startup. Returning to prepared
lines does not repeat that transition. Recordings add substantial
overhead and were excluded from frame-time conclusions. Evidence is kept
outside the repository in `/var/tmp/canopy-file-viewer-shots/`.

Copy audit (§8): removed Edit/Stop editing; retained Save file/Discard
changes and their existing confirmation behavior. Read only and
offline/other-computer explanations describe the current state and the
recovery action. Labels remain English, use existing terms and sentence
case, and fit phone/desktop layouts in both themes. No internal
tokenizer details were added to the user flow.
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.

1 participant