Skip to content

Show app icons in the results bar - #92

Merged
oNaiPs merged 4 commits into
mainfrom
feature/app-icons
Oct 17, 2026
Merged

oNaiPs merged 4 commits into
mainfrom
feature/app-icons

Conversation

@oNaiPs

@oNaiPs oNaiPs commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Adds an optional icon before each result in the horizontal bar.

  • New Show icons toggle in Settings → Appearance. It is off by default, Reset to Defaults turns it off again, and the bar redraws as soon as you flip it (it goes through the existing appearanceSettingsChanged → invalidateLayout path).
  • Apps and System Settings panes get their Finder icon (NSWorkspace.icon(forFile:)), sized to the font's text height and cached per path in IconCache. Built-in panes are empty stubs that Finder shows as blank documents, so they use the System Settings icon. A pane that ships its own icon keeps it.
  • $PATH programs, piped stdin choices and typed commands get no icon.
  • Layout is still measured once per list or font change, and drawing still only covers the dirty rect. Icons are fetched lazily for the items being drawn, so a long list never loads every icon.
  • The file URL is read through a small FileURLRepresentable protocol that CompositeListProvider's tagged wrapper also adopts. ListItem itself does not change.

Testing: xcodebuild ... test passes (222 tests). The new tests cover the setting's default, round trip, model notification and reset, URL extraction (including through the composite provider), the stub pane icon fallback, and layout width with icons on and off. swiftlint --strict is clean. I also rendered the view offscreen with Calculator, Displays (pane), nvim (command) and Safari and checked the result by eye. The icons line up with the text, the pane shows the System Settings gear, and nvim has no icon.

🤖 Generated with Claude Code

Apps and System Settings panes get their Finder icon, sized to the text and
cached per path. Built-in panes are empty stubs, so they use the System
Settings icon. Icons are fetched only for items being drawn. Off by default.
Icons were drawn at the fractional x offset that follows the preceding text,
so they straddled device pixels and were resampled. Align the icon rect to the
backing grid and draw with high-quality interpolation.
# Conflicts:
#	README.md
#	dmenu-macTests/AppearanceManagerTests.swift
#	dmenu-macTests/AppearanceSettingsModelTests.swift
#	src/AppearanceSettings.swift
#	src/CompositeListProvider.swift
@oNaiPs
oNaiPs merged commit e161588 into main Oct 17, 2026
3 checks passed
@oNaiPs
oNaiPs deleted the feature/app-icons branch October 17, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant