feat: better empty-state and loading bug#29
Conversation
✅ Deploy Preview for pno-project-y ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR adds a ChangesGit task summary and UI coherency
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/db/mutations/git.ts (1)
845-851: ⚡ Quick winConsider returning
Promise<void>for consistency.This helper uses
voidto fire-and-forget both invalidations, whileinvalidatePrReviewQueries(line 979) returnsPromise.all([...])and is awaited by all callers. For consistency and to ensure cache invalidations complete before mutations resolve, consider:♻️ Align invalidation pattern with invalidatePrReviewQueries
-function invalidateGitTaskBoardState( +async function invalidateGitTaskBoardState( queryClient: ReturnType<typeof useQueryClient>, taskId: string ) { - void queryClient.invalidateQueries({ queryKey: ["git", "task", taskId] }); - void queryClient.invalidateQueries({ queryKey: ["git", "summaries"] }); + await Promise.all([ + queryClient.invalidateQueries({ queryKey: ["git", "task", taskId] }), + queryClient.invalidateQueries({ queryKey: ["git", "summaries"] }), + ]); }Then update all call sites (lines 872, 885, 898, 910, 922) to await:
- invalidateGitTaskBoardState(queryClient, input.taskId); + await invalidateGitTaskBoardState(queryClient, input.taskId);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/db/mutations/git.ts` around lines 845 - 851, The helper invalidateGitTaskBoardState currently fire-and-forgets two queryClient.invalidateQueries calls; change it to return a Promise<void> by returning Promise.all([...]) of the two queryClient.invalidateQueries calls (use the same pattern as invalidatePrReviewQueries) so callers can await completion; then update all places that call invalidateGitTaskBoardState to await the returned promise (i.e., replace fire-and-forget calls with await invalidateGitTaskBoardState(useQueryClient(), taskId) where used).src/components/git/TaskDevelopmentEmptyState.tsx (1)
156-164: ⚡ Quick winUse index as key for better stability.
The
step.titleis currently used as the key when mapping over steps. While titles are currently unique, using the index would be more stable and follow React best practices for static lists with fixed ordering.♻️ Proposed fix
- <ol className="space-y-3"> - {steps.map((step, index) => ( + <ol className="space-y-3"> + {steps.map((step, index) => ( <SetupStepRow - key={step.title} + key={index} step={step} stepNumber={index + 1} /> ))} </ol>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/git/TaskDevelopmentEmptyState.tsx` around lines 156 - 164, Replace the dynamic key currently using step.title in the steps.map render with the array index for stability: in the map where SetupStepRow is returned (the mapping over steps that passes step and stepNumber), change key={step.title} to key={index} (or key={`step-${index}`}) so the component uses the index as the stable key for this static, fixed-order list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/git/TaskPullRequestReviewFeed.tsx`:
- Around line 162-168: The variant selection currently treats undefined
gitContext as "no_pr"; update the conditional passed to
TaskPullRequestReviewEmptyState so that missing/undefined gitContext is treated
as "no_setup". Specifically, change the variant expression from (gitContext &&
gitContext.projectRepos.length === 0 ? "no_setup" : "no_pr") to check for falsy
gitContext first—e.g. (!gitContext || gitContext.projectRepos.length === 0 ?
"no_setup" : "no_pr")—so TaskPullRequestReviewEmptyState shows "no_setup" when
gitContext is undefined and "no_pr" only when gitContext exists but has repos.
---
Nitpick comments:
In `@src/components/git/TaskDevelopmentEmptyState.tsx`:
- Around line 156-164: Replace the dynamic key currently using step.title in the
steps.map render with the array index for stability: in the map where
SetupStepRow is returned (the mapping over steps that passes step and
stepNumber), change key={step.title} to key={index} (or key={`step-${index}`})
so the component uses the index as the stable key for this static, fixed-order
list.
In `@src/db/mutations/git.ts`:
- Around line 845-851: The helper invalidateGitTaskBoardState currently
fire-and-forgets two queryClient.invalidateQueries calls; change it to return a
Promise<void> by returning Promise.all([...]) of the two
queryClient.invalidateQueries calls (use the same pattern as
invalidatePrReviewQueries) so callers can await completion; then update all
places that call invalidateGitTaskBoardState to await the returned promise
(i.e., replace fire-and-forget calls with await
invalidateGitTaskBoardState(useQueryClient(), taskId) where used).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 74adfd76-4f9e-46f3-b15c-04d351ced4e6
📒 Files selected for processing (8)
src/components/TaskCard.tsxsrc/components/git/TaskDevelopmentEmptyState.tsxsrc/components/git/TaskDevelopmentSection.tsxsrc/components/git/TaskPullRequestReviewFeed.tsxsrc/components/views/BoardView.tsxsrc/db/mutations/git.tssrc/db/queries/git.server.tssrc/hooks/use-git-task-live-sync.ts
Summary by CodeRabbit
New Features
Bug Fixes
Improvements