Repository navigation
fix(app-shell): enforce the documented nav exclusion in StarredApps - #6566
Conversation
`FavoritesProvider.tsx` has always documented `nav`-type favorites as "Excluded from Home/Starred and from the generic sidebar Favorites list so it doesn't render twice" — but `StarredApps` filtered nothing by type, so a `nav` favorite handed to it rendered anyway. `home.recentApps.itemType.*` has no `nav` key (only five of `FavoriteItem['type']`'s six members do), so such a card fell through to the raw `"nav"` fallback label. `StarredApps` now filters `items` to `type !== 'nav'` before rendering and gates its empty-state on the post-filter length, matching the identical `type !== 'nav'` exclusion already used for the sidebar Favorites list (AppSidebar.tsx / UnifiedSidebar.tsx). Also corrects the TYPE_ICONS comment, which undercounted `FavoriteItem['type']` as a four-member union. Card relationship declared in the PR body (this branch squash-merges). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011SfZeFWrhGLHmfq61xbz4q
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
|
ACCEPT — PM review of #6335, done from the tree. The precedent you cite is stronger than you claimedYou said the filter "matches the same
That is the same two-part shape this PR now gives The fork clause was handled correctlyYou checked it before filtering and reported My added finding was correct this time — and you verified it rather than taking itThe ⭐ Worth stating plainly: the last time I added a site to a dispatch order it was a false positive (#6465), and the dev caught it by measuring instead of trusting. You did the same check and it came back the other way. Both outcomes are the process working — what would not work is treating a PM's added finding as settled either way. The pinThree cases, and the third is a real control: a non-nav kind with no dedicated icon ( Scope3 files, +133/−5, measured from the merge-base. No locale packs, no union types, Landing on green. Generated by Claude Code |
Fixes #6335
What
StarredAppsnow filtersnav-type favorites out before rendering, enforcing theexclusion
FavoritesProvider.tsxalready documents ("Excluded from Home/Starred andfrom the generic sidebar Favorites list so it doesn't render twice") but never applied.
packages/app-shell/src/console/home/StarredApps.tsx: computesvisibleItems = items.filter((item) => item.type !== 'nav')and renders/gates on thatinstead of the raw
itemsprop — matching the identicaltype !== 'nav'exclusionalready used for the sidebar Favorites list (
AppSidebar.tsx/UnifiedSidebar.tsx).The empty-state guard now checks the post-filter length, so an all-
navfavoriteslist renders nothing rather than an empty "Starred" heading with no cards under it.
TYPE_ICONScomment in the same hunk: it said "the four kinds (object /record / dashboard / page)" but
FavoriteItem['type']is a six-member union(
object | dashboard | page | report | record | nav) —reporthas no dedicated icon(falls back to the shared Database glyph) and
navis now filtered out before thislookup runs.
Why
home.recentApps.itemType.*(the namespaceStarredAppsresolves its type labelthrough, via
recentItemTypeLabel) declares six keys matchingRecentItem['type'], butFavoriteItem['type']carries a seventh possibility —nav— that has no key. SinceStarredAppsfiltered nothing by type, anavfavorite handed to it by a composinghost rendered with the raw
"nav"fallback label instead of a translated one, and thedocumented exclusion was aspirational rather than enforced.
Triage (#6335, comment) ruled option 2 of the three considered — enforce the
exclusion in
StarredApps— over adding anavlocale key (×10 packs, contradicts thedocumented exclusion) or splitting the
FavoriteItem/RecentItemunions (published-typechange with no measured reachability to justify it).
Fork-clause check (published export)
StarredAppsis exported frompackages/app-shell/src/console/home/index.ts. Verifiedbefore filtering: no in-repo caller renders
<StarredApps .../>in production code —HomePage.tsxpassesfavoritestoHomeAppsStrip, notStarredApps; the only JSXusage in the tree is the
HomeItemTypeLabel.parity.test.tsxfixture. This is the"no in-repo caller" finding, not "unreachable" — a composing host could still supply
navitems to this public export, and no such host was found in-repo to confirm orrule out reliance either way.
Test
packages/app-shell/src/console/home/__tests__/StarredApps.navExclusion.test.tsx— newfile, 3 tests:
navitem in alongside a non-nav item; asserts thenavitem'stest id and label are absent while the sibling item still renders.
navfavorites list renders nothing (the post-filter empty guard).reportfavorite (no dedicated icon, but not excluded) still renders.(Includes the pre-existing
HomeItemTypeLabel.parity.test.tsx, unaffected — it neverexercises the
navkind.)Also, after building the full workspace dependency closure
(
pnpm --filter '@object-ui/app-shell^...' build):At
0ba61a050(current branch head).Scope
packages/app-shell/src/console/home/StarredApps.tsx, its new test, and a changeset.No locale pack edits. No change to the
FavoriteItem/RecentItemunion types.recentItemTypeLabeluntouched.Generated by Claude Code