Page MenuHomePhabricator

Publication modal should publish on Ctrl+Enter / Cmd+Enter
Open, LowPublic

Description

  • create an object (besides a function)
  • click on Publish
  • the modal titled "Publish your changes" appears, and the focus is on the diff comment
  • enter a comment or not
  • press return
  • nothing happens

I first have to tab to the Publish button, or click on the Publish button.

Pressing return should trigger the Publish action.

Event Timeline

Should this be on Ctrl+Enter / Apple+Enter instead?

DVrandecic triaged this task as Low priority.
DVrandecic moved this task from Needs Product/Design to Backlog on the Abstract Wikipedia team board.
AAlhazwani-WMF removed a project: Design.
AAlhazwani-WMF subscribed.

Should this be on Ctrl+Enter / Apple+Enter instead?

agreed! as discussed during triage let's build on top of what we have in VE.

given that we use the codex field component in the publish dialog, we can use the status prop to display a warning message. why warning? because we'll "block" the editors' action (pressing return/enter), so we'll then explicit what to do to proceed.

image.png (1×3 px, 357 KB)

for apple machines the copy could be "You can press ⌘↵ to publish your changes."
for non-apple machines, the copy could be "You can press Ctrl↵ to publish your changes"

  • ⌘ is U+2318
  • ↵ is U+21B5

we could style the hotkey/shortcut with <kbd>. the styles that i used are the following codex tokens:

  • font-size @font-size-x-small
  • font-color @color-base
  • background-color @background-color-interactive-subtle
  • border @border-width-base + @border-style-base + @border-color-muted
  • border-radius @border-radius-base
  • horizontal padding @spacing-12
  • vertical padding 1px, or set the line-height to @line-height-xx-small so that it shares the same line-height of the inline message text
  • box-shadow @box-shadow-drop-small

image.png (154×436 px, 13 KB)

a figma file is also available at this URL https://www.figma.com/file/IzHf9jo46suf7RvSySVMzK/Untitled?type=design&node-id=12%3A658&mode=design&t=h79gj0kkUu5mEkXm-1

Jdforrester-WMF renamed this task from Publication modal should publish on enter to Publication modal should publish on Ctrl+Enter / Cmd+Enter.Mar 25 2024, 12:21 PM