Add Spotlight keywords for improved discoverability - #3255
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves macOS Spotlight discoverability for the Studio app without renaming the app bundle, by adding keyword metadata to the app’s packaged Info.plist via Electron Forge’s packaging configuration.
Changes:
- Add
packagerConfig.extendInfo.MDItemKeywordsto the macOS app bundle metadata. - Include WordPress-related terms (
WordPress,WordPress Studio,WP,local WordPress development) as Spotlight keywords.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ivan-ottinger
left a comment
There was a problem hiding this comment.
Nice improvement! The change looks good and works as expected:
➜ studio git:(codex/add-spotlight-keywords) /usr/libexec/PlistBuddy -c 'Print :MDItemKeywords' /Applications/Studio.app/Contents/Info.plist
WordPress, WordPress Studio, WP, local WordPress development
➜ studio git:(codex/add-spotlight-keywords) mdimport -i /Applications/Studio.app
➜ studio git:(codex/add-spotlight-keywords) mdls -name kMDItemKeywords /Applications/Studio.app
kMDItemKeywords = " WordPress Studio,WordPress, local WordPress development, WP"
➜ studio git:(codex/add-spotlight-keywords) mdfind "kMDItemKeywords == '*WordPress*' && kMDItemContentType == 'com.apple.application-bundle'"
/Applications/Studio.app
The only thing I noticed is that kMDItemKeywords is not formatted nicely:
kMDItemKeywords = " WordPress Studio,WordPress, local WordPress development, WP"but when researching it further it looks like to fix that we would need to introduce keywords per each locale.
Considering the feature is working as expected and the issue is cosmetic, I don't think it is worth engineering extra code just for that. Approving. ✅ 🙂
sejas
left a comment
There was a problem hiding this comment.
Thanks for improving the spotlight keywords. LGTM!
📊 Performance Test ResultsComparing 1a44a9d vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
Related issues
How AI was used in this PR
Codex was used to inspect the Electron Forge packaging configuration, test how macOS Spotlight reads app bundle metadata, and apply the focused metadata change. The resulting diff was reviewed and validated locally.
Proposed Changes
MDItemKeywordsmetadata to the packaged app via Electron ForgepackagerConfig.extendInfo. This is scoped to macOS app-bundle metadata and does not change Windows or Linux package metadata.WordPress,WordPress Studio,WP, andlocal WordPress developmentas Spotlight keywords so the app can be discovered by WordPress-related searches without renaming the app bundle.Testing Instructions
Replace the installed app with the packaged app, or copy it to
/Applications/Studio.app.Confirm the packaged plist contains the metadata as a comma-separated string:
/usr/libexec/PlistBuddy -c 'Print :MDItemKeywords' /Applications/Studio.app/Contents/Info.plistExpected output:
Expected output should include
WordPressinkMDItemKeywords.mdfind "kMDItemKeywords == '*WordPress*' && kMDItemContentType == 'com.apple.application-bundle'"Expected output should include:
WordPress; Studio should be discoverable.Local validation run on this branch:
npm run typecheck npx prettier --check apps/studio/forge.config.ts npx ts-node -e "import config from './apps/studio/forge.config'; const keywords = (config.packagerConfig as any).extendInfo?.MDItemKeywords; if (typeof keywords !== 'string' || !keywords.includes('WordPress')) process.exit(1); console.log(keywords);"Note:
npx eslint --fix apps/studio/forge.config.tscurrently fails becauseapps/studio/forge.config.tsis outside the repo's ESLint TypeScript project service configuration.Pre-merge Checklist