Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AI QL Tuui Global Shortcut Command Picker

From Leeroopedia
Knowledge Sources
Domains Command_Picker, Shortcuts, UX_Patterns
Last Updated 2026-10-24 00:00 GMT

Overview

A system-wide command picker pattern that uses a global keyboard shortcut to grab selected text from any application, present a popup prompt template selector, and route the selection to a chat interface.

Description

The Global Shortcut Command Picker pattern (inspired by macOS Spotlight and Alfred) enables instant access to AI-powered text transformations from any application. When the user presses the global shortcut (Ctrl+Alt+T), the system grabs the currently selected text via platform automation, caches it with a UUID, and opens a small frameless popup window at the cursor position showing a list of prompt templates. When the user selects a template, the popup closes, focus is returned to the source app, and the main window navigates to the chat route with the selected prompt and cached text injected. This pattern removes the friction of copying text, switching apps, and pasting.

Usage

Use this principle when building desktop applications that need system-wide text transformation or AI assistance accessible from any application via a keyboard shortcut.

Theoretical Basis

The command picker flow is a state machine:

IDLE → [Ctrl+Alt+T] → GRABBING → PICKER_OPEN → [Select] → ROUTING → CHAT → IDLE
                    ↘ [No text]  → NOTIFICATION → IDLE

States:
  GRABBING:     Automator.copySelectedText() → clipboard → cache with UUID
  PICKER_OPEN:  300×320 frameless window at cursor with /popup route
  ROUTING:      Close popup → release focus → navigate main window to #/chat
  CHAT:         Send { prompt, input } to renderer via msgCommandSelectionInvoke

Key design properties:

  • Global scope: Shortcut works regardless of focused application
  • Text caching: UUID-keyed cache bridges the gap between text grab and chat injection
  • Focus management: Source app focus is preserved and restored after popup close
  • Popup positioning: Window appears at cursor, constrained to screen bounds

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment