fix: ordering hallucinations#362
Open
michalges wants to merge 4 commits into
Open
Conversation
|
Looks like you did not link an issue to this PR. If this PR completes a task, consider linking it. |
There was a problem hiding this comment.
Pull request overview
This PR addresses inconsistent (“hallucinated”) ordering in resource lists by ensuring list data is refreshed after reorder mutations and by preventing sorting/filtering UI from interfering with orderable resources. It also updates React Query and adjusts QueryClient initialization for SSR.
Changes:
- Add
onSuccesssupport to the order mutation hook and invalidate the list query after successful reorders. - Disable sort/filter definitions + UI for orderable resources to avoid conflicting ordering behavior.
- Update
@tanstack/react-queryto^5.101.0, adjust QueryClient lifecycle, and clear query cache on logout.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/features/abstract-resource-list/hooks/use-order-mutation.ts | Adds onSuccess option forwarding to the mutation wrapper. |
| src/features/abstract-resource-list/components/infinite-scroller.tsx | Introduces a shared queryKey and invalidates it after successful reorder. |
| src/features/abstract-resource-list/components/abstract-resource-list.tsx | Skips sort/filter setup + UI for orderable resources. |
| src/features/abstract-resource-form/components/arf-relation-input.tsx | Prevents orderable handling for many-to-many relations. |
| src/components/providers/root-providers.tsx | Refactors QueryClient creation for SSR/client, but uses a non-public React Query API. |
| src/components/presentation/logout-button.tsx | Clears React Query cache on logout during navigation. |
| package.json | Bumps @tanstack/react-query dependency version. |
| package-lock.json | Updates lockfile for new TanStack Query versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| import { ViewTransitions } from "@solvro/next-view-transitions"; | ||
| import { QueryClient } from "@tanstack/react-query"; | ||
| import { QueryClient, environmentManager } from "@tanstack/react-query"; |
Comment on lines
+24
to
+31
| function getQueryClient() { | ||
| if (environmentManager.isServer()) { | ||
| return makeQueryClient(); | ||
| } else { | ||
| browserQueryClient ??= makeQueryClient(); | ||
| return browserQueryClient; | ||
| } | ||
| } |
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.
No description provided.