Skip to content

Update font-awesome extension - #22085

Merged
raycastbot merged 3 commits into
raycast:mainfrom
j3lte:ext/font-awesome
Oct 13, 2025
Merged

raycastbot merged 3 commits into
raycast:mainfrom
j3lte:ext/font-awesome

Conversation

@j3lte

@j3lte j3lte commented Oct 10, 2025 •

Copy link
Copy Markdown
Contributor

Description

Screencast

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: fontawesome Issues related to the fontawesome extension platform: macOS platform: Windows labels Oct 10, 2025
@raycastbot

raycastbot commented Oct 10, 2025 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @dutzi @GLaDO8 @DanielFerguson @ridemountainpig @yusifaliyevpro @xmok you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

You can expect an initial review within five business days.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Summary

Fixed crash when cached state is corrupted by adding proper null safety (|| [] fallback) in data handling. Refactored code into custom hooks (useData, useAccessToken, usePreferences) and extracted components (StyleSelector, IconActions) for better maintainability.

Key changes:

  • Bug fix: extensions/fontawesome/src/hooks/useData.ts:24 now safely handles null/corrupted cached state with || [] fallback, preventing "Cannot read properties of null" error
  • Extracted token management into useAccessToken hook with proper loading state handling
  • Separated style selection UI into reusable StyleSelector component
  • Added TypeScript path aliases (@/*) and import sorting configuration
  • Updated dependencies to latest versions

Confidence Score: 4/5

  • This PR is safe to merge with minor style configuration issue
  • The core bug fix is solid and well-implemented. The refactoring improves code organization without changing functionality. Only issue is the Prettier configuration uses singleQuote: true instead of the required singleQuote: false per Raycast standards, which is a non-critical style preference.
  • Check extensions/fontawesome/.prettierrc for Prettier configuration alignment with Raycast standards

Important Files Changed

File Analysis

Filename Score Overview
extensions/fontawesome/src/hooks/useData.ts 5/5 Extracts data fetching logic into reusable hook; fixes null reference bug by adding `
extensions/fontawesome/src/index.tsx 5/5 Simplified main component by extracting logic into custom hooks; cleaner and more maintainable code structure
extensions/fontawesome/.prettierrc 4/5 Changed singleQuote to true (conflicts with custom rule 62e5e99b requiring singleQuote: false); added import sorting plugin

15 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread extensions/fontawesome/.prettierrc Resolved
@j3lte

j3lte commented Oct 10, 2025

Copy link
Copy Markdown
Contributor Author

@greptileai can you check it again?

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the PR and the diff more carefully, I can see this is a comprehensive refactor of the Font Awesome extension. Let me analyze the key changes:

Summary of Changes

Main Improvements:

  1. Fixed search corruption issue - The PR addresses issue #22051 where search would fail and cached state gets corrupted
  2. Code organization - Refactored into a better structure with separate hooks, components, and utils
  3. Dependencies updated - Updated various packages and added prettier import sorting

Key Technical Changes:

  1. Hook-based architecture:

    • useAccessToken - Handles token fetching and expiry logic
    • useData - Manages icon data fetching
    • usePreferences - Centralizes preference handling
  2. Component extraction:

    • IconActions - Extracted action panel logic
    • StyleSelector - Extracted style dropdown logic
  3. Utility organization:

    • Split utils into separate files (actions, data, query)
    • Added TypeScript path aliases (@/)
  4. Configuration improvements:

    • Added prettier import sorting plugin
    • Updated tsconfig with path mapping
    • Added filtering=false to Grid component

Critical Fix:
The main issue being addressed is in useAccessToken hook where it now properly uses useLocalStorage instead of the previous approach that could cause state corruption. The token expiry logic is now more robust with proper loading states.

Quality Assessment:
✅ Good changes:

  • Better separation of concerns
  • Cleaner hook-based architecture
  • Proper loading state management
  • Fixed the core search corruption issue

✅ Code structure is much improved - the refactor makes the code more maintainable and easier to test

✅ Dependencies are properly updated and the new prettier plugin will help with consistent imports

This is a solid refactor that both fixes a critical bug and improves code quality significantly. The changes are well-structured and follow React best practices with custom hooks and component separation.

@pernielsentikaer pernielsentikaer self-assigned this Oct 13, 2025

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit df7f1ac into raycast:main Oct 13, 2025
@github-actions

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@j3lte
j3lte deleted the ext/font-awesome branch October 13, 2025 11:17
tktcorporation added a commit to tktcorporation/extensions that referenced this pull request Nov 2, 2025
- chore: add assets and metadata for store submission
- docs: add comprehensive documentation
- test: add comprehensive test coverage
- feat: implement UI components and main search interface
- feat: add internationalization support
- feat: add AI-powered query interpretation
- feat: implement core app search functionality
- feat: add type definitions and fuzzy matching utilities
- feat: initialize app-search extension with project configuration
- Update CODEOWNERs (7b1e59c4)
- Add kagi-news extension (#22389)
- brew: Change "formula" to "formulae" (#22518)
- Update CODEOWNERs (257af696)
- Add string-formatter extension (#21859)
- Update CODEOWNERs (2a0fab28)
- Add helium extension (#22290)
- feat(markdown-codeblock): add newline prefix (#22369)
- Update CODEOWNERs (b20058a1)
- Docker/add windows support (#22455)
- Add Windows platform support (#22453)
- Update CODEOWNERs (aa68611f)
- Add xkcd-password-generator extension (#22433)
- Update CODEOWNERs (8bf2a9d9)
- Add Stagehand extension (#22179)
- Update CODEOWNERs (59d237b7)
- Add micro-snitch-logs extension (#22390)
- Update CODEOWNERs (238052ee)
- Update github extension (#22384)
- Docs: Update the utils docs
- Update CODEOWNERs (42e307ec)
- Add ivpn extension (#22149)
- Add Pagination to List of Playlist Songs (#22145)
- [Update] [Things] Increase timeout in AppleScript and update Node packages to latest (#22512)
- Update figma-files-raycast-extension extension (#22254)
- Update prism-launcher extension (#22458)
- Update unicode-symbols extension (#22510)
- Update jsr extension (#22503)
- Update CODEOWNERs (0fd5ad08)
- Add keeper-security extension (#22296)
- Update filemaker-snippets extension (#22509)
- Update CODEOWNERs (e858971c)
- Add paynow extension (#22380)
- [ipapi.is] fix error when some location field is invalid (#22493)
- Update CODEOWNERs (ccfa9932)
- Update zen-browser extension (#22491)
- Update tembo extension (#22471)
- Delete .github/workflows/add-approve-label.yml (#22501)
- Update `Chatwoot` extension - Add "My Inbox" command + Fix "List Messages" command (#22490)
- [Linear] Use API-provided notification presentation (#22285)
- Update CODEOWNERs (1a7209ee)
- Update harvest extension (#22256)
- Update CODEOWNERs (13787cdf)
- Fix finding button in Tahoe. (#22330)
- Update GitHub Actions workflow for PR approvals (#22487)
- Docs: update for the new API release
- Update CODEOWNERs (77f64775)
- Added support for Asana sections (#21912)
- Update auto-label workflow for PR approvals (#22484)
- Update GitHub Actions workflow to set effective token (#22482)
- Update workflow to use pull_request_review event (#22479)
- Update CODEOWNERs (d5727aab)
- Add action to generate and copy private links (#22273)
- Enhance PR approval labeling workflow (#22477)
- Chatgpt atlas bookmarks improvement (#22371)
- Add windows support  (#22367)
- Update diskutil-mac extension (#22307)
- [Secret Browser Commands] add ChatGPT Atlas, etc (#22348)
- Update deployhq extension (#22319)
- [Serie A] Update extensions (#22427)
- Update CODEOWNERs (a0f6527b)
- Update arc extension (#22272)
- Update CODEOWNERs (82962ede)
- Add file-info extension (#22259)
- [LaLiga] Update extensions (#22452)
- Update CODEOWNERs (9f49ac17)
- Update jotoba extension (#22379)
- Update capture fullpage of website extension (#22392)
- Update CODEOWNERs (9eeb19ae)
- Add `Formizee` extension - The Open-Source Forms Platform (#22281