Repository navigation
fix(builder): re-enable Preview after patient-column changes - #28
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f742742098
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const executePreview = useCallback( | ||
| async (request: PreviewRequest, receiptId: string) => { | ||
| const generation = ++previewGeneration.current; | ||
| activePreview.current?.abort(); |
There was a problem hiding this comment.
Keep loading state tied to the replacement preview
When a user changes the row limit while a preview is in flight, the enabled selector calls preview(limit) and reaches this abort immediately before starting the replacement request. The custom useMutation uses one boolean and sets it to false whenever any invocation settles (react.tsx lines 141–146), so the aborted request's asynchronous rejection clears previewStatus.isLoading after the replacement has set it to true. The toolbar therefore becomes enabled while the new preview is still running, recreating the incorrect busy state and allowing additional edits or previews; track loading by request identity/count, or disable limit changes while busy.
Useful? React with 👍 / 👎.
Why
Changing a patient column while Preview was in flight left the old preview request loading. The toolbar derives its busy state from that request, so Preview could remain disabled after the column command completed. Stale preview recovery could also resume after the edit and start more work.
Changing the row limit exposed a related overlap bug in the shared mutation hook. Settlement of the aborted preview cleared its single loading boolean while the replacement preview was still active.
Scope
Blast Radius
Preview request ownership remains local to Explorer Builder. The shared mutation hook now reports aggregate loading across concurrent calls, which is the intended contract for all mutation consumers. Preview eligibility rules, compile ownership, and command serialization remain intact.
Verification
npm testinui: 19 files passed, 98 tests passednpm run buildinui: production package and demo builds passed