Repository navigation
feat: Git Changes widget for a space's working tree - #160
Merged
Merged
Conversation
A space's daemons stopped after an idle hour, and only a run's mount started them again, so a host project's diff was unavailable until the next run. Reading a local space wakes nothing, so a daemon.call there now starts its daemons and waits for the start; the same idle timer stops them again. A sandbox space still never starts from a call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A desktop widget showing the working-tree changes of the space a thread is placed in, from the space's git daemon: - app server: changes.status (the git daemon's mirrored status), changes.diff (patches over daemon.call on the space's machine) and changes.space (folder, kind, environment and the threads sharing the space); the thread line carries its spaceId - widget: every changed file stacked and folded by default, per-file and fold-all folding with a short slide, inline or split diffs rendered with @pierre/diffs in a worker pool, a file list and arrow navigation, and a Space line naming the folder, branch, environment (Local, Worktree, <Driver> Sandbox), freshness and the threads sharing the space - stays smooth with hundreds of files: off-screen diffs are skipped, rows are memoized, data, fold state and scroll survive switching tabs, and a skeleton fades in only for a slow cold open - opened from a thread's More menu as Git Changes - Skills in project settings: the placeholder fades in only for a slow load and the list is kept between visits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… git daemon From a 1000-file Daytona benchmark: - The cache kept nothing once patches passed 1 MB, so a let-go sandbox's diff failed. Each file is now sized from the status line counts and read only if it fits; a file that does not gets an empty patch with its counts (later files keep theirs), untracked files over 5 MB are skipped, a file asked for alone is read by its real size, and an over-cap result says truncated. Live reads cap at 10 MB the same way. - A diff request marks the status for refresh: a local space re-reads, a sandbox not held by a run stays dirty for its next mount (never woken). - A repository with no commits published head: undefined, which the event feed cannot encode; head and branch are left out instead. - Literal pathspecs, and the over-200 untracked count reads NUL-separated names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A slim warning row under the Space line when diffs are unavailable (with the reason and Retry), sliding in and out; the file list stays. - "The Sandbox Is Stopped" only when it is; otherwise diffs appear during the next run. A failed diff is retried on open, when the frame is shown and when a run in the space starts or ends. - A file left out of the bulk diff is read alone when unfolded, shown only if its counts match. - Diffs over 200 lines are virtualized; past 500k characters word diff and highlighting are off. - A/M/D letters beside the status-coloured names. - changes.space re-reads only for its own space, sessions and threads, debounced; a hidden frame does not fetch the diff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A desktop widget that shows the working-tree changes of the space a thread is placed in, built on the space's git daemon. Opened from a thread's More menu → Git Changes, beside the thread.
What
App server
changes.status { machineId, spaceId }: the git daemon's lastplugin.git.status, from themachine_space_statemirror (re-read onsync/statenotices). Never wakes a sandbox.changes.diff { machineId, spaceId, files? }: patches overdaemon.callon the space's machine; errorsunavailable | detached | failed.changes.space { machineId, spaceId }: folder, kind, environment (from the machine's stored sandbox rows) and the threads placed in the space.spaceId.Widget (
apps/web/src/widgets/changes/)@pierre/diffs1.6.2, worker pool); ←/→ and a file list; untracked folders listed as their files.<Driver>Sandbox) · Updated N Ago, and "Shared by N Threads" with the threads sharing the working tree (the changes are the space's, not one thread's).Harness: a local space's daemons now start on a
daemon.call(and stop on the same idle timer), so a host project's diff no longer disappears after an idle hour. Sandbox spaces still never start from a call.Also: the Skills section's placeholder fades in only for a slow load, and the list is kept between visits.
Verified
apps/server/test/changes.test.ts(real CodeWork server, pinned 69th clone): status, full and single-file diff,spaceIdon the line, the Space read (one and two sessions in a folder, unknown space), a local space no run mounted serving its diff, revert → no changes. Artifact__artifacts__/changes.json.vp check,vp run typecheck,vp run knip:check.Large diffs (Daytona benchmark, 69th, 100 → 1000 tracked files)
Status and live diffs held up to 1000 files (status 77 KB, mirrored in 1–3 ms; diff 0.5–0.9 s warm, 1.46 MB). Fixed from the findings:
truncated); a left-out file is read alone when unfolded.head: undefined, which broke the event feed; fixed at the source.Not covered
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.