Skip to content

✨ feat(nerd-font-picker): add Nerd Font Picker extension#27450

Open
kud wants to merge 4 commits intoraycast:mainfrom
kud:feat/add-nerd-font-picker
Open

✨ feat(nerd-font-picker): add Nerd Font Picker extension#27450
kud wants to merge 4 commits intoraycast:mainfrom
kud:feat/add-nerd-font-picker

Conversation

@kud
Copy link
Copy Markdown
Contributor

@kud kud commented Apr 26, 2026

Description

This PR adds the Nerd Font Picker extension — a Raycast command that lets users browse, search, and copy Nerd Font PUA glyphs (U+E000–U+F8FF) from their locally installed fonts.

Glyphs are rendered on the fly as SVG data URIs using opentype.js, so no image assets are needed. A rich detail panel shows a live preview alongside the glyph name, codepoint, Unicode escape, HTML entity, and the raw character. Copy actions cover the glyph itself, codepoint, name, and Unicode escape sequence, with an option to close Raycast immediately after copying.

A first-run cache is written to ~/.cache/nerd-font-picker/glyphs.json and can be refreshed at any time from the action panel. Icon colour is configurable via a hex preference (default #ffffff).

Screencast

nerd-font-picker-1

Checklist

@kud kud marked this pull request as ready for review April 26, 2026 18:38
@kud kud requested a review from pernielsentikaer as a code owner April 26, 2026 18:38
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR adds the Nerd Font Picker extension (browse/copy Nerd Font PUA glyphs rendered as SVG data URIs) and adds configurable auto-refresh intervals to four ccusage CLI hooks. The ccusage changes are clean and correct. The new extension has one functional bug that will break the extension for a significant portion of users.

  • findFont only scans ~/Library/Fonts: Nerd Fonts installed via Homebrew land in /Library/Fonts (system-wide). Users with that setup will always hit "No Nerd Font found" and the extension will be unusable for them.
  • Missing metadata/ folder: The extension declares a view-mode command but includes no Raycast-styled screenshots in a metadata/ folder, which is required for store submission.

Confidence Score: 3/5

Not ready to merge — one functional P1 bug blocks users with system-wide Nerd Font installs, and a missing metadata folder blocks store submission.

Two P1 findings: findFont ignores /Library/Fonts causing 'No Nerd Font found' for Homebrew users, and the missing metadata/ folder prevents store publishing. Both must be resolved before merge.

extensions/nerd-font-picker/src/utils.ts (findFont font directory search), extensions/nerd-font-picker/ (missing metadata/ folder)

Important Files Changed

Filename Overview
extensions/nerd-font-picker/src/utils.ts Core utility file for font scanning, SVG rendering, and cache management; findFont only searches ~/Library/Fonts, breaking the extension for users with system-wide Nerd Font installations. Also contains an exported useGlyphs function that is never used.
extensions/nerd-font-picker/src/list.tsx Main Raycast list component; manually types the getPreferenceValues call with an inline interface instead of using the auto-generated Preferences type. Otherwise the component logic, detail panel, and action panel are well-structured.
extensions/nerd-font-picker/package.json Extension manifest; @raycast/utils is listed as a runtime dependency but is never imported in any source file. Also the extension is missing a metadata/ folder required for store submission (view-type command).
extensions/ccusage/src/hooks/useCCUsageDailyCli.ts Adds auto-refresh via setInterval + useEffect driven by a user preference; the same pattern is duplicated across all four CLI hooks cleanly.
extensions/ccusage/src/hooks/useCCUsageMonthlyCli.ts Identical auto-refresh addition as useCCUsageDailyCli; implementation is correct and cleanup is handled.
extensions/ccusage/src/hooks/useCCUsageSessionCli.ts Identical auto-refresh addition; correct implementation with cleanup.
extensions/ccusage/src/hooks/useCCUsageTotalCli.ts Identical auto-refresh addition; correct implementation with cleanup.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/nerd-font-picker/src/utils.ts
Line: 29-37

Comment:
**`findFont` misses system-wide font directories**

`findFont` only reads `~/Library/Fonts` (user-level). Nerd Fonts installed via Homebrew (`brew install --cask font-*`) are placed in `/Library/Fonts`, so any user with a system-wide installation will always receive the "No Nerd Font found" error. The search should fall back through at least `/Library/Fonts`.

```typescript
const findFont = (): string => {
  const dirs = [
    join(homedir(), "Library/Fonts"),
    "/Library/Fonts",
    "/System/Library/Fonts",
  ]
  for (const dir of dirs) {
    if (!existsSync(dir)) continue
    const files = readdirSync(dir)
    for (const suffix of ["NerdFontMono-Regular.ttf", "NerdFont-Regular.ttf"]) {
      const match = files.find((f) => f.endsWith(suffix))
      if (match) return join(dir, match)
    }
  }
  return ""
}
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/nerd-font-picker/src/list.tsx
Line: 29

Comment:
**Manual `Preferences` type in `getPreferenceValues`**

The inline type `{ iconColor: string }` is a manual definition of the preference shape. Raycast auto-generates `Preferences` (and `Preferences.List`) in `raycast-env.d.ts` at build time — manually typing this can go out of sync with `package.json` and causes a lint warning.

```suggestion
  const { iconColor } = getPreferenceValues<Preferences.List>()
```

**Rule Used:** What: Don't manually define `Preferences` for `get... ([source](https://app.greptile.com/review/custom-context?memory=d93fc9fb-a45d-4479-a6a4-b1b4af98ebc8))

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/nerd-font-picker/package.json
Line: 34

Comment:
**`@raycast/utils` listed as dependency but never imported**

Neither `src/list.tsx` nor `src/utils.ts` imports anything from `@raycast/utils`, making it an unused dependency that bloats the bundle and install time. Remove it unless a future use is planned.

**Rule Used:** What: Every dependency listed in package.json must... ([source](https://app.greptile.com/review/custom-context?memory=bffc60eb-f9f2-4219-b804-76e29e267d43))

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/nerd-font-picker/src/utils.ts
Line: 145-153

Comment:
**`useGlyphs` is dead code**

`useGlyphs` is exported but never imported in `list.tsx` or any other file. It's also not a React hook (it has no hooks inside it and the `use` prefix is misleading). This should be removed or actually wired up if it was meant to replace the imperative load logic in the component.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "📝 docs(nerd-font-picker): add extension..." | Re-trigger Greptile

Comment thread extensions/nerd-font-picker/src/utils.ts
Comment thread extensions/nerd-font-picker/src/list.tsx Outdated
Comment thread extensions/nerd-font-picker/package.json Outdated
Comment thread extensions/nerd-font-picker/src/utils.ts Outdated
@kud kud force-pushed the feat/add-nerd-font-picker branch from ff3f920 to 2e0861f Compare April 26, 2026 18:53
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Apr 26, 2026
@raycastbot
Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

kud added 2 commits April 26, 2026 22:11
… logic

- Remove unused @raycast/utils dependency
- Update findFont() to check both ~/Library/Fonts and /Library/Fonts
- Replace inline preference type with Preferences.List
- Remove unused useGlyphs hook export
- Improve error message for missing Nerd Font
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants