Fix status bar cursor updates when opening files#2177
Conversation
codeedit-1729-ui-test-window-recording.mov |
3603dc8 to
ee3d3cf
Compare
ee3d3cf to
bb6aed3
Compare
|
Ready for review. Local validation:
GitHub Actions is currently awaiting maintainer approval for the fork workflow. Could a maintainer assign #1729 and approve CI when convenient? |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves the status bar’s cursor position reporting by resolving cursor positions via the editor’s range translator, and adds UI coverage to ensure the cursor position label is present and updates when interacting with editors/tabs.
Changes:
- Added UI assertions for the cursor position label and cursor movement updates.
- Updated status bar cursor label to refresh on editor/tab lifecycle events and to resolve cursor positions.
- Adjusted editor state restoration/defaulting behavior for cursor positions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| CodeEditUITests/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorUITests.swift | Adds UI test coverage for cursor position label presence/resolution and updates on editor interaction. |
| CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarCursorPositionLabel.swift | Updates label refresh triggers and resolves cursor positions via the range translator; adds fallback label formatting. |
| CodeEdit/Features/Editor/Views/CodeFileView.swift | Changes how cursor positions are applied from editor view state (ignores nil instead of forcing empty). |
| CodeEdit/Features/Editor/Models/EditorInstance.swift | Refines cursor position initialization/defaulting and adds range translator events + cursor position resolving helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for talking a look at this! Please be patient while we review and test your work. |
Description
Fixes the status bar cursor-position label when files are opened from the project navigator, including the first file after workspace launch and subsequent tabs opened in the same workspace.
The label could show unresolved cursor positions such as
Line: -1 Col: -1, or fail to refresh after opening another tab, because the status bar could read cursor state before the source editor had resolved range-based cursor positions to line/column values.This change:
README.md, opensLICENSE.md, verifies resolved line/column text, and clicks in the editor to confirm the label updatesRelated Issues
Checklist
Screenshots
Demo video attached in the PR conversation.