Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The ObjectStack runtime protocol strips listViews from object metadata during Zod validation in defineStack(). The MSW handlers now re-attach listViews from the pre-defineStack sharedConfig so the console can resolve named views (calendar, kanban, etc.) for each object. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…dlers.ts Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix calendar view to display events instead of list
fix: re-attach listViews to object metadata stripped by defineStack() Zod parse
Feb 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes MSW mock metadata so the console receives listViews for objects (which are stripped by defineStack()’s Zod parse), allowing routes like /apps/crm_app/event/view/calendar to render the calendar view instead of falling back to the default grid.
Changes:
- Extend the MSW handler factory to accept the original (pre-
defineStack) stack config and enrich object metadata responses withlistViews. - Update MSW browser/server setup to import and pass the named
sharedConfig(raw config) intocreateHandlers. - Add a small enrichment helper + lookup (
listViewsByObject) so/meta/*endpoints return objects withlistViews.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/console/src/mocks/handlers.ts | Adds config-driven enrichment of object metadata (listViews) for meta endpoints. |
| apps/console/src/mocks/browser.ts | Passes sharedConfig into MSW handlers in browser mode so list views are preserved. |
| apps/console/src/mocks/server.ts | Passes sharedConfig into MSW handlers in node/test mode so list views are preserved. |
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.
Calendar view at
/apps/crm_app/event/view/calendarrenders as a grid table instead of the calendar component. The console receives objects withoutlistViewsfrom the API, soObjectViewfalls back to a single default grid view.Root cause
defineStack()validates config viaObjectStackDefinitionSchema.safeParse(). The spec'sObjectSchemadoes not includelistViews(views live at stack level inViewSchema), so Zod strips them.mergeViewsIntoObjects()inobjectstack.shared.tscorrectly merges views into objects, but the default export passes throughdefineStack()which discards them.Changes
handlers.ts—createHandlersaccepts optionalStackConfigparam; builds alistViewsByObjectlookup and enriches/meta/objectresponses viaenrichObject()helperbrowser.ts/server.ts— Import namedsharedConfig(pre-defineStack, listViews intact) and pass tocreateHandlersBefore:

After:

Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.