Skip to content

Dismiss the formatting menu when the text selection moves - #256

Merged
bholmesdev merged 2 commits into
mainfrom
agent/issue-255-31447398536-1
Aug 11, 2026
Merged

Dismiss the formatting menu when the text selection moves#256
bholmesdev merged 2 commits into
mainfrom
agent/issue-255-31447398536-1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Description

Dismiss the formatting menu when clicking elsewhere in a note. Outside clicks clear the frozen highlight without restoring the old selection, allowing the caret to move to the clicked location. Escape remains available globally while the menu is open and restores focus to the editor.

Closes #255

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update

Testing

  • Existing tests pass
  • Added new tests for changes
  • Tested manually (describe below)

Manual Testing Details:

  • pnpm build:desktop
  • pnpm --filter @hubble.md/editor build && pnpm --filter @hubble.md/ui build
  • pnpm exec biome check packages/editor/src/FakeSelectionExtension.ts packages/ui/src/editor/FormatCommandMenu.tsx CHANGELOG.md
  • git diff --check
  • React Compiler audits: UI 76 compiled / 0 failed; desktop 41 compiled / 0 failed. The aggregate command later failed in unrelated web packages due to missing @hubble.md/convex-client and @hubble.md/sync build output.
  • Electron flow verification attempted with HUBBLE_DESKTOP_ENABLE_CDP=1 pnpm dev:desktop, but Electron could not launch because the CI SUID sandbox helper is not configured.

Checklist

  • I discussed this change in a GitHub issue before submitting this PR
  • I have run the linter, formatter, and tests to ensure my code is ready for review

Implemented by a Warp Factory agent.

Co-Authored-By: Warp Factory Agent <oz-agent@warp.dev>
Co-Authored-By: Warp Factory Agent <oz-agent@warp.dev>
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hubble-md-web Ready Ready Preview Aug 11, 2026 12:59am

@bholmesdev
bholmesdev marked this pull request as ready for review August 11, 2026 11:54

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

Fixes #255 stuck format menu: outside pointerdown hides menu + clearFrozenSelection (no restore), Escape stays global via capture and still restoreSelection + focus. FakeSelectionExtension gets a clear-without-restore command. Approach matches acceptance criteria.

Concerns

  • No automated coverage for the two dismiss paths. This bug is pure interaction state; SelectionFormattingToolbar.test.tsx already shows the happy-dom pattern for Escape/selection dismiss. Without tests this can regress silently.
  • Manual/Electron verification was blocked in CI; unit tests are the practical safety net here.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes


Reviewed by a Warp Factory agent.

Comment thread packages/ui/src/editor/FormatCommandMenu.tsx
@bholmesdev
bholmesdev merged commit c4235c9 into main Aug 11, 2026
7 checks passed
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.

Dismiss the formatting menu when the text selection moves

2 participants