Skip to content

feat: better empty-state and loading bug#29

Merged
kaesetoast merged 2 commits into
mainfrom
py-28-ein-status-sollte-als-abschlie-end-marki
May 30, 2026
Merged

feat: better empty-state and loading bug#29
kaesetoast merged 2 commits into
mainfrom
py-28-ein-status-sollte-als-abschlie-end-marki

Conversation

@kaesetoast

@kaesetoast kaesetoast commented May 30, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Git PR indicator now reflects any linked PR and shows state-aware labels.
    • New Git-related empty states with guided setup, repo linking, and “start development” actions.
  • Bug Fixes

    • Consistent Git PR display on board drag overlays.
  • Improvements

    • Pull request tracking expanded to detect all linked PRs.
    • Live updates now refresh Git summary info after PR or setup actions.

Review Change Stack

@netlify

netlify Bot commented May 30, 2026

Copy link
Copy Markdown

Deploy Preview for pno-project-y ready!

Name Link
🔨 Latest commit ffe42dc
🔍 Latest deploy log https://app.netlify.com/projects/pno-project-y/deploys/6a1ad3cc7a28770008012079
😎 Deploy Preview https://deploy-preview-29--pno-project-y.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c9dad898-4254-4d2c-b40e-6e2fad8c7b5b

📥 Commits

Reviewing files that changed from the base of the PR and between ac8011b and ffe42dc.

📒 Files selected for processing (3)
  • src/components/git/TaskDevelopmentEmptyState.tsx
  • src/components/git/TaskPullRequestReviewFeed.tsx
  • src/db/mutations/git.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/components/git/TaskPullRequestReviewFeed.tsx
  • src/components/git/TaskDevelopmentEmptyState.tsx
  • src/db/mutations/git.ts

📝 Walkthrough

Walkthrough

This PR adds a hasPr boolean to task Git summaries, centralizes React Query invalidation to refresh both per-task and global git summaries, introduces TaskDevelopmentEmptyState and TaskPullRequestReviewEmptyState, and integrates these components plus summary propagation into task UI surfaces.

Changes

Git task summary and UI coherency

Layer / File(s) Summary
Git task data contract and query updates
src/db/queries/git.server.ts
TaskGitSummary adds a hasPr: boolean field computed from the presence of any pull requests for each task in getTaskGitSummariesForTasks.
React Query cache invalidation refactoring and live-sync
src/db/mutations/git.ts, src/hooks/use-git-task-live-sync.ts
New invalidateGitTaskBoardState helper centralizes invalidation of both per-task (["git","task", taskId]) and global (["git","summaries"]) queries. Multiple mutation hooks and PR-review invalidation now use this helper; live-sync invalidates summaries alongside task-scoped queries.
PR indicator rendering in TaskCard
src/components/TaskCard.tsx
PR icon now renders based on gitSummary?.hasPr, applies "primary" vs "muted" styling based on gitSummary.hasOpenPr, and includes a dynamic aria-label using gitSummary.prState when present.
Empty-state components for Git workflows
src/components/git/TaskDevelopmentEmptyState.tsx
New components: TaskDevelopmentEmptyState (renders setup checklist for "no_repo" or "not_started" phases with integration/link buttons or custom actions) and TaskPullRequestReviewEmptyState (shows contextual messaging for "no_setup" or "no_pr" variants).
Integration of empty states and consistent summary propagation
src/components/git/TaskDevelopmentSection.tsx, src/components/git/TaskPullRequestReviewFeed.tsx, src/components/views/BoardView.tsx
TaskDevelopmentSection renders TaskDevelopmentEmptyState with a startDevelopmentActions fragment (repo selector + "Start development" async button that copies checkout command); TaskPullRequestReviewFeed uses TaskPullRequestReviewEmptyState for no-PR/no-setup branches; BoardView passes gitSummary to the drag-overlay TaskCard.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • pnodev/project-y#27: Both PRs modify src/components/git/TaskPullRequestReviewFeed.tsx to improve PR review feed UI and empty-state behavior.

Poem

🐰 I nibble lines of code at dawn,
Syncing summaries before the yawn—
Empty states bloom, actions in tow,
PR lights glow where checkouts go.
Hoppity fixes, neat and drawn.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feat: better empty-state and loading bug' is vague and doesn't clearly summarize the main changes. The PR involves multiple specific improvements (new empty-state components, git summary updates, drag overlay fixes) but the title uses imprecise language like 'better' and 'loading bug' without conveying what is actually being improved. Consider a more specific title that captures the main change, such as 'feat: add git empty-state components and improve PR indicator' or 'feat: add TaskDevelopmentEmptyState and TaskPullRequestReviewEmptyState components'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch py-28-ein-status-sollte-als-abschlie-end-marki

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/db/mutations/git.ts (1)

845-851: ⚡ Quick win

Consider returning Promise<void> for consistency.

This helper uses void to fire-and-forget both invalidations, while invalidatePrReviewQueries (line 979) returns Promise.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 win

Use index as key for better stability.

The step.title is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 783d627 and ac8011b.

📒 Files selected for processing (8)
  • src/components/TaskCard.tsx
  • src/components/git/TaskDevelopmentEmptyState.tsx
  • src/components/git/TaskDevelopmentSection.tsx
  • src/components/git/TaskPullRequestReviewFeed.tsx
  • src/components/views/BoardView.tsx
  • src/db/mutations/git.ts
  • src/db/queries/git.server.ts
  • src/hooks/use-git-task-live-sync.ts

Comment thread src/components/git/TaskPullRequestReviewFeed.tsx
@kaesetoast kaesetoast merged commit 072c2fd into main May 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant