shortcuts

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Declarative keyboard-shortcut catalog for chirp-ui.

The catalog is the single source of truth:shortcuts_help.htmlrenders the help modal from it, and thechirpuiShortcutsAlpine factory dispatches from the same data (serialized via …

Declarative keyboard-shortcut catalog for chirp-ui.

The catalog is the single source of truth:shortcuts_help.htmlrenders the help modal from it, and thechirpuiShortcutsAlpine factory dispatches from the same data (serialized viashortcuts_json()). This makes the open-webui #17015 class of bug structurally impossible — the modal cannot advertise a binding the handler does not run, because both read one list.

Chirp-agnostic and stdlib-only, likeroute_tabs.py and grid_state.py.

shortcuts

Name Type Default Description
type
qualified_name
element_type
description
source_file
line_number
is_autodoc
autodoc_element
_autodoc_template
_autodoc_url_path
_autodoc_page_type
title
doc_content_hash

Symbols on this page

Shortcut
class

One keyboard shortcut.

keys are display tokens rendered via kbd()in the modal (e.g. ("⌘", "K")). The handler matches on mod(ctrlKey||metaKey, unified), shift, and event_key(). allow_in_inputopts a shortcut past the input-context guard (Escape, focus-composer, composer send) — everything else early-returns when focus is in a text field.

shortcuts_by_category
function
def shortcuts_by_category(shortcuts: tuple[Shortcut, ...] = DEFAULT_SHORTCUTS) -> dict[str, list[Shortcut]]

Group shortcuts by category for the help modal, preserving insertion order.

Parameters

Name Type Default Description
shortcuts tuple[Shortcut, ...] DEFAULT_SHORTCUTS
shortcuts_json
function
def shortcuts_json(shortcuts: tuple[Shortcut, ...] = DEFAULT_SHORTCUTS) -> str

Serialize the catalog for thechirpuiShortcutsAlpine factory.

Only the handler-relevant fields are emitted (displaykeysstay server-side for the modal). Embedded in a<script type="application/json"> so the handler reads the same data the modal rendered from.

Parameters

Name Type Default Description
shortcuts tuple[Shortcut, ...] DEFAULT_SHORTCUTS

View source · /home/runner/work/chirp-ui/chirp-ui/site/../src/chirp_ui/shortcuts.py:1