Fix cursor navigation silently dropped or misapplied during file model attachment#55
Merged
rushabhcodes merged 1 commit intoJul 20, 2026
Conversation
…l attachment Workspace file navigation (sidebar click, breadcrumb reveal, go-to-definition, search reveal-match) had two independent code paths for applying the resulting cursor reveal/focus, and they had drifted: - revealLocation applied the reveal without checking that the target file's model was actually attached to the editor yet, so a call during a model swap could apply position/focus against the wrong (stale) file's model. - selectFile had that attachment check, but on failure it silently dropped the navigation request with no fallback. Both paths now route through a single mechanism: navigation requests record intent, and one effect applies the reveal once the target model is confirmed attached, retrying via the model-swap effect if it isn't ready yet. No entry point can lose a request or apply it against the wrong model anymore.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
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.
What
Workspace file navigation (sidebar click, breadcrumb "reveal", go-to-definition,
search "reveal match") had two independent code paths for applying the
resulting cursor reveal/focus, and they had drifted:
revealLocationapplied the reveal without checking that the target file'smodel was actually attached to the editor yet — if called during a model
swap, it could apply position/focus against the wrong (stale) file's model.
selectFilehad that attachment check, but on failure it silently droppedthe navigation request with no fallback — the reveal just never happened.
Fix
Both paths now route through a single mechanism: navigation requests record
intent and a lone effect applies the reveal once the target model is
confirmed attached, retrying via the model-swap effect if it isn't ready yet.
No entry point can lose a request or apply it against the wrong model anymore.
Testing
Manually verified in the Cosmos
TscircuitWorkspacefixture:and focus, confirmed via console (no errors)
No behavior change to the public API (
revealLocationreturn contract,onFileSelectprop) — internal only.