Skip to content

feat(workspace): virtualize file views and highlight off thread - #645

Merged
nixuuu merged 2 commits into
feat/workspace-file-treefrom
feat/workspace-highlighting
Nov 13, 2026
Merged

nixuuu merged 2 commits into
feat/workspace-file-treefrom
feat/workspace-highlighting

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 4 integration files: thread-highlight.test.ts, 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.

File tabs now render virtual source rows and highlight the active viewer/editor in a dedicated CPU executor. Mobile keeps native editing and colors the saved viewer or an explicit Preview changes draft through a bounded gateway/worker RPC. Source indexing yields in chunks, long lines remain fully readable, and large files start as plain text.

The additive GetThreadFileHighlight contract carries at most 200 lines / 64 KiB of semantic offsets and roles, tied to the file hash and draft revision. The gateway derives ownership and cwd. Draft source cannot cross an onward-sharing relay and is never persisted. One worker executor has four waiting slots, bounded source/checkpoint caches and a 100 ms execution deadline after separately bounded grammar initialization. Raster headers are checked before client decoding; images above 16 MP are refused and GIF/animated previews are static.

Stage 4 of 7 in stack #643, based on stage 3. All implementation PRs stay drafts until the entire stack is finished and verified; the maintainer merges it at once. No database migration or native configuration change.

Related: #613

Pre-merge reading-position correction

The mobile source viewer restores the document's saved offset after full indexing, content measurement and layout. A newly requested line takes precedence, and preparatory scroll events cannot overwrite the saved offset. No UI text or native configuration changes.

Rebased onto corrected stage 3 and dev 4bb71c80142e0c1d0616502ce428ca2bf19d8cad, preserving merged thread scroll memory and default tool-group folding. Current-head install, gen:check, typecheck, lint, format:check, web build and both mobile exports passed with nice; nightly native fingerprints match dev. Current-head CI is green, including all four test shards. Highlight integration passed locally (6 tests); file previews (12) and three-gateway relay (11) passed serially on the otherwise idle review machine. A first preview run on the loaded host failed after its 100 ms heartbeat link timed out; it is not counted as a pass. Every run cleaned its private temp directory. Stage 3 separately passed its directory regressions on the rebased head.

Current thread-route JS is 770,456 gzip bytes versus dev 756,367: cumulative +13.76 KiB, within the 15 KiB budget. The final stack head was reviewed again in a production browser in light/dark at 1440/820/390 px, with long names, source colors, line/range positioning, Files and summary sheets. Web file scroll was restored to the recorded 1200 px after switching away and back; this does not establish the native mobile result.

Device check pending, including switch-away/back scroll restoration; no real-device result is claimed. The maintainer authorized green CI on every layer plus serial corrective/stack files if the detached full run still fails under shared-host load. The final stack PR records that run; interrupted local full suites are not counted as passes. Prior performance observations below are historical. This PR remains a draft in stack #643.

Earlier implementation verification (historical)

  • Passed with nice: install, full typecheck, gen:check, lint, format:check, web production build and a compiled Linux worker binary. Full check:tmp: 2776 passed, 166 skipped, 0 failed, nothing left in the private temp directory. CI is green.
  • New highlight integration: 6 passed, 0 failed. Covers home routing through a real computer link, owner isolation, traversal/symlink safety, saved/draft hash and revision separation, bounded responses, long-line fallback, older workers and restart.
  • File preview integration: 12 passed, 0 failed, including safe raster dimensions, a static PNG preview and refusal above the pixel budget. Three-gateway relay integration: 11 passed, 0 failed, including rejected draft forwarding and forged incoming envelopes.
  • iOS and Android exports passed. Mobile typecheck passed. Native fingerprints equal the dev baseline with the nightly identity: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9.
  • Device check pending: Device support remains unavailable. The maintainer explicitly authorized continuing without device verification. Consolidated iOS/Android device review remains required before merging the stack; native CPU/FPS, keyboard/IME, background behavior and thermal results are not claimed.
  • Production browser inspected in light/dark at desktop, narrow and phone widths, with short and long names. Virtual rows, line/range positioning, theme colors, editor decorations, dirty/discard flow and horizontal overflow reviewed. Local fallback used while two review setups occupied the second machine; the prior remote review setups were then stopped.
  • Local synthetic 100 KiB file, 30 openings: p95 visible plain text 52.8 ms (250 ms budget), stable view 65.7 ms. Warm tab switch: p95 36.8 ms across 100 samples (50 ms budget), zero additional file reads. These are local synthetic measurements, not controlled remote-latency or native results.
  • Initial thread JS: 768,832 bytes gzip, cumulative +14,081 bytes / 13.75 KiB versus dev; within the 15 KiB budget. Syntax executor and editor remain lazy. The 20-cycle browser check had no explicit GC, so its coarse heap reading is not evidence for the retained-heap budget; final resource profiling belongs to stages 6–7.

Disk invalidation/watch and conflict comparison remain stage 5; final scope cleanup and migration removal remain stages 6–7. No UI test suite was added.

Copy audit — docs/copy.md §8

  • Plain mobile file text → saved viewer colors and the explicit Preview changes / Keep editing actions; native editing remains immediately available.
  • Large or unsupported syntax → a compact reason, readable plain text and Enable highlighting where applicable. Errors explain that the file remains readable; older capabilities give an update action in words.
  • Unbounded image decoding → a stated preview limit with an action to open the file on its computer. No parser, cursor or transport jargon in the surface text.
  • Line highlights supplement original line numbers and Go to line. Dirty state and failures have text; neither depends only on color.
  • Short, typical and long names inspected across the responsive widths and both palettes. Sentence case and verb actions retained; no humorous copy or inspiration references.

@nixuuu
nixuuu added this pull request to stack #643 November 13, 2026 14:56
@nixuuu
nixuuu force-pushed the feat/workspace-highlighting branch 4 times, most recently from faa463e to 2ec4ea5 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-highlighting branch 2 times, most recently from cd93647 to 0544746 Compare November 13, 2026 22:29
@nixuuu
nixuuu force-pushed the feat/workspace-highlighting branch from 0544746 to 9275040 Compare November 13, 2026 22:41
@nixuuu
nixuuu merged commit 5e4a077 into dev Nov 13, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/workspace-highlighting branch November 13, 2026 23:01
nixuuu added a commit that referenced this pull request Nov 19, 2026
## Changes

- Restore drag selection in the read-only source preview by opting the
reader into the app's text selection styles. The regression began when
the virtual reader replaced the selectable code view.
- Copy the selected source offsets as plain text. This preserves blank
lines and avoids inserting newlines between parts of a long source line.
The file toolbar still copies all loaded text.
- Add a manual regression check to the workspace documentation.

## Verification

- On nix-pc, before the fix, dragging across source text in Chromium
left the selection empty and Ctrl+C left the clipboard unchanged. The
file toolbar, rendered Markdown and editor copied successfully in the
same session.
- On nix-pc, tested commit `707de5c04ca2e9d429b14f2f58264cc212805da2` in
Chromium against the real workspace file view with local fixtures, at
1280 px and 390 px in both themes. Read the clipboard after one- and
multi-line drag selections, Ctrl+C, Ctrl+A then Ctrl+C, the selection
menu and the file toolbar. Verified that blank lines, indentation and
long source lines survive copying, and that line numbers are excluded.
Also checked rendered Markdown and the editable file view. Native
Windows Electron was not run.
- Web typecheck, edited-file formatting and lint, and `git diff --check`
passed locally. GitHub Actions runs the repository checks. No
user-facing text changed.

Fixes: #645
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