spacr.qt.command_palette

Command palette — Ctrl-K searchable action list.

Every navigable app, every preference toggle, every menu action gets registered as a Command and the palette lets users jump to it by typing a few characters. Modelled on VS Code / Slack / Linear.

Public API:

from spacr.qt.command_palette import CommandPalette
CommandPalette(window).exec()

The window is inspected on show — no need to preregister anything. Commands are:

  • every entry in spacr.qt.app.APPS

  • every recent run journal entry (jump straight into its app + load the settings via AppScreen.apply_settings_dict)

  • every action in the menu bar

  • an “Open Preferences…” shortcut

  • an “Open Providers…” shortcut

Fuzzy match is a plain substring case-insensitive scan — good enough for the ~30 commands the palette will ever hold.

Classes

Command

One entry in the palette.

CommandPalette

Modal dialog with a live-filtering command list.

Module Contents

class spacr.qt.command_palette.Command[source]

One entry in the palette.

Variables:
  • label – human-readable text shown in the list.

  • section – category badge ("Apps" / "Recent" / …).

  • action – callable invoked when the user hits Enter.

  • keywords – extra strings the fuzzy match will search alongside the label (e.g. “mask cellpose” so typing “cellpose” finds the Mask app).

class spacr.qt.command_palette.CommandPalette(window: PySide6.QtWidgets.QMainWindow)[source]

Bases: PySide6.QtWidgets.QDialog

Modal dialog with a live-filtering command list.

Parameters:

window – the MainWindow the palette should operate on.

Build the command palette over the main window.

Parameters:

window – the window every command acts on.

keyPressEvent(event: PySide6.QtGui.QKeyEvent) → None[source]

Move through the results, or run the highlighted command.

Parameters:

event – the Qt key event.

Nested helpers

CommandPalette._collect_commands.app_is_visible(_key)

Fallback that treats every app as visible.

spacr/qt/command_palette.py:128