Skip to content

feat(workspace): complete file viewer migration - #648

Merged
nixuuu merged 2 commits into
feat/workspace-resourcesfrom
feat/workspace-completion
Nov 13, 2026
Merged

nixuuu merged 2 commits into
feat/workspace-resourcesfrom
feat/workspace-completion

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 7 integration files: thread-directory-race.test.ts, thread-directory.test.ts, thread-file-previews.test.ts, thread-highlight.test.ts, computer-relay.test.ts, thread-root-checkpoint.test.ts, thread-watch-cancellation.test.ts, thread-watch-relay.test.ts, thread-watch.test.ts, thread-scroll.test.ts, thread-watch-failures.test.ts, thread-live-updates.test.ts, connector-sessions.test.ts, connector-session-errors.test.ts, codex-provider-warnings.test.ts, prompt-after-turn-end.test.ts, thread-work-window.test.ts. Existing feed logic files: feed-rows.test.ts, work-history-gaps.test.ts, feed-prefix.test.ts, work-fold-state.test.ts, work-tool-groups.test.ts, steer-folds.test.ts, notice-folds.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.

Thread file links now use the workspace in every transcript. A link outside the current workspace opens the correct thread and selects its file tab. The old web modal, mobile file screen and their separate mutation state are removed; attachment, blob and bot viewers keep their existing flows.

The web editor now has one highlighting path, using off-main-thread tokens. Architecture and client documentation describe the completed workspace, module surfaces and scoped file lifecycle. No database migration, protocol change or native configuration change.

Stage 7 of 7 in stack #643, based on stage 6. All seven implementation PRs stay drafts. The maintainer merges the whole stack at once after verification, including the deferred device check.

Related: #613

Pre-merge corrective rebase

Rebased all seven draft layers onto dev 4bb71c80142e0c1d0616502ce428ca2bf19d8cad, preserving the merged thread scroll memory and default tool-group folding. The stack includes directory-handle confinement in stage 3, mobile source scroll restoration in stage 4, document root checkpoints/mutation fences plus queued-watch cancellation and onward capability in stage 5, and retained hidden-document root checks in stage 6. No manual feed/work-fold edits.

Current-head install, gen:check, full typecheck, lint, format:check, production web build and iOS/Android exports passed with nice at every stage after the final rebase. Both nightly native fingerprints match dev at all seven layers. Current-head CI is green on all seven PRs, including all four test shards for each layer.

On the final head, all 9 changed integration files passed serially locally after the static checks and exports finished: 53 tests, 10,694 assertions, 0 failures. The merged thread-scroll integration also passed (3 tests / 23 assertions), making 56 tests / 10,717 assertions across 10 files, with every private temp directory clean. The same ten files also passed serially on the otherwise idle review machine. Introducing-stage regressions passed separately in stages 3–6: directory ABA/refusal and bounded listing locally in stage 3; highlighting locally and previews/relay on the review machine in stage 4; retained root/cancellation locally and onward watch/existing watches on the review machine in stage 5; root/cancellation/onward/resource/access files on the review machine in stage 6. Every test invocation used nice and ran one file at a time.

The controlled ancestor swap returns only the original inside filename and size; a substituted ancestor before handle acquisition is refused. Identical-byte checkout replacement rejects the retained draft and direct stale write/delete, with and without reopening the watch; explicit discard/reload permits the new checkout. Thirty-five released queued additions leave no subscriptions, native watches or callbacks; a fresh subscription works. A real three-gateway route negotiates the watch feature, delivers a change and releases the home worker watch.

There is no claimed full local-suite pass for this corrective rebase. Earlier local full attempts were interrupted by SIGTERM. Before the last dev rebase, a detached setsid nohup / nice attempt ran beyond the tool timeout but failed existing computer-move reachability/discovery cases under load; its owned process group was then stopped with SIGINT (exit 130, private temp directory clean). One earlier computer-move owner-discovery failure passed in isolation (1 test / 30 assertions). A first stage-4 preview run on the loaded host also failed after its 100 ms computer-link heartbeat expired; the same head passed all 12 previews on the idle review machine. These failures and interrupted runs are not counted as passes. The maintainer authorized green CI on all seven PRs plus serial corrective/stack files as the fallback.

Current initial thread JS is 766,417 gzip bytes versus dev 756,367: cumulative +10,050 bytes / 9.81 KiB, within the 15 KiB budget. The new stage-6 maximum is +14.45 KiB, also within budget; editor and grammar imports remain deferred. Other detailed timing/endurance measurements below are historical and are not relabelled as measurements on this head.

Fresh production-browser review of this final head on the separate review machine covered light/dark at 1440/820/390 px, short/long names, docked summary with no module, Files with summary closed, floating summary and Escape, narrow/phone summary and Files sheets, and the phone tab-switcher sheet. Switching away/back restored the saved web-file offset (1200 px); sample.ts:31-40 scrolled to and highlighted the range. No horizontal document overflow was found at narrow/phone widths. The owned browser tab, servers, container, tunnel, runtime directory and review checkout were removed afterward.

Native macOS/Windows directory-handle execution remains unverified. Device check pending, including native mobile scroll restoration on switching away/back; typecheck, exports and web review do not establish that runtime result. All seven PRs stay drafts for the maintainer's independent re-check of stack #643; none was marked ready or merged.

Earlier implementation verification (historical)

  • Passed with nice: install, generation check, full typecheck (Svelte: 0 errors/warnings), lint, formatting check and production web build. Full check:tmp: 2,785 passed, 166 skipped, 0 failed; nothing left in the private temp directory.
  • iOS/Android exports passed. Nightly native fingerprints match the baseline: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9.
  • Initial thread JS: 764,558 bytes gzip versus dev 754,751: +9,807 bytes / 9.58 KiB (15 KiB budget). Removing the old modal reduces stage 6 by 4,737 bytes gzip. Editor and grammar code remain deferred.
  • Production browser reviewed in light/dark at 1440/820/390 px, with short and long names, Files in a panel/sheet, line/range source, summary placement, editing, Undo and keyboard save. File views are tabs; no legacy thread-file modal host remains.
  • On the isolated review machine, 30 opens of 100 KiB: plain text p50 48.6 ms / p95 65.2 ms; stable view p95 81.9 ms. 100 warm switches: p50 31.9 ms / p95 32.4 ms, 0 additional Files requests. After warmup and 20 edit/discard/close cycles with explicit GC, retained JS heap grew 421,077 bytes / 0.40 MiB (5 MiB budget).
  • Three alternating 2-minute renderer pairs, 1000 turns / 2800 messages per run: baseline/current handler p95 0.4/0.4, 0.4/0.4 and 0.5/0.5 ms. Pairs 2/3 renderer task busy: 12.99/12.57% and 12.62/12.76%; layout 5.27/5.05 and 5.15/5.13 ms/s. Long-task totals for those pairs: 3752/3704 and 3723/3724 ms. The first baseline trace is partial and is not used for a full-duration CPU comparison.
  • Production endurance: 30 minutes / 648 open-edit-Undo-close cycles, including 22 offline/reconnect draft checks, completed without an error. Task busy 9.08%, layout 4.93 ms/s, 43 long tasks / 2939 ms total. rAF gap p95 16.8 ms; 100 gaps above 34 ms across 107,732 callbacks (0.093%). This is a scheduler proxy, not compositor lost frames. Final heap after GC: 69,592,520 bytes / 66.37 MiB; the separate warmed 20-cycle retained-heap result above is the budget check. Both runs used a visible 1440×900 Chromium page with reduced motion disabled.
  • File 100 KiB under browser transport emulation (100 ms, 10 Mbit/s), 30 opens over a private HTTP/2 proxy: plain p50 248.6 ms / p95 265.5 ms, stable p95 282.3 ms. A separate HTTP/1.1 proxy applies 100 ms response delay and a shared 1.25 MB/s response budget outside the browser: 30 opens, plain p50 265.0 ms / p95 265.6 ms, stable p95 282.3 ms, maximum 565.6 ms. Both controlled proxy runs meet the 800 ms goal; neither proves physical linked-home WAN latency.
  • Diagnostic limitation retained: browser-wide HTTP/1.1 emulation over the same BFF had plain p95 4181.1 ms, with about 3.9 s spent before request dispatch in slow samples. That result differs from the independently paced HTTP/1.1 run above and is not silently discarded or presented as a confirmed application fix. No speculative SSE code change was made: a focused real-gateway/worker cancellation probe passed.
  • Directory reload, 30 samples: local p95 33.7 ms, browser-shaped HTTP/1.1 p95 133.7 ms. A 10,000-child directory kept 45 tree items in DOM. These are reload/virtualization measurements, not cold module-import times. Editor input on 100 KiB, 30 inputs with Undo: p50 27.6 ms / p95 35.0 ms to the second frame (including automation round trips).
  • Three alternating production SPA navigation pairs, 30 measured openings per member after warmup: baseline/current p95 108.5/107.8, 109.7/109.7 and 113.6/106.9 ms; p50 67.2/71.1, 86.7/78.3 and 79.0/72.5 ms. These measure thread articles/composer readiness to the next frame, not browser TTI or cold startup. An earlier 20-sample probe had p95 96.6/106.8 ms and exceeded the tolerance; the larger alternating runs are reported alongside it rather than suppressing that sample.
  • Measurements used headless Chromium with software rendering. Actual compositor lost frames, isolated application RSS, bitmap memory and native process/JS profiling remain unmeasured. Browser/proxy transport shaping is a controlled surrogate, not a measurement of a physical linked computer's WAN route. Native results are not claimed.
  • Device check pending: Device support is unavailable. The maintainer authorized typecheck, exports and unchanged fingerprints while continuing. Consolidated device review remains required before merge; mobile runtime performance is unverified.
  • No UI tests added. Existing gateway/worker integration covers scope, paths, bounded listing, watch lifecycle and conflicts.

Copy audit — docs/copy.md §8

  • No new UI labels or errors. Existing workspace actions replace the old modal actions.
  • File names remain selectable and paths keep their explicit line/range meaning. Attachment copy is unchanged.
  • No new glossary terms, humorous copy or inspiration references. Short and long paths retain truncation and explicit actions in both themes at desktop, narrow and phone widths; native device review is pending.

@nixuuu
nixuuu added this pull request to stack #643 November 13, 2026 15:47
@nixuuu
nixuuu force-pushed the feat/workspace-completion branch 3 times, most recently from aa5f7ca to e8d805d Compare November 13, 2026 18:01
@nixuuu nixuuu closed this Nov 13, 2026
@nixuuu nixuuu reopened this Nov 13, 2026
@nixuuu
nixuuu force-pushed the feat/workspace-completion branch 2 times, most recently from 0f0890e to 542453a Compare November 13, 2026 19:33
@nixuuu
nixuuu force-pushed the feat/workspace-completion branch from 542453a to 461e8c1 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-completion branch 2 times, most recently from 2588133 to b78084e Compare November 13, 2026 22:29
@nixuuu
nixuuu force-pushed the feat/workspace-completion branch from b78084e to ea023cb Compare November 13, 2026 22:41
@nixuuu
nixuuu merged commit dcd13fa into dev Nov 13, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/workspace-completion 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 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 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
## 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 5
integration files: `thread-root-checkpoint.test.ts`,
`thread-watch-cancellation.test.ts`, `thread-watch-relay.test.ts`,
`thread-watch.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.

Files now watch only the visible directories and active document.
External changes refresh clean content and preserve dirty drafts, with
Compare changes, Copy changes and a confirmed Discard and reload. The
comparison switches between virtual read-only disk/draft versions; it
never force-overwrites a file.

The additive `WatchThreadFiles` stream carries bounded invalidations,
never source or a tree snapshot. Gateway ownership, path checks and home
routing apply before subscription. Shared checkout watches have bounded
replay, reconnect requests visible-scope revalidation, and
cancellation/background releases the stream and retries. Save conflicts
use a typed Connect code and HTTP 412 in the BFF. No database migration
or native configuration change.

Stage 5 of 7 in stack #643, based on stage 4. Every implementation PR
remains a draft until the whole stack is finished and verified; the
maintainer merges the stack at once.

Related: #613

## Pre-merge root, watch and relay corrections

- Every file response carries its root identity. The document retains
that checkpoint with its base and draft across watch stops. A changed
root remains a conflict until explicit discard and reload, even with
identical base bytes. Additive `expected_root_identity` fields reach the
home worker for writes and deletes; a stale root yields `Aborted`.
Unsupported workers cannot silently ignore a supplied checkpoint.
- Released queued additions check cancellation inside the serialized
operation and after reconciliation. Pending additions keep coordinator
ownership until cleanup. The controlled slow-reconciliation regression
with 35 released queued subscriptions leaves zero subscribers, zero
directory watches and zero callbacks after release; a fresh subscription
still works.
- Supported onward routes advertise `thread_files_watch_v1`. A new
three-gateway integration covers negotiation, delivery of a file change
and cancellation at the home worker.

Rebased onto corrected stages 3–4 and dev
`4bb71c80142e0c1d0616502ce428ca2bf19d8cad`, preserving 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.

Serial integration files all passed with clean private temp directories:
root checkpoint (2 tests / 30 assertions, both with and without a
reopened watch) and queued cancellation (1 / 10) locally; three-gateway
onward watch (1 / 5) and existing watches (6 / 43) on the otherwise idle
review machine. The old draft cannot write or delete identical-byte
replacement files; explicit discard/reload permits the new checkout.
Thirty-five released queued subscriptions leave no subscribers, watches
or callbacks.

Interrupted local full-suite attempts are not counted as passes. Before
the last dev rebase, a detached full run continued beyond the tool
timeout but failed existing computer-move reachability/discovery cases
under load and was stopped with a clean private temp directory. The
maintainer authorized green CI on every layer plus serial
corrective/stack files as the fallback; #648 records the final evidence.
**Device check pending** remains in effect. The final stack head
received a fresh production-browser review in both themes at
1440/820/390 px; prior performance observations below remain historical.
This PR stays a draft in stack #643.

Current initial thread JS is 770,777 gzip bytes versus dev 756,367:
cumulative +14.07 KiB, within the 15 KiB budget.

Copy audit for this correction: “reopen the file” → “reload the file”
names the explicit recovery action for a root conflict; an unsupported
checkpoint asks the user to update the computer and reload before
changing the file. Existing conflict copy is reused for rejected
mutations. No new labels, layout, glossary terms or humorous copy.

## Earlier implementation verification (historical)

- Passed with `nice`: install, generation check, full typecheck, lint,
formatting check, production web build and full `check:tmp` (nothing
left in the private temp directory). CI is green.
- New gateway/worker integration: 6 passed, 0 failed. Real local and
linked-home streams cover owner isolation, traversal/symlink refusal,
scope and envelope limits, replay, last-subscriber cancellation, burst
recovery and dirty/hash conflicts without mutation replay.
- Mobile typecheck and iOS/Android exports passed. Native fingerprints
match the baseline with the nightly identity: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`.
- **Device check pending**: Device support is unavailable. The
maintainer authorized continuing with typecheck, exports and unchanged
fingerprints. Consolidated iOS/Android device review remains required
before the stack is merged; device CPU/FPS/IME and background results
are not claimed.
- Initial thread JS is 768,856 bytes gzip, cumulative +14,105 bytes /
13.77 KiB versus the dev baseline (15 KiB budget). File UI and watch
adapters load on demand. On the isolated review machine, 30 opens of 100
KiB: plain text p50 48.7 ms / p95 52.1 ms; stable view p95 65.7 ms. 100
warm switches: p50 32.2 ms / p95 33.2 ms. Restarting a watch epoch
revalidates the active file; these measurements do not claim zero
network requests during switches. GC was unavailable, so the
retained-heap budget is unverified.
- Manual browser review covered light/dark, desktop/narrow/phone widths
and long paths. A real worker filesystem watcher refreshed clean
content, preserved a dirty draft, exposed both comparison versions, and
reloaded the disk version only after discard confirmation. The save
button is disabled for a known conflict.
- No UI tests added. No full-tree or transcript snapshot recovery,
polling of file contents, write replay or automatic overwrite.

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

- Previously stale content → Changed on disk / Removed from disk, with
explicit Compare changes, Copy changes and Discard and reload actions.
The draft is preserved until confirmation.
- Generic save rejection → a typed conflict with an explanation and an
action; no hash, cursor, parser or transport jargon in UI errors.
- Unavailable live changes → a plain explanation and Reload fallback.
Short labels reserve status space and do not depend on color.
- Comparison labels name the selected version; all destructive
confirmations retain explicit verbs. No humorous copy or inspiration
references. Light/dark and desktop/narrow/phone layouts preserve
truncation and explicit actions.
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 6
integration files: `thread-root-checkpoint.test.ts`,
`thread-watch-cancellation.test.ts`, `thread-watch-relay.test.ts`,
`thread-watch.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.

Workspace now releases read work, live streams and cached bytes when a
paired scope or thread access ends. A replaced worktree root preserves
the old draft and requires explicit discard/reload. Clean content is
bounded to four warm files on web and two on mobile, in addition to byte
budgets; inactive files receive invalidation markers without background
reads.

This also forwards file-read cancellation through the BFF, fences late
responses after cleanup, clears mobile token caches and excludes IME
composition from workspace shortcuts. No database migration or native
configuration change.

Stage 6 of 7 in stack #643, based on stage 5. All implementation PRs
remain drafts. The maintainer merges the whole stack at once.

Related: #613

## Pre-merge root-checkpoint correction

Rebased onto corrected stages 3–5 and dev
`4bb71c80142e0c1d0616502ce428ca2bf19d8cad`, preserving merged thread
scroll memory and default tool-group folding. Root identities are
checked for every retained document in a thread, including hidden tabs.
Resource/access guards retain the new expected-root argument through
writes and deletes; explicit discard and reload remain necessary after a
root replacement.

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. Serial integration files on the
otherwise idle review machine passed with clean private temp
directories: root checkpoint (2 tests / 30 assertions), queued
cancellation (1 / 10), onward relay (1 / 5), and expanded
watch/resource/access coverage (9 / 58). Stages 3 and 5 also passed the
three blocker regressions locally on their introducing heads.

Current initial thread JS is 771,163 gzip bytes versus dev 756,367:
cumulative +14.45 KiB, within the 15 KiB budget. No UI text or web
layout changed in this correction. The final stack head received a fresh
production-browser review in both themes at 1440/820/390 px, including
long names, Files panel/sheet and summary dock/float/sheet. Earlier
performance observations below remain historical; **Device check
pending** remains in effect.

Interrupted local full suites are not counted as passes. Before the last
dev rebase, a detached full run continued beyond the tool timeout but
failed existing computer-move reachability/discovery cases under load
and was stopped with a clean private temp directory. The maintainer
authorized green CI on every layer plus serial corrective/stack files as
the fallback; #648 records the final evidence. This PR remains a draft
in stack #643.

## Earlier implementation verification (historical)

- Gateway/worker integration: 9 passed, 0 failed. Real local and
linked-home streams cover owner/path safety, bounded replay,
paired-scope cleanup, thread access revocation, root replacement and
preservation of drafts.
- Passed with `nice`: install, generation check, full typecheck, lint,
formatting, production web build and iOS/Android exports. Full
`check:tmp`: 2,785 passed, 166 skipped, 0 failed; nothing left in the
temp directory.
- CI is green. The first run had one existing remote thread-sequence
recovery assertion returning the previous title after home reconnection.
The unchanged test passed in isolation (1 passed, 0 failed, clean temp
directory), then the failed CI shard passed on rerun.
- Nightly native fingerprints match baseline: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`.
- Browser review: light/dark, 1440/820/390 px widths, short and long
file names, virtual source and line ranges, docked summary, Files panel,
floating summary and phone sheet. No added UI suite.
- On the isolated review machine: 100 warm switches p50 31.8 ms / p95
32.9 ms and **0 additional Files requests** (including subscriptions).
After warmup and 20 edit/discard/close cycles with GC exposed, retained
JS heap grew 517,260 bytes / 0.49 MiB (5 MiB budget).
- Initial thread JS: 769,295 bytes gzip, cumulative +14,544 bytes /
14.20 KiB against dev (15 KiB budget). This measures the static import
closure; editor/grammar loading remains deferred.
- These stage-6 measurements do not verify RSS/bitmap memory or native
runtime budgets. Final cumulative streaming/navigation pairs, controlled
transport probes and the 30-minute file/Undo/offline endurance run are
reported in stage 7 (#648), including the browser HTTP/1.1 emulation
outlier and remaining measurement gaps; those results do not relabel the
stage-6 head as separately measured.
- **Device check pending**: Device support is unavailable. The
maintainer authorized typecheck, iOS/Android exports and unchanged
native fingerprints while continuing the stack. Consolidated device
review is still required before merge.
- No UI tests, database migrations or native dependency changes.

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

- Stale/inaccessible content → “File access ended. Reopen the thread to
check access.” The action matches the cleared scope.
- A changed root → an explanation followed by Copy changes / Reload; an
old draft never silently becomes a new-root edit.
- Existing short labels and conflict confirmations are preserved. IME
input is excluded from shortcuts. Responsive/theme review preserves
explicit actions and truncation at desktop, narrow and phone widths.
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
…#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 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