Skip to content
This repository was archived by the owner on Oct 17, 2026. It is now read-only.

feat(panel): add scopes and actions like Spotlight on macOS 26 - #9

Merged
oddurs merged 1 commit into
mainfrom
feat/scopes-and-actions
Oct 17, 2026
Merged

oddurs merged 1 commit into
mainfrom
feat/scopes-and-actions

Conversation

@oddurs

@oddurs oddurs commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Problem

Spotlight on macOS 26 narrows a search to one kind with ⌘1–⌘4, lists apps when nothing is typed (it replaced Launchpad), and runs actions. Common Command searched everything at once and could only open things.

Approach

  • Scopes. Scope (all, apps, files, actions) filters candidates and files in Results.compose. A scoped search skips calculations, links, and the web, and shows up to 40 results. With nothing typed, Results.browse lists the scope: apps and panes A–Z (topics left out), recent files (last 30 days by kMDItemLastUsedDate, newest first), shortcuts A–Z, then running apps with each app's Quit and Hide together.
  • Keys and buttons. ⌘1/⌘2/⌘3 toggle Apps/Files/Actions; three buttons at the end of the field do the same, the active one filled with the accent colour, and the field's leading symbol and placeholder follow. ⌫ in an empty field or ⎋ leaves the scope; ⎋ again closes.
  • Actions. shortcuts list (about 50 ms, run with the app scan) gives the user's shortcuts; choosing one runs shortcuts run <name> off the main thread and reports a non-zero exit. Running regular apps get Quit and Hide through NSRunningApplication. Actions weigh -6, and Quit/Hide match by word starts, so "quit sa" can't mean the "sa" in Quit Messages.
  • A scope searches its kind even when Settings leaves it out of everything else. Settings gains a "Shortcuts and app actions" switch.

Changed behaviour

⌘1–⌘9 used to open the nth result, and holding ⌘ showed the numbers. That conflicts with Spotlight's scope keys, so it's gone. Arrow keys, hover, and click remain.

Look at sceptically

  • shortcuts run runs the shortcut headless; one that asks for input shows its own prompt, and one that runs long keeps a background process until it ends.
  • NSRunningApplication.terminate() asks politely; an app with unsaved work shows its own dialog. Force Quit is deliberately not offered.
  • Recent files depend on kMDItemLastUsedDate, which some apps don't update.
  • Clipboard history (Spotlight's ⌘4) is left out on purpose: reading the pasteboard in the background runs into macOS's pasteboard privacy prompts, and it would store everything you copy.
  • Scope switching and the chips were reviewed in offscreen renders only; I didn't drive the live panel.

Checklist

  • scripts/task check passes locally
  • Behaviour tests for scopes, browsing order, and action matching
  • UI reviewed with offscreen renders in light and dark

Spotlight on macOS 26 narrows search with ⌘1–⌘4 and runs actions; without them Common Command felt a generation behind. Apps, Files, and Actions scopes each list what they hold when nothing is typed, which also makes the panel a Launchpad and a recent-files list. Actions run the user's Shortcuts through the shortcuts tool and quit or hide running apps, all with public API and no permissions.
@oddurs
oddurs merged commit 9726372 into main Oct 17, 2026
2 checks passed
@oddurs
oddurs deleted the feat/scopes-and-actions branch October 17, 2026 02:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant