Galaxy Shell / docs
Docs / Interface e recursos

Contextual controls and shortcuts

openspec/specs/contextual-actions/spec.md · Editar no GitHub ↗

Esta página ainda não tem tradução em português. O conteúdo abaixo está em inglês.

Nesta página

Contextual controls and shortcuts

Purpose

Every usable desktop shortcut needs a visible, operable counterpart in its current context, with a clear label and its key mapping. This spec indexes the rules of the protected actions menu and of the shortcut inventory.

Requirements

Requirement: Every shortcut has a visible counterpart

Every currently usable desktop shortcut SHALL have a visible, operable counterpart in the relevant context. The counterpart is an icon control, with text only where no icon reads clearly, and its tooltip and accessible name MUST give the action and its key mapping. New system features MUST follow this rule. Full text: section Introduction.

Scenario: Every shortcut has a visible counterpart

  • WHEN a new desktop shortcut becomes usable
  • THEN an icon control exists in that context whose tooltip and accessible name give the action and its key mapping

Scenario: The Actions menu shows icons

  • WHEN the user opens a group of the Actions menu
  • THEN each action is an icon button with no visible label, and pointing at it or focusing it shows the action and its key

Requirement: Grid and Canvas actions stay apart

Grid actions SHALL stay out of Canvas and Canvas actions out of Grid. Full text: section Introduction.

Scenario: Grid and Canvas actions stay apart

  • WHEN the context is Canvas
  • THEN Grid-only actions are not shown

Requirement: Menu is bound to its context and rechecked

The protected panel SHALL be bound to the output, workspace, compositor instance and application that existed when it opened, and availability MUST be rechecked on each operation. A closed window, changed workspace, lock or new compositor refuses an old action. Full text: section Plan and acceptance.

Scenario: Menu is bound to its context and rechecked

  • WHEN the workspace changes after the menu opened
  • THEN the old action is refused

Requirement: Typed commands and no outside access

Native operations SHALL use typed commands, never injected keys. Generated HTML, plugins, model tools and scheduled turns MUST gain no access. Full text: section Plan and acceptance.

Scenario: Typed commands and no outside access

  • WHEN a model tool tries to run a menu action
  • THEN it gains no access

Requirement: Camera view and focus are kept

Camera actions SHALL be kept in the chosen view, and application focus SHALL be kept while a protected menu takes the keyboard. Full text: section Plan and acceptance.

Scenario: Camera view and focus are kept

  • WHEN a protected menu has keyboard focus
  • THEN the application keeps its focus

Requirement: Alt+scroll actions are Canvas only

The Alt+scroll actions SHALL be hidden on a Grid workspace: the core filters them on a layout that is not Canvas or a Focus over a Canvas base, and the compositor lists them only on Canvas. Full text: section Shortcut coverage.

Scenario: Alt+scroll actions are Canvas only

  • WHEN the workspace is a Grid
  • THEN the Alt+scroll actions are not listed

Requirement: Super+Shift+scroll steps the workspace

Super+Shift+scroll SHALL take the input request of Super+Left and Super+Right, so the core applies their refusals. The compositor keeps at most one step for each 250 ms and no client gets its scroll amounts. Full text: section Shortcut coverage.

Scenario: Super+Shift+scroll steps the workspace

  • WHEN a step arrives during a workspace switch
  • THEN the core drops it

Requirement: Hot corners reuse the key code

A hot corner SHALL call the code of the key in the compositor and MUST NOT use user_action or a menu serial; each of its actions keeps its entry in the Actions menu and its key. Full text: section Hot corners.

Scenario: Hot corners reuse the key code

  • WHEN a corner runs an action
  • THEN it runs the code of the key, with no menu serial

Requirement: Fixed keys cannot be shadowed

The fixed keys SHALL stay in the compositor and no table can shadow them: the VT switch, the lock (Super+L), quit (Super+Esc), the overlay safe mode (Super+Ctrl+Shift+R), the switcher (Alt+Tab, Super+Tab), the screenshot keys, every Escape behavior and the Super tap. Full text: section Keybinding table.

Scenario: Fixed keys cannot be shadowed

  • WHEN a key table binds Super+L to another action
  • THEN the fixed lock key is not shadowed

Requirement: Labels read the table when it becomes editable

The labels of the bars, the overview, the first-run card and the settings MUST read the key table in the same change that adds a way to edit it. Full text: section Keybinding table.

Scenario: Labels read the table when it becomes editable

  • WHEN a way to edit the key table is added
  • THEN the labels read the table in that same change

Requirement: Protected execution routes

POST /api/desktop-actions/open SHALL take only the connector name, and POST /api/desktop-actions only the menu serial and a listed action. The latter sends user_action, a closed enum, which the compositor rechecks before execution. The ordinary desktop command path refuses both commands. Full text: section Protected execution.

Scenario: Protected execution routes

  • WHEN the ordinary desktop command path receives user_action
  • THEN it refuses it

Requirement: Actions inject nothing

No action SHALL inject keys or accept an executable, coordinates, JavaScript or an arbitrary command. Full text: section Protected execution.

Scenario: Actions inject nothing

  • WHEN an action is executed
  • THEN no key is injected and no executable or command is accepted

Requirement: Screenshot actions return no pixels

Screenshot actions SHALL share the existing input request path and never return pixels to the action route. Full text: section Protected execution.

Scenario: Screenshot actions return no pixels

  • WHEN a screenshot action runs
  • THEN the action route returns no pixels

Requirement: Ending the session needs confirmation

Ending the session MUST require a second explicit mouse confirmation, whose end button arms 1.5 s after it shows, with the focus on Cancelar. Full text: section Protected execution.

Scenario: Ending the session needs confirmation

  • WHEN the user chooses to end the session
  • THEN a second explicit mouse confirmation is required

Scenario: A press before the arming ends nothing

  • WHEN "Encerrar sessão" of the confirmation is pressed less than 1.5 s after it shows
  • THEN the session does not end and the focus stays on Cancelar

Requirement: One protected menu context

There SHALL be one protected menu context at a time, and opening it on another monitor invalidates the earlier menu serial. The running compositor MUST advertise contextActions before a bar offers the entry point. Full text: section Protected execution.

Scenario: One protected menu context

  • WHEN the menu opens on another monitor
  • THEN the earlier menu serial is invalid

Requirement: The tile assist names its keys

The tile assist, which takes the keyboard for the arrows, Enter and Escape while it shows on a Canvas workspace, SHALL show those keys in its panel with a clear label of each action (choose, place, close), per the rule that every usable desktop shortcut has a visible counterpart in its context. The assist exists only in Canvas, so Grid shows no assist keys.

Scenario: Keys visible in the assist

  • WHEN the tile assist shows
  • THEN the panel names the arrows to choose, Enter to place the window and Escape to close

Scenario: Grid shows no assist keys

  • WHEN the workspace layout is Grid
  • THEN no assist and no assist key label appears

Requirement: Gestures show as icons

The pointer gestures that the Actions menu explains for its context (moving the camera, zoom, switching, moving and resizing windows, switching workspaces) SHALL show as a row of gesture icons, each with a tooltip and an accessible name that give the gesture and its keys, instead of sentences. Full text: section Shortcut coverage.

Scenario: Camera gestures

  • WHEN the Camera group of the Actions menu shows
  • THEN a gesture icon names "Super + arrastar" to move the camera and another names Super + scroll or pinch to zoom, and no gesture sentence shows

Requirement: Super is explained where it shows

The sentence "Super é a tecla com o símbolo do sistema (Windows ou ⌘)" SHALL NOT be a line of the Actions menu or of the onboarding tips; it SHALL show in the tooltip of a control or tip whose key includes Super. Full text: section Introduction.

Scenario: The Super tooltip

  • WHEN the user points at a tip whose key is Super
  • THEN its tooltip explains the Super key and no line of the card repeats it

Status

Doc status: current contract. Checked 2026-11-10.

Introduction

Decision of 2026-11-03: every currently usable desktop shortcut needs a visible, operable counterpart in the relevant context. Decision of 2026-11-13 (owner): the counterpart is an icon control, with text only where no icon reads clearly; its tooltip and accessible name give the action and its key mapping, and the icons stay without sentences. The owner meant tooltips, key mappings and expressive icons, not text written in the panel. The tooltip of a control whose key includes Super also says what Super is ("Super é a tecla com o símbolo do sistema (Windows ou ⌘)"), so no line of the panel or of the onboarding tips repeats it. The Actions menu shows each group as a grid of icon buttons with direction pads for the four directions of a family, and the pointer gestures as a row of gesture icons with tooltips (ui-src/host/ui/shortcut-hint.jsx, ui-src/host/action-icons.js). Grid actions stay out of Canvas and vice versa. New system features must follow this rule.

Plan and acceptance

  1. Inventory the compositor shortcuts and existing protected controls.
  2. Add an icon-only Actions button (the Command icon, aria-label and tooltip "Ações deste monitor e atalhos", no visible word) to every bottom workspace bar (under the theme Office the primary bar has it in the overview, behind the Task View button: "Ações e atalhos", openspec/specs/ui-themes/spec.md). A protected React/HeroUI panel groups actions by Workspace, Camera, Window and System, names its monitor and target window, and shows only operations supported by that current context.
  3. Bind the panel to the output, workspace, compositor instance and application that existed when it opened. Recheck availability on each operation. A closed window, changed workspace, lock or new compositor refuses an old action; transitions hide layout controls. Native operations use typed commands, never injected keys. Generated HTML, plugins, model tools and scheduled turns gain no access.
  4. Reuse existing operations and input refusals. Keep camera actions in the chosen view. Keep application focus while a protected menu takes the keyboard. Preserve existing recovery and persistence.
  5. Test context filtering, stale targets, host-only native authority, per-monitor routing and mouse execution. Run the project gates and isolated nested validation; keep screenshots and logs local.

Shortcut coverage

The table is the current contract since the Super mode of 2026-11-04 (super-mode.md). History: the Super row read "Show/hide chat", the camera row named Super+Shift+F, and the Chat/bar row named Ctrl+Shift+N; those keys and meanings are gone.

Context Shortcut Visual action
Workspace Super "Ver tudo e falar" (chat): fit all at most at zoom 1 and above the box, then the composer box (with the workspace overview open: no fit, and the core closes the overview); also the chat button of the bottom bar, which shows the whole chat with no key
Workspace Super+S Open/close workspace overview
Workspace Super+1..9, Super+0 Workspace tabs and named workspace choices
Workspace Super+Left/Right, Super+Shift+scroll Previous/next workspace on this monitor; the workspace tabs and the wheel over the bar. The Workspace group of the Actions menu explains the scroll
Workspace Super+T Enter/leave the focus layout
Workspace Super+Shift+T Switch Grid/Canvas when that transition is allowed
Camera in Grid or Canvas Super (tap) "Enquadrar tudo neste monitor" (fit_all), shown with "Super"; Super+Shift+F was removed on 2026-11-04
Camera in Grid or Canvas Super+Equal/Minus, Super+Ctrl+0 Zoom in/out; actual size
Camera in Grid or Canvas Super+middle drag; Canvas also Super+left drag Directional camera pad and the gesture icon "Mover a câmera"
Camera in Grid or Canvas Super+scroll, pinch Zoom icon buttons and the gesture icon "Zoom"
Window in Canvas Super+F Fit the target window in this view
Window in Grid Super+F Expand/restore the target tile
Workspace Super+G Arrange Canvas windows in a row or evenly fill the Grid
Window in Grid Super+Alt+arrows Focus the neighbouring window
Window in Grid Super+Ctrl+arrows Move/swap the tile by one cell
Window in Grid Super+Ctrl+Alt+arrows Grow or shrink the tile
Window outside Canvas Super+Shift+Space Float the window or return it to its layout
Window Super+Shift+Left/Right Move to the neighbouring monitor
Window Super+Q Close the target application window
Window Alt+Tab or Super+Tab, with Shift backwards Next/previous application window
Window in Canvas Alt+scroll down "Próxima janela" (focus_next): the next window in spatial order, camera centered at the same zoom
Window in Canvas Alt+scroll up "Janela anterior" (focus_previous): the previous window in spatial order
Camera during an animation Esc Stop camera movement
Workspace palette/sidebar Esc Return to the application
System Print, Shift+Print, Alt+Print Open capture UI, save primary monitor, save captured application window
Chat/bar Super+N Icon-only New conversation button whose tooltip and accessible name give "Nova conversa" and the key (new_chat input request)
System Super+Ctrl+Shift+R Turn the overlay of the chat host off; the recovery page has the button with this key mapping while an overlay is active (overlay_safe_mode input request, openspec/specs/immutable-base/spec.md)
System Super+Return Open terminal
System Super+L Lock screen
System Super+Escape End the desktop session, with an explicit mouse confirmation

Pointer move/resize equivalents already exist on application edges. The panel also shows the relevant Super drag mapping in the Window context as gesture icons with tooltips. The action palette also exposes the three capture shortcuts, without reading or returning pixels. Screen and region capture labels explicitly name the primary monitor, matching the existing capture service. Media, volume, brightness and power retain their existing protected controls. Virtual-console keys belong to the operating system, not the Super shortcut inventory.

The Alt+scroll actions are hidden on a Grid workspace (a Grid is one focus in phase 1); the core filters them on a layout that is not Canvas or a Focus over a Canvas base, and the compositor lists them only on Canvas. They share the labels "Próxima janela" and "Janela anterior" with the Alt+Tab actions, as the contract of the Super mode names them; the key mapping tells them apart.

Super+Shift+scroll (2026-11-06, the user: "não tem como alternar facilmente entre workspaces, só clicando nele") steps the workspace from anywhere on the screen and on every layout, up to the previous and down to the next, also with a horizontal scroll. It takes the input request of Super+Left and Super+Right, so the core applies their refusals and drops a step during a switch, while a dialog waits and during a response without the live workspace_outputs lease (openspec/changes/super-mode/design.md, Phase 3). The compositor keeps at most one step for each 250 ms, as the wheel of the bar, and no client gets its scroll amounts (a finger stop with no amount still reaches the client, which keeps the axis events of that client balanced). Before this change the chord was the Super+scroll zoom. Each workspace tab names its key in its tooltip, and the first-run card and the Início tab list these keys.

Hot corners

Since 2026-11-04 a free corner of an output can run one of the actions chat, overview, terminal, screenshot and lock (hot-corners.md). A corner is a pointer trigger, not a shortcut with no counterpart: each of its actions keeps its entry in the Actions menu and its key, and Configurações > Janelas > Cantos da tela shows the mapping, with the key of each action. The corner calls the code of the key in the compositor; it does not use user_action or a menu serial.

Keybinding table

Since 2026-11-10 the remappable keys of the table above are data: the compositor keeps a closed list of actions with these keys as its defaults, and the core can send another table on the control connection (keybindings.md). The fixed keys stay in the compositor and no table can shadow them: the VT switch, the lock (Super+L), quit (Super+Esc), the overlay safe mode (Super+Ctrl+Shift+R), the switcher (Alt+Tab, Super+Tab), the screenshot keys, every Escape behavior and the Super tap. The Actions menu shows the first chord of each action from the table that the compositor reports, and the catalog key of web-shell/core/context-actions.js only for a compositor that reports no table. Since 2026-11-12 the table comes from keybindings.json in the profile (openspec/changes/keybindings), and the labels of the bars, the overview, the first-run card, the settings and the workspace tabs read the table that the compositor reports (wm.shortcuts), with the default per action when it reports none.

Protected execution

POST /api/desktop-actions/open takes only the connector name. The core captures the workspace, application and compositor instance and binds them through user_action_context on its registered host connection. GET /api/desktop-actions returns labels and key mappings for the native availability list. POST /api/desktop-actions takes only that menu serial and a listed action. It sends user_action, a closed enum; the compositor rechecks the captured view, window, host connection and action immediately before execution. The ordinary desktop command path refuses both commands. No action injects keys or accepts an executable, coordinates, JavaScript or an arbitrary command.

The fixed terminal action shares the existing Super+Return launcher. Screenshot actions share the existing input request path and never return pixels to the action route. Workspace selection shares the keyboard request queue and the core filters it while a turn blocks navigation. The menu does not disable unrelated camera and window actions during a turn. A dialog has close/screenshot/window-switch controls, without root layout controls. Ending the session requires a second explicit mouse confirmation. Its "Encerrar sessão" arms once the confirmation has been open for 1.5 s (ui-src/host/ui/arming.js, shared with the trash confirmation of the Lumen dock); the delay counts only while the top layer shows it, and each time it shows again it starts over and the focus goes to Cancelar, and a move or resize of the surface or of the window starts it over too (read every 100 ms and at the press, #19), and the press reads the clock and runs the sync of the top layer again, so a double click on the menu item, or a button that an animation of the page moves under the pointer, ends nothing (#18).

There is one protected menu context at a time. Opening it on another monitor invalidates the earlier menu serial. Its window stays in the existing protected HUD band; its heading identifies the monitor whose view it controls. Nothing is persisted, and the running compositor must advertise contextActions before a bar offers the entry point. The v6 protected panel migration adds the menu once and reserves its id against plugins.

Implementation notes

The protected panel follows the existing standalone Menu pattern used by workspace-menu and tray-menu. HeroUI's official Dropdown documentation documents visible keyboard slots and grouped menu items. The project uses @heroui/react 3.2.7; the implementation reuses its installed Menu and Button components and existing panel runtime. Context CLI was unavailable during this task.

Verification of 2026-11-03

  • Rust, session feature: 728 passed; the existing 35 EGL/measurement tests remain ignored. Includes host-only authority, captured-window focus, stale workspace and workspace order, one-based numbered choices, Focus/Grid/Canvas filtering and a shared Grid camera on the selected monitor only. Rustfmt and Clippy with warnings denied pass.
  • Web suite: 1,233 passed. The previous parallel run hit the existing Bluetooth deadline test; its isolated suite (22 tests) and the final full run pass.
  • After rebasing onto main 1ee41d4, 42 focused tests covering contextual actions, bars, runtime, local models and test isolation pass; syntax, lint and build reproduction pass again.
  • HTTP/browser integration: real protected pages and core against a private compositor protocol fixture. Mouse opening and execution, visible key mapping, Grid/Canvas filtering, logout confirmation, native refusal display, CSP and unauthenticated requests pass. The bar test covers both monitor origins. Syntax, ESLint, reproducible UI build, Prettier and design tokens pass.
  • Nested run d5afa529 started and stopped cleanly. The parent desktop allocated it only 296x456 logical pixels, split into two 148-pixel outputs. This was insufficient for visual interaction QA; the live session was left unchanged. The screenshots come from the isolated browser/core test with synthetic data, not from a claimed compositor visual approval.
  • Local artifacts: grid-camera.png, canvas-window.png, rust.log, web.log, ui.log, clippy.log, format.log under the local QA folder 2026-11-03-contextual-actions. No upload. No live runtime restart.

The islands of Ninja (2026-11-13)

Under the experimental Ninja the top bar is three islands (workspaces and metrics; date, clock and notifications; tray, desktop actions and status). The actions keep their place, label and key in their island, at 1280 and 1920 px, in Grid and in Canvas; an island is as wide as its content and never hides an action behind its cut (openspec/changes/theme-packs/design.md, section 6, The top bar: three islands).