Skip to content

fix(markdown): return focus to editor from find bar - #23175

Merged
nwparker merged 1 commit into
mainfrom
fix/issue-22693-markdown-find-focus
Sep 26, 2026
Merged

nwparker merged 1 commit into
mainfrom
fix/issue-22693-markdown-find-focus

Conversation

@nwparker

@nwparker nwparker commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13

ELI5

Clicking back into a Markdown document while Find is open now reliably returns typing focus to the editor.

What Changed

The rich Markdown editor explicitly blurs the Find input and focuses the ProseMirror editor when the user left-clicks document content. The Find bar stays open, while subsequent typing goes into the document.

Why

Issue #22693 is reproducible in Markdown files on Windows with a physical keyboard. The existing search bar kept focus in some native mouse paths, causing keystrokes to activate Find controls instead of editing the document.

Linked Issue

Fixes #22693

Visual Proof

N/A — focus behavior is covered by the editor interaction change; no layout or visual styling changed.

Testing

  • ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/editor/useRichMarkdownSearch.test.tsx src/renderer/src/components/editor/RichMarkdownSearchBar.ime-enter.test.tsx
  • pnpm tc:web
  • pnpm exec oxlint src/renderer/src/components/editor/RichMarkdownEditorSurface.tsx

@pullfrog

pullfrog Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

This run was cancelled 🛑

The workflow was cancelled before completion. Please check the link below for details.

Pullfrog  | View workflow run | via Pullfrog | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d5e6870c-fccd-477a-aadb-ccb01925b1b3

📥 Commits

Reviewing files that changed from the base of the PR and between 8b7a2a5 and 9c09403.

📒 Files selected for processing (1)
  • src/renderer/src/components/editor/RichMarkdownEditorSurface.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

For primary-button clicks whose target is an Element inside .ProseMirror, the editor surface blurs the search input and focuses the editor. This occurs before the existing empty-editor click handling, which remains in place.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9c094

This is a small, targeted fix that restores editor focus after clicking document content while the find bar is open, without altering layout or other behavior. No merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: restoring editor focus from the Find bar in the Markdown editor.
Description check ✅ Passed The description covers the user impact, implementation, reason, linked issue, visual proof, and testing commands. It omits several template checklist sections, including AI disclosure, review notes, b…
Linked Issues check ✅ Passed The change satisfies issue #22693 for the rich Markdown editor. On a primary-button mouse-down whose target is inside .ProseMirror, the code blurs searchState.searchInputRef and calls `editor?.com…
Out of Scope Changes check ✅ Passed The reviewed change adds one focus-handling helper and invokes it from the rich Markdown editor surface. The change directly supports issue #22693. It does not alter layout, styling, search behavior, …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

@nwparker
nwparker merged commit d9d5993 into main Sep 26, 2026
33 of 34 checks passed
@nwparker
nwparker deleted the fix/issue-22693-markdown-find-focus branch September 26, 2026 09:10
Jinwoo-H pushed a commit that referenced this pull request Oct 2, 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.

[Bug]: Active Ctrl+F find widget steals focus from editor and typing activates find widget buttons

1 participant