Hosted ongabo.esvia theHypermedia Protocol

[PR] CMD+A opens the Formatting Toolbar instead of Selecting all the contenthttps://github.com/seed-hypermedia/seed/issues/643

Findings

Cmd+A breaks when the document ends with a non-editable card-style block

Problem

When pressing CMD+A, the Formatting Toolbar opens instead of selecting all the content in the document.

Expected behavior

CMD+A should select all content in the current editable context, following the standard system behavior.

Actual behavior

The Formatting Toolbar is triggered, and the content is not selected.

Impact

This breaks a very common keyboard shortcut and makes bulk editing actions harder, such as copying, deleting, or reformatting all content.

Plan1

Using grill-me. I traced Cmd+A to:

    frontend/packages/editor/src/document-editor.tsx (Mod-a)

    frontend/packages/editor/src/comment-editor.tsx (Mod-a)

    frontend/packages/editor/src/blocknote/core/extensions/FormattingToolbar/FormattingToolbarPlugin.ts

    frontend/apps/desktop/src/app-menu.ts (Edit > Select All)

One question before I lock the plan:

Scope?
Recommended: fix this in the shared editor so Cmd+A behaves correctly in both the main document editor and comment editor, then verify it in desktop and web.

Pick one:

    Shared editor — document + comment, verify desktop/web

    Desktop only

    Document editor only

Recap

I inspected the current shortcut path and found the likely touchpoints: shared editor Mod-a handlers, formatting-toolbar visibility logic, and the desktop app menu’s Select All item.

    I’m blocked on one scope decision before finalizing the implementation plan.

    Recommended scope: shared editor, then verify behavior in both desktop and web.

    Reply with 12, or 3.

shared editor

GPT 5.4· Plan· High



Locked plan:

    Fix mechanism

      In frontend/packages/editor/src/utils.ts, add a shared helper that performs true whole-document selection via ProseMirror AllSelection.

      Use that helper in:

        frontend/packages/editor/src/document-editor.tsx

        frontend/packages/editor/src/comment-editor.tsx

      Replace current Mod-a handlers that call editor.commands.selectAll().

    Why this change

      Current behavior likely produces a text-range selection that misses a trailing non-editable/card-like block.

      AllSelection should include the full editable document, including trailing Embed Card / Query Card blocks.

    Selection visuals

      Update frontend/packages/editor/src/block-selection-wrapper.tsx so wrapped non-editable blocks render as selected under AllSelection too.

      This is needed for your expected UX: trailing card is visibly selected and deletable after Cmd+A.

    Regression coverage

      Extend frontend/packages/editor/e2e/tests/selection-toolbar.e2e.ts with:

        paragraph + trailing Embed Card

        paragraph + trailing Query Card

      Assert:

        Cmd+A creates full-doc selection (prefer checking PM selection is AllSelection)

        Delete/Backspace removes the trailing card block too

    Verification

      Re-run editor package e2e first.

      Then smoke-test:

        web repro like /projects

        desktop draft editor

      Only if desktop still differs, extend frontend/apps/desktop/tests/keyboard-shortcuts.e2e.ts with a card-tail case.

    Validation commands

      pnpm typecheck

      pnpm test

      pnpm audit

      pnpm format:write

      npx @redwoodjs/agent-ci run -w .github/workflows/test-frontend-parallel.yml -p --github-token

    Recap

    Plan is to fix Cmd+A at the shared-editor level by switching from the current text-oriented select-all behavior to a true ProseMirror AllSelection, then teach non-editable wrapped blocks to visually participate in that selection.

      Target files: utils.ts, document-editor.tsx, comment-editor.tsx, block-selection-wrapper.tsx.

      Main regressions to add: trailing Embed Card and trailing Query Card.

      Goal behavior: after Cmd+A, the last card block is included in selection, visibly selected, and deletable.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime