Repository navigation
Add forscore extension - #22204
Add forscore extension#22204
Conversation
|
Congratulations on your new Raycast extension! 🚀 You can expect an initial review within five business days. Once the PR is approved and merged, the extension will be available on our Store. |
- Updated lockfile - Refactor package.json to remove Windows platform support and update browse-scores.tsx to use PreferencesAction component for opening extension preferences.
There was a problem hiding this comment.
Greptile Overview
Summary
Adds a new Raycast extension for controlling forScore, a music sheet management app for macOS. The extension provides page navigation commands (next/previous/go-to-page), setlist navigation (next/previous item), and a library browser that reads from a CSV export.
Major Changes:
- Page navigation using forScore URL schemes for next/previous page and jump-to-page functionality
- Setlist navigation for moving between scores in a setlist
- Library browser that parses exported CSV files to display and search scores
- Proper macOS platform restriction and forScore installation checks
Issues Found:
- Critical CSV parsing bug: uses naive
split(",")which will break when field values contain commas (e.g., composer names like "Mozart, Wolfgang Amadeus" or multi-genre tags)
Confidence Score: 2/5
- This PR has a critical bug that will cause parsing failures with real-world CSV data
- The CSV parser uses a naive string split approach that will fail when any field contains commas, which is common in music metadata (composer names, multiple genres/tags, etc.). While the extension structure is solid and follows Raycast guidelines well, this parsing bug will cause runtime failures when users export real CSV data from forScore
- Pay close attention to
extensions/forscore/src/utils/utils.ts- the CSV parsing logic must be fixed before merge
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| extensions/forscore/src/utils/utils.ts | 2/5 | CSV parser uses naive split(",") which breaks on commas within field values - critical parsing bug |
| extensions/forscore/package.json | 5/5 | Well-structured manifest with proper macOS platform restriction and clear command definitions |
| extensions/forscore/src/browse-scores.tsx | 5/5 | Clean React component with proper error handling and list display |
| extensions/forscore/src/hooks/hooks.ts | 5/5 | Proper use of useCachedPromise with good error handling for missing CSV or app |
18 files reviewed, 1 comment
| const line = lines[i].trim(); | ||
| if (!line) continue; | ||
|
|
||
| const values = line.split(","); |
There was a problem hiding this comment.
logic: naive split(",") breaks when CSV fields contain commas (e.g., "Mozart, Wolfgang Amadeus" or "Classical, Romantic"). use proper CSV parser or handle quoted fields
| const values = line.split(","); | |
| // Use a proper CSV parsing approach that handles quoted fields | |
| const values = line.match(/(".*?"|[^",]+)(?=\s*,|\s*$)/g)?.map(v => v.replace(/^"|"$/g, '').trim()) || []; |
- Update - Update
|
@greptileai can you have another look |
There was a problem hiding this comment.
I've reviewed the forScore extension again and I can see this is a well-structured extension for managing the forScore music app from Raycast. Let me provide some feedback on the implementation:
Positive aspects:
- Good structure: Clean separation of concerns with hooks, utils, types, and constants
- Proper error handling: Good error states in the browse-scores component
- CSV parsing: Nice implementation for parsing forScore's exported metadata
- URL schemes: Proper use of forScore's URL scheme for navigation
- TypeScript: Good type definitions and usage
Areas for improvement:
-
File extensions inconsistency: Some files use
.tswhile others use.tsx- this should be consistent based on whether they contain JSX -
Mock data in production: The
assets/mock-data.csvfile probably shouldn't be included in the final extension -
Error messages could be more helpful: In the CSV parsing, you could provide more specific error messages about what's wrong with the file format
-
Preferences validation: Consider adding client-side validation for the CSV file path in preferences
-
Loading states: The browse-scores command could benefit from better empty states when no CSV is configured vs when it's loading
Would you like me to suggest specific fixes for any of these areas, or is there a particular aspect of the extension you'd like me to focus on?
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder