Skip to content

Scope app project view refreshes - #328

Merged
TraderSamwise merged 4 commits into
masterfrom
chore/core-sidecar-next-53
Jul 6, 2026
Merged

Scope app project view refreshes#328
TraderSamwise merged 4 commits into
masterfrom
chore/core-sidecar-next-53

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the app-wide project API refresh nonce with per-view refresh atoms
  • route project_update SSE payloads to only the affected app screens
  • scope manual mutation refreshes to the semantic views they affect

Verification

  • yarn --cwd app test stores/projectViews.test.ts
  • yarn --cwd app typecheck
  • yarn --cwd app test
  • yarn --cwd app lint
  • yarn typecheck
  • yarn lint
  • yarn build
  • yarn vitest

Summary by CodeRabbit

  • New Features

    • Improved real-time updates across key areas of the app, including threads, tasks, services, team, worktrees, topology, library, and coordination views.
    • Actions now refresh only the relevant sections of the app after changes complete.
  • Bug Fixes

    • Fixed refresh behavior so updates are more consistent and less likely to miss affected screens.
    • Improved handling of view-specific changes to keep displayed data current.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 6, 2026 4:53am

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 304bdffd-772a-4eed-ad57-f86b0c7e79e0

📥 Commits

Reviewing files that changed from the base of the PR and between a8e725e and 2bfea19.

📒 Files selected for processing (4)
  • app/app/(main)/(tabs)/(dashboard)/graveyard.tsx
  • app/components/agent-actions.tsx
  • app/stores/projectViews.test.ts
  • app/stores/projectViews.ts
📝 Walkthrough

Walkthrough

The project view refresh mechanism moves from a single global nonce atom to a per-view atomFamily, allowing refresh triggers to target specific views. Screens now read view-scoped nonces, and action handlers across agent, service, teammate, workflow, and worktree components pass explicit view lists to refresh functions instead of refreshing all views.

Changes

View-scoped project refresh nonces

Layer / File(s) Summary
Nonce store and refresh helpers
app/stores/projectViews.ts, app/stores/projectViews.test.ts
Replaces single projectApiViewRefreshNonceAtom with projectApiViewRefreshNonceFamily, adds projectApiViewsForRefresh and isProjectApiView helpers, updates kickProjectApiViewRefreshAtom to accept an optional views list, with new tests covering de-duplication and full-refresh fallback.
Screens consume per-view nonces
app/app/(main)/(tabs)/(threads)/threads.tsx, .../coordination/index.tsx, .../library/index.tsx, .../project/index.tsx, .../topology/index.tsx, app/components/teammate-panel.tsx
Screens read view-keyed nonces ("threads", "coordination-worklist", "library", "project-observability"/"tasks", "topology", "team") via the atom family and update useEffect dependencies accordingly.
Action handlers target specific views
app/app/(main)/_layout.tsx, app/components/agent-actions.tsx, agent-create-panel.tsx, agent-management-panel.tsx, service-actions.tsx, teammate-panel.tsx, workflow-actions.tsx, worktree-management-panel.tsx
Refresh calls after successful actions/events now pass explicit view/key arrays (e.g., agents, topology, coordination-worklist, tasks, threads, services, worktrees) instead of invoking refresh with no arguments.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • TraderSamwise/aimux#247: Both PRs modify projectUpdate-driven refresh wiring in app/app/(main)/_layout.tsx building on app/stores/projectViews.ts.
  • TraderSamwise/aimux#251: Both PRs change how workflow-actions.tsx triggers refresh, moving from generic to view-/key-scoped refresh targets.
  • TraderSamwise/aimux#263: Both PRs modify the Threads screen's refresh trigger flow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: scoping app project view refreshes to specific views.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/core-sidecar-next-53

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

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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.

🧹 Nitpick comments (1)
app/components/agent-actions.tsx (1)

59-67: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

graveyard is refreshed even for non-kill actions.

The same view list is used for stop/resume/fork/kill, but only kill semantically affects graveyard. This mirrors magic-string duplication also present in agent-create-panel.tsx and agent-management-panel.tsx. Consider centralizing action→views mappings (e.g. in projectViews.ts) so each call site references a shared constant instead of repeating similar literal arrays, and vary the list by opts?.isKill if graveyard should only apply there.

♻️ Example scoping by action
-        kickProjectViewRefresh([
-          "agents",
-          "project-observability",
-          "topology",
-          "coordination-worklist",
-          "graveyard",
-          "team",
-          "worktrees",
-        ]);
+        kickProjectViewRefresh(
+          opts?.isKill
+            ? AGENT_ACTION_REFRESH_VIEWS_WITH_GRAVEYARD
+            : AGENT_ACTION_REFRESH_VIEWS,
+        );
🤖 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 `@app/components/agent-actions.tsx` around lines 59 - 67, The shared view
refresh list in agent-actions.tsx is incorrectly including graveyard for every
action, even when the action is not a kill. Update the logic around the action
handler in agent-actions.tsx so the views passed to kickProjectViewRefresh vary
by opts?.isKill, and only include graveyard for kill actions. If possible,
centralize the action-to-views mapping in a shared constant or helper such as
projectViews.ts, then update the similar literal arrays in
agent-create-panel.tsx and agent-management-panel.tsx to use that shared source
instead of duplicating the 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.

Nitpick comments:
In `@app/components/agent-actions.tsx`:
- Around line 59-67: The shared view refresh list in agent-actions.tsx is
incorrectly including graveyard for every action, even when the action is not a
kill. Update the logic around the action handler in agent-actions.tsx so the
views passed to kickProjectViewRefresh vary by opts?.isKill, and only include
graveyard for kill actions. If possible, centralize the action-to-views mapping
in a shared constant or helper such as projectViews.ts, then update the similar
literal arrays in agent-create-panel.tsx and agent-management-panel.tsx to use
that shared source instead of duplicating the list.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a2adf771-47be-49fa-97ee-b3a0c47325e0

📥 Commits

Reviewing files that changed from the base of the PR and between 828d0d1 and a8e725e.

📒 Files selected for processing (15)
  • app/app/(main)/(tabs)/(threads)/threads.tsx
  • app/app/(main)/(tabs)/coordination/index.tsx
  • app/app/(main)/(tabs)/library/index.tsx
  • app/app/(main)/(tabs)/project/index.tsx
  • app/app/(main)/(tabs)/topology/index.tsx
  • app/app/(main)/_layout.tsx
  • app/components/agent-actions.tsx
  • app/components/agent-create-panel.tsx
  • app/components/agent-management-panel.tsx
  • app/components/service-actions.tsx
  • app/components/teammate-panel.tsx
  • app/components/workflow-actions.tsx
  • app/components/worktree-management-panel.tsx
  • app/stores/projectViews.test.ts
  • app/stores/projectViews.ts

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@TraderSamwise
TraderSamwise merged commit 6162725 into master Jul 6, 2026
3 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