Review sidebar follow-ups: live refresh and quieter word diffs - #197
Open
stippi wants to merge 4 commits into
Open
Review sidebar follow-ups: live refresh and quieter word diffs#197stippi wants to merge 4 commits into
stippi wants to merge 4 commits into
Conversation
Trim MCP client, permission tiers and UI communication sections to the essentials and point to the existing docs. Drop sections duplicated by the crate layer diagram and key entry points. Move the GPUI API primer (copied from Zed's .rules) into docs/gpui-reference.md, keeping only the deprecated-API rules in AGENTS.md.
The review panel only listed changes when it was opened or the session switched, and a prepared diff for a file still in the listing was never re-requested — so diffs went stale as soon as the agent kept editing. - git: ChangedFile gains a fingerprint (blob ids in branch mode via `diff --raw`; HEAD + mtime/size of the working-tree file otherwise) - ui_gpui: Gpui::files_changed_generation is bumped after every finished tool and at the end of a turn; the ReviewView re-lists (debounced) and re-requests only diffs whose listing entry changed, keeping the old hunks on screen until the replacement arrives
Replace the tool-end trigger with git::ChangeWatcher: a recursive notify watch on each listed repo (plus the private and common git dirs of linked worktrees), debounced, with Zed's .git filter so object, hook, reflog, lock and temp-file churn never triggers a rescan. The ReviewView owns the watcher while it has a listing; closing the panel or switching sessions detaches it. Window activation reloads as a safety net for what a watcher can miss.
Two changes to the intra-line word diff: - Drop a line's emphasis when it would cover more than half of the line's non-whitespace bytes. Rewritten prose paragraphs share enough common words to pass similar's ratio cutoff, yet the result lit up every other word and stray spaces; a mostly rewritten line now shows as a plain change. A small edit inside a long paragraph keeps its emphasis — length is not the criterion. - Merge emphasis ranges separated only by whitespace, so two changed words with an unchanged space between them highlight as one. The line cap follows Zed (8 per side).
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.
Summary
Follow-ups to #191 (review sidebar).
git::ChangedFilecarries a fingerprint (blob ids viadiff --rawin branch mode; HEAD + mtime/size of the working-tree file otherwise). The view re-requests only diffs whose listing entry changed, keeping the old hunks on screen until the replacement arrives.git::ChangeWatcher: a recursivenotifywatch per listed repo (plus the private/common git dirs of linked worktrees), debounced, with Zed's.gitevent filter so object/hook/reflog/lock/temp churn never triggers a rescan. TheReviewViewowns it while it has a listing; closing the panel or switching sessions detaches it. Window activation reloads as a safety net.Test plan
cargo test -p git -p ui_gpui(new tests: fingerprint tracking in both modes, raw-diff parser,.gitfilter rules, git-dir detection incl. linked worktrees, watcher integration test, word-diff heuristics)cargo clippy --all-targets --all-features -- -D warnings,cargo fmt --check