C.W.K.
Stream
Lesson 04 of 04 · published

One Shortcut You Can't Lose

~10 min · palette, discovery, non-activating, overflow

Level 0Cold Flint
0 XP0/34 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"You can't remember thirty chords. You can remember one, and search for the rest."

A Chord for Everything Is Too Many Chords

Per-macro hotkeys are great for the two or three transforms you run constantly. They fall apart at scale: nobody memorizes thirty chords, and the more you assign, the more you collide with the system and with each other. So Flint has a second trigger that scales where chords don't — a single, searchable palette. One shortcut opens a list of every macro; you type to filter, and Enter runs the match against your current selection. Frequent transforms get a chord; everything else gets the palette.

The Palette Captures the Target First

There's a subtlety that ties the palette to the rest of the app. A palette is a window, and windows steal focus. If the palette simply appeared and then you picked a macro, the target would be the palette itself, not the text you were editing. So the palette shortcut does exactly what a macro strike does: it snapshots the frontmost target — app, element, selection — at the instant it fires, before the palette appears, and shows the palette as a non-activating panel that floats without stealing focus. When you pick a macro, it runs against the captured target, not the palette.

palette shortcut down
   snapshot target { app, element, selection }   <- BEFORE showing anything
   show non-activating panel (does NOT steal focus)
   user types to filter, picks a macro
   run macro against the SNAPSHOT, not the panel

One Shortcut You Can't Lose

The palette's own shortcut has a sensible default (a modifier-heavy chord unlikely to collide, and rebindable if it does). Because every macro is reachable through it, the palette is the guarantee from the last lesson made concrete: even when a macro's personal chord is dead — taken by another app, never assigned, forgotten — the macro is one palette-search away. A hotkey app that can only be driven by hotkeys is fragile; one that always has a searchable fallback is not.

Give power users chords and everyone a search box. Discoverability and speed pull in opposite directions: memorized chords are fast but invisible; a searchable list is discoverable but slower. You don't choose — you offer both, and let each macro earn a chord while the palette carries the long tail. The search box is also your escape hatch when the fast path breaks.
The palette panel must be non-activating. If the palette window activates when it appears, it becomes the frontmost app and the target you meant to transform loses focus — you'd be running a macro against the palette. Use a non-activating panel so it can float over everything and take keystrokes for its search field without ever stealing the target's focus. This is the same focus discipline the insertion track depends on.

Code

The palette snapshots the target before it shows·swift
func openPalette() {
    // Capture the target NOW, before the panel exists to steal focus.
    guard let target = TargetCapture.snapshot() else { return }

    let panel = PalettePanel()          // an NSPanel, .nonactivatingPanel
    panel.macros = store.enabledMacros  // the searchable list
    panel.onPick = { macro in
        Task { await runMacro(macro, against: target) }  // captured target
    }
    panel.orderFrontWithoutActivating() // float; do NOT become frontmost
}

// Contrast: a macro's chord and the palette both start the SAME way —
// snapshot the target first. The palette just adds a search step in between.

External links

Exercise

Design the trigger strategy for a user with twenty macros. Which handful deserve their own chords, and why those? How does the palette carry the other fifteen without the user memorizing anything? And explain why the palette shortcut, unlike the per-macro chords, has to capture the target before the panel is even visible.
Hint
The three-or-four highest-frequency transforms earn chords (muscle memory pays off); the rest live in the palette, found by typing a few letters of the name. The palette must snapshot first because it is a window that will take focus the moment it appears — capture-then-show is the only order that keeps 'the text I was in' as the target instead of the palette itself.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.