fix(web-ui): stabilize initial code editor range navigation#1279
Merged
Conversation
wsp1911
force-pushed
the
main
branch
2 times, most recently
from
June 22, 2026 10:35
bf7eeac to
ad5b9c0
Compare
- track pending range navigation requests in CodeEditor - retry initial reveal on layout and resize signals until the target range is visible - clear pending navigation state on file switches and editor unmount - keep range jumping scoped to active tabs to avoid background side effects
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
Stabilize file-link line range navigation in the Web UI code editor.
When a flow chat file link opens a file in a new editor tab, the target line range could already be selected while the viewport still stayed near the top of the file on the first click. This change moves the fix into
CodeEditorso navigation is only considered complete after the editor viewport is ready and the target range is actually visible.Fixes #
Type and Areas
Type:
regression fix / bug fix / UI/UX
Areas:
web UI
Motivation / Impact
This fixes a timing issue in initial editor navigation for file links with line ranges.
Before this change, the first click could open the file and apply the selection but fail to keep the requested range in view until the user clicked the same link again. After this change,
CodeEditorkeeps a pending navigation request, waits for the editor to become active and layout-stable, and only completes once the requested range is visible. The fix is scoped to the editor navigation path and avoids adding ad hoc delays in upstream callers.Verification
pnpm run type-check:websessionStoragePortable.ts:311-318when opening a new editor tab from the right panel collapsed stateReviewer Notes
The fix is intentionally localized to
src/web-ui/src/tools/editor/components/CodeEditor.tsx.Instead of relying on a fixed timeout from flow chat or tab-opening code, the editor now:
This keeps the behavior durable for other future range-based editor entry points as well.
Checklist