-
Notifications
You must be signed in to change notification settings - Fork 48
Refactor: Templates api layer to trpc #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| ...(templatesData?.templates ?? []), | ||
| ], | ||
| [templatesData, defaultTemplatesData] | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Template display order reversed
The templates array now places default templates before team templates, reversing the original order where team templates appeared first. Since there's no default sorting applied, this changes the display order in the UI. The original code had team templates first, then default templates.
Note
Move Templates from server actions to tRPC (queries/mutations) with React Query, add prefetch/hydration, and refine telemetry and prefetch utilities.
templatesRouterwithgetTemplates,getDefaultTemplatesCached,updateTemplate,deleteTemplate; register intrpcAppRouter.TemplatesTableand cells to useuseTRPC+useSuspenseQuery/useMutationwith optimistic updates and error toasts; remove server actions and old fetching modules.HydrateClient+SuspensewithLoadingLayoutand client-sideErrorBoundaryhandling.prefetch(...)and keepprefetchAsync(...); update Sandboxes/Templates pages to use non-awaitedprefetch.causeexists); tweak success log message.server/templates/*, templates routeloading.tsx).Written by Cursor Bugbot for commit bb321c8. This will update automatically on new commits. Configure here.