Skip to content

Conversation

@ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Nov 28, 2025

What I did

  • Changed telemetry event structure for checklist updates
  • Remove the need to complete renderComponent before doing other things

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Improvements
    • Updated onboarding checklist item label to "Render your first component" for improved clarity.
    • Removed prerequisite constraints between checklist items, allowing more flexible ordering during the onboarding process.
    • Enhanced telemetry tracking to separately monitor checklist state changes and item status updates for better usage insights.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

📝 Walkthrough

Walkthrough

The changes refactor checklist telemetry tracking to emit two separate events (muted and status) instead of one, update a checklist item's label text, remove ordering dependencies between checklist items, and update the telemetry event type definitions accordingly.

Changes

Cohort / File(s) Summary
Telemetry event type definition
code/core/src/telemetry/types.ts
Replaced single onboarding-checklist event type with two distinct types: onboarding-checklist-muted and onboarding-checklist-status
Checklist telemetry logic
code/core/src/core-server/utils/checklist.ts
Refactored change detection from per-item to aggregated approach; introduced conditional dual-path telemetry emission (muted and status events) based on detected item changes; preserved project and user state persistence logic
Checklist item metadata
code/core/src/shared/checklist-store/checklistData.tsx
Updated renderComponent item label to "Render your first component"; removed after dependency constraints from moreComponents, moreStories, controls, viewports, organizeStories, and writeInteractions items

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • checklist.ts: Review the aggregated change detection logic and conditional telemetry emission paths to ensure muted and status events are emitted correctly and state persistence remains intact
  • checklistData.tsx: Verify that dependency removal doesn't cause unintended item ordering issues or user experience problems

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
code/core/src/core-server/utils/checklist.ts (1)

102-116: Consider consolidating iterations for efficiency.

The telemetry logic is correct, but there are multiple passes over the entries:

  1. Lines 72-84: persistence
  2. Lines 89-100: change detection
  3. Lines 105-110: computing completedItems and skippedItems

These could be consolidated into a single iteration for better performance, though the current code is clearer and the performance impact is likely negligible for typical checklist sizes.

Example consolidated approach
const {
  projectValues,
  userValues,
  mutedItems,
  statusItems,
  completedItems,
  skippedItems
} = entries.reduce((acc, [id, { status, mutedAt }]) => {
  // Persistence
  if (status === 'done') {
    acc.projectValues[id] = { status };
  } else if (status === 'accepted' || status === 'skipped') {
    acc.userValues[id] = { status };
  }
  if (mutedAt) {
    acc.userValues[id] = { ...acc.userValues[id], mutedAt };
  }
  
  // Change detection
  const prev = previousState.items[id];
  if (mutedAt !== prev?.mutedAt) acc.mutedItems.push(id);
  if (status !== prev?.status) acc.statusItems.push(id);
  
  // Telemetry snapshots
  if (status === 'done' || status === 'accepted') acc.completedItems.push(id);
  if (status === 'skipped') acc.skippedItems.push(id);
  
  return acc;
}, {
  projectValues: {},
  userValues: {},
  mutedItems: [],
  statusItems: [],
  completedItems: [],
  skippedItems: []
});
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6604f0 and 976e557.

📒 Files selected for processing (3)
  • code/core/src/core-server/utils/checklist.ts (2 hunks)
  • code/core/src/shared/checklist-store/checklistData.tsx (1 hunks)
  • code/core/src/telemetry/types.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use camelCase for variable and function names

Files:

  • code/core/src/shared/checklist-store/checklistData.tsx
  • code/core/src/core-server/utils/checklist.ts
  • code/core/src/telemetry/types.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Enable TypeScript strict mode
Export functions from modules for testing purposes

Files:

  • code/core/src/shared/checklist-store/checklistData.tsx
  • code/core/src/core-server/utils/checklist.ts
  • code/core/src/telemetry/types.ts
**/*.{ts,tsx,js,jsx,json,html,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx,js,jsx,json,html,mjs}: Use ESLint and Prettier for code style enforcement
Run 'yarn prettier --write ' to format code after making changes
Run 'yarn lint:js:cmd ' to check for ESLint issues after making changes

Files:

  • code/core/src/shared/checklist-store/checklistData.tsx
  • code/core/src/core-server/utils/checklist.ts
  • code/core/src/telemetry/types.ts
code/**/!(*.test).{ts,tsx,js,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

code/**/!(*.test).{ts,tsx,js,mjs}: Use 'logger' from 'storybook/internal/node-logger' for server-side (Node.js) logging, not console.log/console.warn/console.error
Use 'logger' from 'storybook/internal/client-logger' for client-side (browser) logging, not console.log/console.warn/console.error
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/core/src/shared/checklist-store/checklistData.tsx
  • code/core/src/core-server/utils/checklist.ts
  • code/core/src/telemetry/types.ts
🧠 Learnings (1)
📚 Learning: 2025-11-05T09:38:47.712Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.

Applied to files:

  • code/core/src/shared/checklist-store/checklistData.tsx
🧬 Code graph analysis (1)
code/core/src/core-server/utils/checklist.ts (2)
code/core/src/shared/checklist-store/index.ts (1)
  • StoreState (12-15)
code/core/src/telemetry/index.ts (1)
  • telemetry (29-70)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (4)
code/core/src/shared/checklist-store/checklistData.tsx (1)

198-198: LGTM! Improved label clarity.

The updated label "Render your first component" is clearer and more encouraging for new users than "Render a component", emphasizing this as an initial onboarding step.

code/core/src/telemetry/types.ts (1)

36-37: LGTM! Type definitions align with the new telemetry structure.

Splitting the single 'onboarding-checklist' event into 'onboarding-checklist-muted' and 'onboarding-checklist-status' provides better granularity for tracking user interactions with the checklist.

code/core/src/core-server/utils/checklist.ts (2)

67-86: LGTM! Persistence logic correctly handles mutedAt tracking.

The updated logic properly separates project-local (done) and user-local (accepted, skipped) persistence while now also tracking mutedAt changes in user-local storage. The use of entries makes the code clearer.


88-101: LGTM! Change detection logic is correct.

The reduce function correctly identifies items with mutedAt or status changes by comparing with previousState. The optional chaining on line 92 safely handles cases where items don't exist in the previous state.

@nx-cloud
Copy link

nx-cloud bot commented Nov 28, 2025

View your CI Pipeline Execution ↗ for commit 976e557

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 45s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-28 10:02:20 UTC

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Changes look good. Thanks for doing this!

@shilman shilman merged commit c96f4b1 into next Nov 28, 2025
67 of 71 checks passed
@shilman shilman deleted the fix-checklist-telemetry branch November 28, 2025 11:07
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Nov 28, 2025
@github-actions github-actions bot mentioned this pull request Nov 28, 2025
3 tasks
yannbf pushed a commit that referenced this pull request Nov 28, 2025
Checklist: Fix how state changes are reported and drop some completion restrictions
(cherry picked from commit c96f4b1)
@github-actions github-actions bot mentioned this pull request Nov 28, 2025
3 tasks
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch telemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants