Repository navigation
Add app-hider extension - #33526
Add app-hider extension#33526LeonidAlekseev wants to merge 1 commit into
Conversation
- Use failureToastOptions for the scan error toast - Update package-lock - Address Store review feedback - Add package-lock and Store screenshots - Fix lint: use Raycast common shortcuts and run Prettier - Prepare extension for the Raycast Store - Add screenshot to README - Replace extension icon with a slashed eye - Initial commit: App Hider Raycast extension
|
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 15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
[Medium impact] The change affects app locations and launcher listings on a user’s Mac. The Launchpad layout-loss warning must be added before merging. Findings
Fix with agent prompt### Issue 1
extensions/app-hider/src/manage-apps.tsx:291-293
On macOS 15 and older, hiding or restoring an app resets Launchpad folders and icon order because `resetLaunchpad` defaults to true. Neither move confirmation mentions this loss. The repository requires confirmation before an irreversible change. Add the layout warning to those confirmations, or ask separately before resetting, as the manual refresh already does.
### Issue 2
extensions/app-hider/src/manage-apps.tsx:467-476
`hideApp` moves the bundle before saving its restore record. If Raycast crashes or is force-quit between those steps, the catch block cannot roll back the move. Later scans read hidden apps only from the registry, so the app disappears from the extension and needs manual recovery. Save a pending move before renaming, then repair unfinished moves on startup.
### Issue 3
extensions/app-hider/src/manage-apps.tsx:173-174
`readRegistry` accepts any valid JSON as a `Registry`. If a damaged or manually repaired file contains `[]`, scanning succeeds, but hiding an app adds a string-keyed property to that array. `JSON.stringify` drops that property, so saving succeeds without the restore record and no rollback runs. Reject arrays and check entry fields before allowing moves.
### Issue 4
extensions/app-hider/src/manage-apps.tsx:386
`moveBundle` assigns `EPERM` to every non-cancellation error from the administrator command. `errorMessage` then replaces the actual error with App Management instructions. If a move fails because the disk is full or another filesystem error occurs, users are told to change an unrelated permission. Preserve the original error and show permission advice only for an actual permission denial.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds App Hider, a macOS extension that moves apps into a Spotlight-excluded folder and restores or launches them later.
Acknowledged limitations:
Reviews (1) · Last reviewed commit: "Add app-hider extension" · Reviewed by Greptile |
| async function refreshLaunchpadIfEnabled(): Promise<void> { | ||
| if (!getPreferenceValues<Preferences>().resetLaunchpad) return; | ||
| await refreshAppLauncher().catch(() => undefined); |
There was a problem hiding this comment.
App moves erase Launchpad layouts
On macOS 15 and older, hiding or restoring an app resets Launchpad folders and icon order because resetLaunchpad defaults to true. Neither move confirmation mentions this loss. The repository requires confirmation before an irreversible change. Add the layout warning to those confirmations, or ask separately before resetting, as the manual refresh already does.
Rule Used: Destructive actions What: An action that deletes or overwrites something, or otherwise needs the user's care, uses style={Action.Style.Destructive}. If it can't be undone, ask first with confirmAlert and Alert.ActionStyle.Destructive, using th... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/app-hider/src/manage-apps.tsx
Line: 291-293
Comment:
**App moves erase Launchpad layouts**
On macOS 15 and older, hiding or restoring an app resets Launchpad folders and icon order because `resetLaunchpad` defaults to true. Neither move confirmation mentions this loss. The repository requires confirmation before an irreversible change. Add the layout warning to those confirmations, or ask separately before resetting, as the manual refresh already does.
**Rule Used:** Destructive actions What: An action that deletes or overwrites something, or otherwise needs the user's care, uses `style={Action.Style.Destructive}`. If it can't be undone, ask first with `confirmAlert` and `Alert.ActionStyle.Destructive`, using th... ([source](https://github.com/raycast/extensions/blob/56309172f3ecebc3248e0cb208eae69c79e85bb6/.greptile/config.json))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| await moveBundle(app.path, hiddenPath); | ||
|
|
||
| try { | ||
| registry[app.path] = { | ||
| name: app.name, | ||
| originalPath: app.path, | ||
| hiddenPath, | ||
| hiddenAt: new Date().toISOString(), | ||
| }; | ||
| await writeRegistry(registry); |
There was a problem hiding this comment.
Interrupted hides lose their records
hideApp moves the bundle before saving its restore record. If Raycast crashes or is force-quit between those steps, the catch block cannot roll back the move. Later scans read hidden apps only from the registry, so the app disappears from the extension and needs manual recovery. Save a pending move before renaming, then repair unfinished moves on startup.
Knowledge Base Used: Extension command implementation patterns
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/app-hider/src/manage-apps.tsx
Line: 467-476
Comment:
**Interrupted hides lose their records**
`hideApp` moves the bundle before saving its restore record. If Raycast crashes or is force-quit between those steps, the catch block cannot roll back the move. Later scans read hidden apps only from the registry, so the app disappears from the extension and needs manual recovery. Save a pending move before renaming, then repair unfinished moves on startup.
**Knowledge Base Used:** [Extension command implementation patterns](https://app.greptile.com/-/switch-tenant?tenant=raycast&next=%2Fcustom-context%2Fknowledge-base%2Fraycast%2Fextensions%2F-%2Fdocs%2Fextension-command-implementation.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| try { | ||
| return JSON.parse(raw) as Registry; |
There was a problem hiding this comment.
Array registries drop restore records
readRegistry accepts any valid JSON as a Registry. If a damaged or manually repaired file contains [], scanning succeeds, but hiding an app adds a string-keyed property to that array. JSON.stringify drops that property, so saving succeeds without the restore record and no rollback runs. Reject arrays and check entry fields before allowing moves.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/app-hider/src/manage-apps.tsx
Line: 173-174
Comment:
**Array registries drop restore records**
`readRegistry` accepts any valid JSON as a `Registry`. If a damaged or manually repaired file contains `[]`, scanning succeeds, but hiding an app adds a string-keyed property to that array. `JSON.stringify` drops that property, so saving succeeds without the restore record and no rollback runs. Reject arrays and check entry fields before allowing moves.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| ); | ||
| } catch (error) { | ||
| if (isUserCancel(error)) throw new CancelledError(); | ||
| throw Object.assign(new Error(errorMessage(error)), { code: "EPERM" }); |
There was a problem hiding this comment.
moveBundle assigns EPERM to every non-cancellation error from the administrator command. errorMessage then replaces the actual error with App Management instructions. If a move fails because the disk is full or another filesystem error occurs, users are told to change an unrelated permission. Preserve the original error and show permission advice only for an actual permission denial.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/app-hider/src/manage-apps.tsx
Line: 386
Comment:
**Move errors show wrong advice**
`moveBundle` assigns `EPERM` to every non-cancellation error from the administrator command. `errorMessage` then replaces the actual error with App Management instructions. If a move fails because the disk is full or another filesystem error occurs, users are told to change an unrelated permission. Preserve the original error and show permission advice only for an actual permission denial.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Description
App Hider hides Mac apps from Launchpad, Spotlight and Finder, and restores them later.
Selected apps are moved from
/Applicationsor~/Applicationsinto a Spotlight-excluded folder (~/Library/Application Support/App Hider/Hidden.noindex). Hidden apps can still be launched from Raycast and restored to their original location at any time.Safety notes for reviewers
/Applicationsand~/Applicationsare offered. Symlinks and system locations (/System/...) are never touched.renameon the same volume, with no copying. A move is rolled back if the restore record can't be saved.ResetLaunchPad+killall Dockon macOS 15 and older,killall Spotlighton macOS 26+). This can be turned off in the extension preferences.Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder