fix(core-app): restore localized app display name indexing on macOS#254
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds Spotlight-based display name reading for macOS apps (via Changes
Sequence DiagramsequenceDiagram
participant Test
participant Darwin
participant mdls as "mdls (System)"
participant AppProvider
participant Pinyin as "pinyin-pro"
Test->>Darwin: getAppInfo(appPath)
Darwin->>mdls: execFileSafe('mdls', ['-name','kMDItemDisplayName','-raw', appPath])
mdls-->>Darwin: spotlight displayName (raw)
Darwin->>Darwin: normalizeDisplayNameCandidate(spotlight)
Darwin-->>Test: appInfo(displayName chosen by priority)
Test->>AppProvider: _generateKeywordsForApp(appInfo)
AppProvider->>AppProvider: trim & dedupe names
AppProvider->>Pinyin: pinyin(displayName,{pattern:'full'}) / {pattern:'first'}
Pinyin-->>AppProvider: pinyinFull / pinyinFirst
AppProvider->>AppProvider: toLowerCase() pinyin results
AppProvider-->>Test: returned Set<keywords>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/core-app/src/main/modules/box-tool/addon/apps/darwin.ts`:
- Around line 234-242: The localized fallback returned by
getLocalizedDisplayName is used raw in the displayName selection and can contain
malformed values like "(null)" or include ".app"; fix this by passing
localizedName through normalizeDisplayNameCandidate before using it in the
selection expression so the priority becomes spotlightName ||
normalizeDisplayNameCandidate(localizedName) ||
normalizeDisplayNameCandidate(plistDisplayName) ||
normalizeDisplayNameCandidate(bundleName); update the assignment that builds
displayName (and any related logic that consumes localizedName) to use the
normalized value instead of the raw localizedName.
In `@docs/INDEX.md`:
- Line 3: The index contains inconsistent future dates (lines referenced as 3,
26-28, 82-87) and a mismatched snapshot label; update all date occurrences and
the snapshot label in docs/INDEX.md to the correct, consistent publish date (use
2026-04-21) so every instance (header date, snapshot line, and any repeated
footer/meta dates) matches exactly; search for the string "2026-04-22" and the
snapshot "2026-04-20" and replace them with "2026-04-21" to align all entries.
In `@docs/plan-prd/01-project/CHANGES.md`:
- Around line 3-6: Update the future-dated changelog entries in CHANGES.md by
replacing the date string "2026-04-22" (both the metadata line "更新时间:
2026-04-22" and the section header "## 2026-04-22") with the correct current
date (e.g., "2026-04-21") or a date consistent with the repository's timezone
policy so the "近 30 天" window and section header are not set in the future.
In `@docs/plan-prd/TODO.md`:
- Line 4: The document's update timestamp ("更新时间: 2026-04-22") was changed but
the stats block still shows the old stats timestamp ("统计时间: 2026-04-20"), so
recalculate and update the stats metadata to match the new update date: locate
the stats section by searching for the "统计时间: 2026-04-20" string and replace it
with the correct recalculated date and any derived counts or percentages so the
stats block is consistent with the "更新时间: 2026-04-22" entry.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f91eff81-3c00-4ea2-9bf4-8c44b10aa6b9
📒 Files selected for processing (7)
apps/core-app/src/main/modules/box-tool/addon/apps/app-provider.test.tsapps/core-app/src/main/modules/box-tool/addon/apps/app-provider.tsapps/core-app/src/main/modules/box-tool/addon/apps/darwin.test.tsapps/core-app/src/main/modules/box-tool/addon/apps/darwin.tsdocs/INDEX.mddocs/plan-prd/01-project/CHANGES.mddocs/plan-prd/TODO.md
Summary
Validation
pnpm -C "apps/core-app" exec vitest run "src/main/modules/box-tool/addon/apps/darwin.test.ts"pnpm -C "apps/core-app" exec vitest run "src/main/modules/box-tool/addon/apps/app-provider.test.ts"pnpm -C "apps/core-app" run typecheck:node(currently blocked by unrelated local AI module changes already present in the worktree, not by this diff)Notes
Summary by CodeRabbit
Bug Fixes
Tests
Documentation