Uh oh!
There was an error while loading. Please reload this page.
fix(app-shell): resolve short view names in /view/<name> routes - #2218
Merged
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Nav items emit `viewName` verbatim (usually the short form, e.g. `tabular`) while canonical view ids are fully qualified (`showcase_task.tabular`), so nav-generated view links always fell back to the default view — silently. ObjectView now resolves the requested name in both directions (short -> qualified, and qualified -> bare key for legacy embedded listViews incl. the 'all' fallback), and warns with the known view ids when nothing matches instead of swallowing the miss. Fixes#2217 Co-Authored-By: Claude <noreply@anthropic.com>
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 freeto 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.
Fixes#2217
Problem
A nav item with
viewName: 'tabular'produces the route/view/tabular, but canonical view ids are fully qualified (showcase_task.tabular), soObjectView's exact-id lookup missed and|| views[0]silently rendered the default view. Every nav-generated view link was broken, with zero signal.packages/layout/src/NavigationRenderer.tsx(object nav href) andpackages/layout/src/AppSchemaRenderer.tsx(mobile bottom nav).packages/app-shell/src/views/ObjectView.tsx.Fix
New
resolveViewId()util resolves the URL-requested name (route param or?view=) in both directions:.) →<objectName>.<name>— covers nav-generated links;<objectName>.prefix stripped — covers legacy embedded listViews (incl. the'all'fallback view).When nothing matches, a
console.warnlists the known view ids before falling back — no more silent swallowing. The generators are intentionally left untouched: they can't see the target object's view list, so the resolver is the only place that can pick the right form for both id schemes.Testing
resolveViewId(exact / qualify / strip / miss / empty / no double-qualify) — all pass.pnpm --filter @object-ui/app-shell... buildpasses.app-showcasebackend (HMR console):/view/tabular(nav short name) now renders the Task List (tabular) view — pre-fix it rendered the default grid;/view/showcase_task.tabularstill works;/view/nonexistent_viewfalls back to the default view and warns with the full known-view list.🤖 Generated with Claude Code