Skip to content

feat(editor): seed Find from selected text - #9982

Merged
AmethystLiang merged 1 commit into
mainfrom
jinjing/sta-2340-feature-pre-fill-find-widget-with-selected-text-when
Jul 22, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
jinjing/sta-2340-feature-pre-fill-find-widget-with-selected-text-when

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

  • prefill Monaco Find from an explicit non-empty, single-line editor selection
  • preserve the previous Find query for empty and multiline selections
  • share one typed Find configuration across the file editor and both diff editor implementations

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/editor/monaco-find-options.test.ts src/renderer/src/components/editor/editor-shortcuts.test.ts (18 tests)
  • pnpm run typecheck:web
  • targeted oxlint and oxfmt --check on all changed files
  • macOS Electron validation on the exact branch instance: source single-line seeding, source selection retention, empty-caret query retention, multiline query retention, and modified diff-pane single-line seeding all passed with zero relevant console errors

Live validation did not repeat empty/multiline cases in the diff pane, exercise the collapsed original diff pane, or cover Linux/Windows/SSH. Those paths share the same Monaco configuration; shortcut matching is covered for macOS, Linux, and Windows by the focused suite.

Issue

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1448d653-43b0-4d32-9a7e-8c96b884dd45

📥 Commits

Reviewing files that changed from the base of the PR and between 0121f57 and 57d5d86.

📒 Files selected for processing (5)
  • src/renderer/src/components/editor/DiffSectionBody.tsx
  • src/renderer/src/components/editor/DiffViewer.tsx
  • src/renderer/src/components/editor/MonacoEditor.tsx
  • src/renderer/src/components/editor/monaco-find-options.test.ts
  • src/renderer/src/components/editor/monaco-find-options.ts

📝 Walkthrough

Walkthrough

Introduces a typed monacoFindOptions constant with shared Monaco find behavior and adds a Vitest assertion for its values. MonacoEditor, DiffViewer, and DiffSectionBody now pass this shared configuration to their respective Monaco editor components instead of defining inline find options.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The core sections are present, but the template-required Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes sections are missing. Add the missing template sections and fill them out, especially screenshots/no-visual-change, checklist results, AI review, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: seeding Monaco Find from selected text in the editor.
Linked Issues check ✅ Passed The PR matches the linked feature: it pre-fills Find from single-line selections, preserves prior queries otherwise, and centralizes the shared Monaco config.
Out of Scope Changes check ✅ Passed The diff stays focused on Monaco Find configuration and a dedicated test file, with no obvious unrelated feature work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang merged commit 034aeb1 into main Jul 22, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Pre-fill find widget with selected text when pressing Cmd+F

1 participant