Skip to content

fix(tracemetrics): Resolve all equations at once when subcomponents update#113117

Open
narsaynorath wants to merge 2 commits intomasterfrom
nar/fix/tracemetrics-resync-all-metric-queries-on-change
Open

fix(tracemetrics): Resolve all equations at once when subcomponents update#113117
narsaynorath wants to merge 2 commits intomasterfrom
nar/fix/tracemetrics-resync-all-metric-queries-on-change

Conversation

@narsaynorath
Copy link
Copy Markdown
Member

@narsaynorath narsaynorath commented Apr 15, 2026

Pretend you have equations A + 1, and 1 / A, the previous code was only updating 1 / A in response to A changing because each equation (i.e. ƒ1, ƒ2) was triggering its own navigate which would clobber previous updates, so ƒ1 would fire and cue up a navigate to update the equation, then ƒ2 would fire and cue up its own navigate, and when they were processed, only ƒ2 was shown to be updated (since the URL is parsed to determine the metric queries and the URL now only contained new ƒ2 state)

This PR adds in a sync functionality that batches up all of the metric query changes and dispatches a single navigate call. I had to extract some methods out into helpers to do this, which explains some of the larger diff. equationBuilder.tsx was essentially renamed and nested under a folder so I could colocate utils from the old file.

It removes the reference syncing responsibility from the equation builder and pushes it to the points where updates to metric queries happens. The effect of this is that we can update things in one go instead of as a side effect of something else changing.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 15, 2026
@narsaynorath
Copy link
Copy Markdown
Member Author

@cursor review

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 042c595. Configure here.

@narsaynorath narsaynorath marked this pull request as ready for review April 15, 2026 21:27
@narsaynorath narsaynorath requested a review from a team as a code owner April 15, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant