fix(ui): synchronize watch-run UI state on file removal - #10941
Merged
Merged
Conversation
The UI explorer mirror was append-only, so watch re-runs left ghost test nodes when tests were removed or their type changed, and deleting or renaming a file left a ghost file node because onTestRemoved was never forwarded to the client. - reconcile each collected file's mirror subtree (drop-and-recreate on type change, prune removed children) via onCollected - prune stale position-based idMap entries on re-collection - forward onTestRemoved over the websocket and remove the file node Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
The onTestRemoved payload is the server's slashed filepath, which is byte-identical to the file node's filepath and the state.filesMap key, so normalizing before comparison was redundant and inconsistent with state.removeFile's direct lookup. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
File deletion fires onTestRemoved without scheduling a rerun, so unlike test removal there is no endRun/collect to refresh explorerTree.summary. removeFileByPath updated the tree and rows but left the counts stale, so tests-entry kept showing the deleted file's tests. Recompute the summary after removal so the dashboard totals reflect the deletion. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
7 tasks
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
Co-authored-by: OpenCode <noreply@opencode.ai>
hi-ogawa
commented
Aug 17, 2026
| } | ||
|
|
||
| /** Stage selected files as local placeholders for logs emitted during collection. */ | ||
| clearFiles([project, path]: SerializedTestSpecification): void { |
Collaborator
Author
There was a problem hiding this comment.
this is drive-by refactoring.
hi-ogawa
marked this pull request as ready for review
August 17, 2026 07:42
sheremet-va
approved these changes
Aug 17, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Previously UI state management had no stale task management and the stale data in
StateManagerandExplorerTreeboth affected stale UI display.This PR wires around stale entities cleanup through
onCollectedandonTestRemovedevents to fix the issue. Also scattered some explanatory comments in existing code where I had a trouble with following the flow.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.