Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Clicking a diagnostic selected its entity and left the reader to find the code and the line. It now opens the code section over the properties panel, with the caret where the diagnostic starts and that line in view. The shared code editor answers a focus request for its path, so no section handles one itself. A section that fills its panel leaves focus in its content when the editor already took it.
79977a8 to
45a181a
Compare
PR SummaryLow Risk Overview Code navigation gains an optional Section maximize no longer steals focus from content already focused below the header, so navigation into an editor during fill-panel animation keeps the caret in the code editor. Reviewed by Cursor Bugbot for commit 45a181a. Bugbot is set up for automated code reviews on this repo. Configure here. |
PR overviewNo security issues were found in this pull request. Reviews
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the diagnostic-to-code navigation change.
No open issues 🎉
What changed in this PR
This PR connects Petrinaut diagnostics directly to their code, opening the relevant Properties Panel section with the editor focused at the problem.
Changes:
- Adds position-aware code navigation, with entity-selection fallback when code cannot open.
- Centralizes editor focus handling and preserves content focus during maximization.
- Adds regression tests, documentation updates, and a patch changeset.
| File | Description |
|---|---|
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/PropertiesPanel/place-properties/subviews/place-visualizer/subview.tsx |
Removes duplicate focus handling. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/BottomPanel/subviews/diagnostics.tsx |
Opens code at the diagnostic position. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/BottomPanel/subviews/diagnostics.test.tsx |
Tests navigation and selection fallback. |
libs/@hashintel/petrinaut/src/ui/views/Editor/editor-view/code-navigation-provider.tsx |
Issues position-aware focus requests and returns success. |
libs/@hashintel/petrinaut/src/ui/views/Editor/editor-view/code-navigation-provider.test.tsx |
Tests repeated requests and navigation results. |
libs/@hashintel/petrinaut/src/ui/sub-view/vertical-sub-views-container/use-sub-view-maximization.ts |
Preserves focus within section content. |
libs/@hashintel/petrinaut/src/ui/sub-view/vertical-sub-views-container.test.tsx |
Tests focus preservation during maximization. |
libs/@hashintel/petrinaut/src/ui/sub-view/sub-views.mdx |
Documents content-focus preservation. |
libs/@hashintel/petrinaut/src/ui/monaco/monaco.mdx |
Documents position navigation and editor measurement. |
libs/@hashintel/petrinaut/src/ui/monaco/code-navigation-context.ts |
Defines positions and navigation success results. |
libs/@hashintel/petrinaut/src/ui/monaco/code-editor/focus-on-request.tsx |
Measures, positions, reveals, and focuses the editor. |
libs/@hashintel/petrinaut/src/ui/monaco/code-editor/focus-on-request.test.tsx |
Tests focus-request handling and operation order. |
libs/@hashintel/petrinaut/src/ui/monaco/code-editor.tsx |
Integrates shared focus handling. |
libs/@hashintel/petrinaut/docs/petri-net-extensions.md |
Updates diagnostic-click documentation. |
libs/@hashintel/petrinaut/docs/code-editor.md |
Describes opening code from diagnostics. |
.changeset/diagnostics-open-code-at-line.md |
Records the Petrinaut patch release change. |
Review effort: Balanced
Summary
Before this PR, clicking a diagnostic in the Diagnostics tab selected the entity that owns the code. The reader then had to find the code section in the Properties Panel and scroll to the line.
A click now opens the code itself. Its section fills the Properties Panel, the editor takes focus, and the cursor is where the problem starts, with that line in view.
10708.mp4
Links
Changes
openofuseCodeNavigationtakes apositionand returns whether it openedCodeEditoranswers the focus request for itspathTest coverage
diagnostics.test.tsx:focus-on-request.test.tsx:code-navigation-provider.test.tsx:vertical-sub-views-container.test.tsx:How to test
LaunchSatelliteconst spare = missing;as last line of Transition Results codeCrashdistancewithmissingin last line of Firing Time codeSpaceLaunchSatelliteCrash