fix(designer-ui): center code view find matches in viewport#9329
Merged
Conversation
The code view (CodeMirror) Ctrl+F find-next revealed matches at the nearest viewport edge, landing them at the bottom and forcing the user to scroll on every result. Configure the search extension's scrollToMatch to center matches vertically instead. Fixes #9327 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
✅ Contributors
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | No change needed |
| Commit Type | ✅ | None |
| Risk Level | ✅ | None |
| What & Why | ✅ | No change needed |
| Impact of Change | ✅ | None |
| Test Plan | ✅ | No change needed |
| Contributors | ✅ | None |
| Screenshots/Videos | Optional, but a screenshot/GIF would strengthen the PR |
The PR passes review for title/body compliance. The advised risk level is unchanged from the submitter's estimate (low).
Last updated: Tue, 30 Jun 2026 01:34:36 GMT
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the shared CodeMirror-based code editor in designer-ui so that “Find Next” navigation (Ctrl+F → Next) scrolls the active match into the vertical center of the viewport, improving usability across code view scenarios that use this shared editor.
Changes:
- Configure
@codemirror/search’sscrollToMatchto useEditorView.scrollIntoView(..., { y: 'center' }). - Add an inline comment explaining the UX motivation for the non-default scroll behavior.
Contributor
📊 Coverage CheckThe following changed files need attention:
Please add tests for the uncovered files before merging. |
Regression coverage for #9327 verifying findNext triggers a center scroll. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
takyyon
approved these changes
Jun 30, 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 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.
Commit Type
Risk Level
What & Why
Fixes #9327. In the code view (CodeMirror editor, used by both Standard and Consumption logic apps), pressing Ctrl+F and clicking Next revealed each match at the nearest viewport edge. In practice this landed matches at the very bottom of the visible window, forcing the user to scroll up a little after every result.
The fix configures the
@codemirror/searchextension'sscrollToMatchoption to center matches vertically when navigating search results:@codemirror/search(6.5.11) exposes this hook specifically for search navigation, so it only affects Find Next / Find Previous — not ordinary cursor movement or typing. This applies everywhere the sharedCodeMirrorEditor(re-exported asMonacoEditor) is used, so it covers the code view for both logic app types and the merge/diff view.Impact of Change
search()extension, plus a regression test.Test Plan
searchtest inCodeMirrorEditor.test.tsxassertsfindNextdispatches a{ y: 'center' }scroll effect (full suite 16/16 passing)pnpm run start),biome checkclean,tsc --noEmit(designer-ui) cleanContributors
@rllyy97
Screenshots/Videos
Code view after Find Next — the active match (line 43) is centered in the editor viewport rather than pinned to the bottom edge.