Skip to content

fix(web): keep a staged file hidden until a preview generated after the stage lands - #102

Merged
MTVaught merged 1 commit into
mainfrom
t3code/diff-stage-hide-race
Sep 20, 2026
Merged

MTVaught merged 1 commit into
mainfrom
t3code/diff-stage-hide-race

Conversation

@MTVaught

Copy link
Copy Markdown
Owner

Problem

Staging files in quick succession in the Unstaged view let an already-staged file flash back. The optimistic hide from #101 was tied to the preview on screen: staging A started a refresh, staging B during that refresh joined the same hidden set, and when A's refresh landed the set was discarded, so B showed until its own refresh arrived.

Fix

Both sides now stamp the server clock, so no client clock is involved:

  • vcs.stagePaths returns the time the index update completed.
  • The diff preview stamps generatedAt before reading the repository instead of after.
  • A hidden file stays hidden until a preview generated after its stage completed lands. A refresh that started before the stage finished can no longer resurrect it. Entries are scoped to the thread and filter, and a failed command still unhides the file with the error toast.

Follow-up to #100 and #101.

Built with Claude Fable 5.1 via Claude Code in T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 20, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 13.5 KiB −114 B (−0.8%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB +2 B (+0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.5 KiB 6.4 KiB −116 B (−1.7%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 57.0 KiB 56.2 KiB −866 B (−1.5%) 66.4 KiB ✅
Codex Live turn messages 9 8 −1 (−11.1%) 21 ✅
Claude Total thread wire 13.6 KiB 13.5 KiB −122 B (−0.9%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB +5 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.6 KiB 6.4 KiB −127 B (−1.9%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.9 KiB 57.0 KiB −928 B (−1.6%) 66.4 KiB ✅
Claude Live turn messages 10 8 −2 (−20.0%) 21 ✅

Baseline: 3332115 · PR result: 1b543c3 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@MTVaught
MTVaught merged commit 47f898b into main Sep 20, 2026
20 checks passed
@MTVaught
MTVaught deleted the t3code/diff-stage-hide-race branch September 20, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant