Skip to content

Register rich text format keyboard shortcuts#83

Open
kraftbj wants to merge 1 commit intotrunkfrom
claude/cool-hofstadter
Open

Register rich text format keyboard shortcuts#83
kraftbj wants to merge 1 commit intotrunkfrom
claude/cool-hofstadter

Conversation

@kraftbj
Copy link
Collaborator

@kraftbj kraftbj commented Mar 1, 2026

Summary

Import @wordpress/format-library to register standard rich text format types and their keyboard shortcuts. Press This uses BlockEditorProvider directly rather than the full EditorProvider, which means format-library isn't initialized automatically. Without it, shortcuts like Ctrl+K (link), Ctrl+B (bold), and Ctrl+I (italic) don't work.

  • Add @wordpress/format-library as a dependency
  • Import it in the entry point so it registers format types on load
  • Add docs/keyboard-shortcuts.md documenting which Gutenberg shortcuts are available in Press This and which aren't

See #81

Test plan

  • Open Press This and type some text in a paragraph block
  • Ctrl+B / Cmd+B should toggle bold
  • Ctrl+I / Cmd+I should toggle italic
  • Ctrl+K / Cmd+K should open the link popover
  • Ctrl+U / Cmd+U should toggle underline
  • Ctrl+Alt+D / Ctrl+Option+D should toggle strikethrough
  • Ctrl+Alt+X / Ctrl+Option+X should toggle inline code
  • Verify the block toolbar shows formatting buttons (bold, italic, link)

Import @wordpress/format-library to register standard rich text formats
(bold, italic, link, code, strikethrough, etc.) and their keyboard
shortcuts. Press This uses BlockEditorProvider directly, which doesn't
include these by default.

Also adds docs/keyboard-shortcuts.md documenting which shortcuts are
available and which are not yet supported.

See #81
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR restores standard Gutenberg rich-text formatting shortcuts in Press This by ensuring core format types are registered when the app boots (since Press This uses BlockEditorProvider rather than EditorProvider).

Changes:

  • Add @wordpress/format-library as an application dependency.
  • Import @wordpress/format-library in the JS entry point so format types/shortcuts register on load.
  • Add documentation describing which keyboard shortcuts are (and aren’t) available in Press This.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/index.js Imports @wordpress/format-library at startup to register core rich-text formats and shortcuts.
package.json Adds @wordpress/format-library to dependencies.
package-lock.json Locks the newly added dependency and resulting transitive dependency graph updates.
docs/keyboard-shortcuts.md Documents available/unavailable shortcuts in Press This vs the full editor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 48 to 54
"@wordpress/edit-post": "^8.37.0",
"@wordpress/editor": "^14.37.0",
"@wordpress/element": "^6.37.0",
"@wordpress/format-library": "^5.37.0",
"@wordpress/i18n": "^6.10.0",
"@wordpress/icons": "^11.4.0",
"@wordpress/rich-text": "^7.37.0"
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

Adding @wordpress/format-library updates the lockfile to include @wordpress/ui which declares engines of Node >=20.10.0 and npm >=10.2.3 (see package-lock). To avoid confusing install-time engine warnings (or failures when engine-strict is enabled), consider declaring an explicit engines requirement in this repo’s package.json (and aligning CI/tooling accordingly).

Copilot uses AI. Check for mistakes.
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.

2 participants