fix(tui): invalidate preview data after same-path file changes (#2118) - #2578
Closed
turkonthelurk wants to merge 4 commits into
Closed
turkonthelurk wants to merge 4 commits into
turkonthelurk wants to merge 4 commits into
Conversation
Reread the selected preview when a referencing task completes or the file revision changes, while keeping generation fences so a late earlier read cannot replace a newer result. Co-authored-by: turk <turkonthelurk@users.noreply.github.com>
Share one task fixture and a single preview mount so Sonar new-code duplication drops without changing invalidation coverage or semantics. Co-authored-by: turk <turkonthelurk@users.noreply.github.com>
Sonar typescript:S2871 marked the default Array.sort as a new-code reliability bug. Use the same localeCompare ordering the workbench already uses elsewhere. Co-authored-by: turk <turkonthelurk@users.noreply.github.com>
Sonar typescript:S2871 still flagged the inline localeCompare comparator as a new-code reliability bug. Use the shared UTF-16 code-unit helper that already satisfies S2871 elsewhere for stable keys. Co-authored-by: turk <turkonthelurk@users.noreply.github.com>
|
turkonthelurk
marked this pull request as ready for review
September 18, 2026 10:48
Contributor
Author
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.



Closes #2118
Draft for review only. Not to be merged by automation; a maintainer decides when and whether it lands. Opened from fork
turkonthelurk/agenc-core. Nothing pushed tomainon either repo. Based on upstreammainonly. Independent of #2116 and draft #2576. Does not addstartLineto highlight deps.Problem
The preview surface only reread a file when its path or line window changed. Same-path edits (agent completion or another process) could keep showing stale content and diagnostics. PR #2020 covered path A→B→A; it does not invalidate when the selected path stays unchanged.
Verified still present on upstream
mainat6a2a92dbefore changing anything.Change
Two independent invalidation signals on the existing generation-fenced read effect:
id:status:endTime). Completing or starting such a task triggers one fresh read; unrelated task chatter does not.fs.watch, a disk mtime/size/inode re-stat after project-tree snapshot updates, ornotifyPreviewFileChanged. First stat does not notify, so mount does not double-read.Late earlier reads still lose to a newer generation (A→B→A protection intact). Highlight deps stay
[activePath, content].Tests
Hermetic Vitest, fail-before / pass-after for the same-path cases: 7 files / 30 passed.
Coverage: same-path revision refreshes content + diagnostics; referencing task completion triggers one reread; unrelated tasks do not; late same-path reads stay fenced; A→B→A protection holds.
This does not merge.
Opened from fork
turkonthelurk/agenc-core. Companion fork PR (to close): turkonthelurk#20