Skip to content

chore: cache the last settled annotated guides in guide toolbar#965

Merged
thomaswhyyou merged 3 commits intomainfrom
thomas-kno-12730-flashing-issue-when-switching-guides-with-focus-button
Apr 17, 2026
Merged

chore: cache the last settled annotated guides in guide toolbar#965
thomaswhyyou merged 3 commits intomainfrom
thomas-kno-12730-flashing-issue-when-switching-guides-with-focus-button

Conversation

@thomaswhyyou
Copy link
Copy Markdown
Contributor

@thomaswhyyou thomaswhyyou commented Apr 17, 2026

Description

This aims to address the "flickers" seen with the query status dots when navigating or moving focus, by caching the annotated guides and only re-annotating (and re-rendering in toolbar bar) when the guide client's group state resolution settles. This allows the toolbar to skip re-rendering during a transient/interim state in the guide client.

Cache the last settled orderedGuides in useInspectGuideClientStore and
serve it while the guide client's group stage is transiently cleared or
re-opening. Without this, every row's status dots collapsed to undefined
(rendering as gray/"Not queried") during the ~50ms order resolution
window after Focus toggles, navigation, or other stage-clearing events.

The stage is treated as settled on "closed" and "patch" statuses (both
preserve stage.results), and transient on undefined or "open".
@linear
Copy link
Copy Markdown

linear Bot commented Apr 17, 2026

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 8d5fb38

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@knocklabs/react Patch
guide-example Patch
ms-teams-connect-example Patch
nextjs-app-dir-example Patch
nextjs-example Patch
slack-connect-example Patch
slack-kit-example Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

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

Project Deployment Actions Updated (UTC)
javascript-ms-teams-connect-example Ready Ready Preview, Comment Apr 17, 2026 9:00pm
javascript-nextjs-example Ready Ready Preview, Comment Apr 17, 2026 9:00pm
javascript-slack-connect-example Ready Ready Preview, Comment Apr 17, 2026 9:00pm
javascript-slack-kit-example Ready Ready Preview, Comment Apr 17, 2026 9:00pm

Request Review

Copy link
Copy Markdown
Contributor Author

thomaswhyyou commented Apr 17, 2026

@thomaswhyyou
Copy link
Copy Markdown
Contributor Author

@cursor review

@thomaswhyyou thomaswhyyou changed the title fix(guide): cache the last settled annotated guides in guide toolbar chore: cache the last settled annotated guides in guide toolbar Apr 17, 2026
Copy link
Copy Markdown

@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 878abf4. Configure here.

@thomaswhyyou thomaswhyyou marked this pull request as ready for review April 17, 2026 20:37
@thomaswhyyou thomaswhyyou requested review from a team, connorlindsey and meryldakin and removed request for a team April 17, 2026 20:37
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.04%. Comparing base (80ace40) to head (8d5fb38).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #965      +/-   ##
==========================================
+ Coverage   64.00%   64.04%   +0.04%     
==========================================
  Files         209      209              
  Lines       10074    10086      +12     
  Branches     1299     1304       +5     
==========================================
+ Hits         6448     6460      +12     
  Misses       3601     3601              
  Partials       25       25              
Files with missing lines Coverage Δ
...omponents/Toolbar/V2/useInspectGuideClientStore.ts 98.36% <100.00%> (+0.06%) ⬆️

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