refactor(console-ai): type metadataApps, drop per-access _packageId casts#2488
Merged
Conversation
…asts
The AI chat switcher/bound-package derivations cast `(app as { _packageId?: string })`
at every access (4 sites). Narrow `useMetadata().apps` once to a local
MetadataAppItem shape at the hook boundary; call sites now read .name / .label /
._packageId without casts. Type-only, no runtime change.
Refs #2487 (A1).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch A1 from the optimization tracking issue #2487 (review #2478).
Change
The AI chat switcher + bound-package derivations cast
(app as { _packageId?: string })at every access (4 sites). This narrowsuseMetadata().appsonce to a localMetadataAppItemshape at the hook boundary; call sites now read.name/.label/._packageIdwithout casts.Type-only, no runtime change.
labelis typed asParameters<typeof resolveI18nLabel>[0]so it stays compatible.Tests
Helper suites green (
deriveBoundPackageId,editModeEmptyState— 16);tsc --noEmitclean.🤖 Generated with Claude Code