Skip to content

enhance(website): Show the manager pipeline each action goes through in the Store inspector - #4445

Open
ntucker wants to merge 8 commits into
masterfrom
claude/project-thread-7fsrub
Open

ntucker wants to merge 8 commits into
masterfrom
claude/project-thread-7fsrub

Conversation

@ntucker

@ntucker ntucker commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Motivation

The playground's Store inspector logs every action, but it doesn't say who caused one. A custom manager can push data with controller.set, as a websocket StreamManager does, or swallow a SUBSCRIBE before it reaches SubscriptionManager. The log shows neither, so readers learning about managers can't watch the chain at work.

Solution

Manager attribution is added to the existing action log. There is still one log, recorded by the preview's recorder. The public Manager API doesn't change.

  • origin: each user manager is wrapped (store/attribution.ts), and its controller is proxied. Anything it dispatches through set, fetch, dispatch and the like is credited to it. A nested dispatch is credited to whoever made the call.
  • consumedBy: when a middleware returns without calling next, that manager is marked as having handled the action. Async middleware is checked after its promise settles.
    • A copy passed on in the action's place (next({...action})) counts as passing it on.
    • Whoever handles the copy is credited on the recorded entry.
    • An action held back and passed on later loses the mark.
  • Library managers are recognised by class (instanceof), so minified production names still read NetworkManager.
  • DevToolsManager hands its controller to the console, so calls made through it aren't credited to it.

Store panel. A manager isn't state: it's a stage every dispatch passes between the app and the store. So it shows on the Action side.

  • Pipeline strip over the Store's action list. It reads: the app → each manager in chain order → store. Each stage shows how many actions it sent and how many it handled (⊘). Picking a stage shows only its actions. The strip wraps on phones.
  • Path in each action's detail: who sent it, the manager that handled it, the managers after that one (dimmed, since they never saw it), and whether it reached the store.
  • Row chips: ↑ StreamManager and ⊘ handled by StreamManager on rows, for the code's own managers.
  • The strip and the path appear only when the code brings a manager of its own. With only the defaults, the detail says sentBy / handledBy in words.

Tests

website/src/components/Playground/preview/__tests__/managerAttribution.test.tsx covers:

  • origin
  • consumedBy: sync, async, copies (two deep), held and passed later, extra actions passed besides
  • naming
  • DevTools
  • the pipeline UI: counts, picking a stage, the path

The Playground suite passes (377 tests). Desktop and phone screenshots are in the project thread.

🤖 Generated with Claude Code

https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM


Note

Low Risk
Playground Store inspector and internal logging/UI only; no changes to core @data-client/react manager behavior in app code paths.

Overview
The playground Store inspector now records who dispatched each action (origin) and which manager swallowed it (consumedBy) by wrapping user managers via log.track() in attribution.ts (controller proxy + middleware hooks), without changing the public Manager API.

UI: When playground code adds custom managers, the Actions tab shows a pipeline (app → managers → store) with send/handle counts and stage filtering; action rows get ↑ / ⊘ chips for custom managers; action detail shows an ActionPath through the chain. Default-only chains keep text sentBy / handledBy fields and hide the pipeline.

Log: actionLog.connect() gains track, patch for late attribution updates, and copy-tracking for next({...action}) edge cases. stageFilter and updated unapplied-action copy reflect attribution.

Tests: New managerAttribution.test.tsx covers attribution rules and pipeline UI.

Reviewed by Cursor Bugbot for commit 8cdcb2a. Bugbot is set up for automated code reviews on this repo. Configure here.

…d action

The Store inspector's action log now tags each entry with the manager that
dispatched it through its controller (origin) and the manager whose
middleware handled it without passing it on (consumedBy), and each history
records its chain of manager names. No UI yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM
…he Store inspector

Action rows tag the code's own managers (↑ StreamManager, ⊘ handled by
StreamManager); an action's detail lists sentBy and handledBy. The State
tab gets a Managers section: the chain in order with what each manager sent
and handled up to the moment, and a row opens that manager's actions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM
@ntucker ntucker self-assigned this Oct 21, 2026
@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8cdcb2a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.37%. Comparing base (bb0dda6) to head (8cdcb2a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4445   +/-   ##
=======================================
  Coverage   98.37%   98.37%           
=======================================
  Files         161      161           
  Lines        3073     3073           
  Branches      604      604           
=======================================
  Hits         3023     3023           
  Misses         10       10           
  Partials       40       40           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview: https://docs-site-pr-4445-data-client.vercel.app

Built from 8cdcb2a merged into master (this build). English only: this PR doesn't touch translations.

…nd credit copies

A manager's view now lists the actions it kept from the store, not only
those that changed it. When a middleware passes on a copy, whoever handles
the copy is credited on the recorded action, and the store's change is
recorded on it too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM
@ntucker
ntucker marked this pull request as ready for review October 21, 2026 04:13
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-21T04:13:26.178720Z
We couldn’t complete this review. Comment @codex review to try again.
2343407 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…s copy

A middleware that passes on its action and then another one no longer
records the second on the first's entry. Copy links can't loop.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM

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

Stale Bugbot comment from a previous run.

Comment thread website/src/components/Playground/preview/store/RootView.tsx Outdated
…n the Action side

A manager isn't state: it's a stage every dispatch passes between the app
and the store. The State tab's Managers section and manager view give way
to a pipeline strip over the Store's actions (the app, each manager in
order, the store, with what each sent and kept; picking one shows only its
actions) and each action's path through it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM
@ntucker ntucker changed the title enhance(website): Show which manager sent or handled each action in the Store inspector enhance(website): Show the manager pipeline each action goes through in the Store inspector Oct 21, 2026

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0ccfb98. Configure here.

Comment thread website/src/components/Playground/preview/store/actionGroups.ts Outdated
With nothing picked, the Store's actions still list every step (a fetch the
network handled included). A picked stage the chain no longer has is let go.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM
…as they do

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013oVRifbiMMFhcDHM5wYAkM

This branch was successfully deployed

1 active deployment
docs-preview — 8cdcb2aa Deployed Oct 21, 2026 by ntucker via docs deploy #3744
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.

2 participants