-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Core: Fix onboarding visual bugs, survey telemetry and modal dismissal #33326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
…ent with other panels
|
View your CI Pipeline Execution ↗ for commit 4877857
☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughThe changes refactor the onboarding survey initialization to use a prop-driven state mechanism instead of direct URL manipulation. A new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
✨ Finishing touches
Comment |
There was a problem hiding this 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 (5)
code/core/src/controls/components/SaveStory.tsx (1)
19-27: Absolute footer bar + adjustedInfospacing are fine; ensure a stable positioning contextSwitching the Save bar
Containertoposition: 'absolute'withbottom: 0andwidth: '100%', together withpaddingBottom: 41on the wrapper, is a reasonable way to keep the bar docked to the bottom of the panel while avoiding overlap with the ArgsTable. The addedmarginInlineStartonInfois a minor visual refinement.One thing to double‑check: that there is always a positioned ancestor (e.g.,
position: 'relative'on the panel wrapper) so this bar is anchored to the controls panel rather than the viewport. If that’s not already true viaAddonPanel, consider addingposition: 'relative'to the immediate wrapper to make the relationship explicit.Also applies to: 43-50
code/core/src/theming/global.ts (1)
100-108: Body‑level fixed viewport and scroll locking match the new layout model; validate cross‑browser behaviorLocking the
bodytoposition: 'fixed'withwidth: '100vw',height: '100vh', andoverflow: 'hidden'is consistent with moving scrolling responsibilities into the app shell (panels, docs areas, etc.) and should help keep guided‑tour targeting aligned with the visible viewport.Given this is a global change, it’s worth sanity‑checking:
- Manager + docs views on small screens and mobile browsers (100vh/100vw quirks, address bar behavior).
- Storybook when embedded inside another page or iframe, if that’s a supported scenario.
If you see issues there, an alternative would be to apply similar constraints to the manager root container instead of
body.code/core/src/controls/components/ControlsPanel.tsx (1)
33-43:AddonWrappertheming and padding look good; consider making it a positioned ancestorThe updated
AddonWrapperstyling (full height,maxHeight: '100vh', themed background, conditional bottom padding, and header styling) fits the new fixed‑viewport controls layout and ensures the Save bar doesn’t cover the last rows.To make the Save bar’s
position: 'absolute'; bottom: 0behavior more robust, it would be safer forAddonWrapperitself to be a positioned ancestor rather than relying on upstream components:-const AddonWrapper = styled.div<{ showSaveFromUI: boolean }>(({ showSaveFromUI, theme }) => ({ - height: '100%', - maxHeight: '100vh', +const AddonWrapper = styled.div<{ showSaveFromUI: boolean }>(({ showSaveFromUI, theme }) => ({ + position: 'relative', + height: '100%', + maxHeight: '100vh', paddingBottom: showSaveFromUI ? 41 : 0, backgroundColor: theme.background.content, thead: { backgroundColor: theme.background.app, lineHeight: '19px', }, }));This guarantees the footer bar is anchored to the controls panel even if the parent panel’s positioning changes later.
code/addons/onboarding/src/Survey.tsx (1)
15-28: LocalisOpenstate + mount-timeopenSurveyevent cleanly solve dismissal & telemetryUsing
isOpenstate (closed viadisableOnboarding) to control<IntentSurvey>and emitting a one-shot{ type: 'openSurvey', from: 'guide' }inuseEffectgives you persistent dismissal behavior while instrumenting survey opens from the guide entry point. The dependency arrays and callback wiring look correct and should behave deterministically.If you later introduce flows where
Surveycan mount withisOpeninitially false, consider gating theopenSurveyemit onisOpenas well so telemetry only counts actually visible surveys.Also applies to: 51-51
code/addons/onboarding/src/Onboarding.tsx (1)
112-120:openSurveytelemetry on step 6 and fixed bottom panel height align with the intended UX fixThe new effect that emits
{ type: 'openSurvey', from: 'onboarding' }only whenstep === '6:IntentSurvey'and!hasCompletedSurveygives you a clean telemetry signal for survey exposure from the onboarding flow without double‑counting. Addingapi.setSizes({ bottomPanelHeight: 300 })during initial onboarding setup should help keep the controls panel and tour highlights within the viewport, addressing the visual bugs mentioned in the PR description.If you later want to preserve user‑customized panel sizes, consider capturing the previous sizes before calling
setSizesand restoring them in a cleanup effect when onboarding is disabled or unmounted.Also applies to: 122-129
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
code/addons/onboarding/src/Onboarding.tsx(3 hunks)code/addons/onboarding/src/Survey.tsx(3 hunks)code/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsx(1 hunks)code/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsx(2 hunks)code/core/src/components/components/Modal/Modal.styled.tsx(1 hunks)code/core/src/controls/components/ControlsPanel.tsx(2 hunks)code/core/src/controls/components/SaveStory.tsx(2 hunks)code/core/src/controls/manager.tsx(1 hunks)code/core/src/theming/global.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,json,html,ts,tsx,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use ESLint and Prettier configurations that are enforced in the codebase
Files:
code/core/src/components/components/Modal/Modal.styled.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsxcode/core/src/controls/components/SaveStory.tsxcode/core/src/controls/components/ControlsPanel.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsxcode/core/src/theming/global.tscode/addons/onboarding/src/Onboarding.tsxcode/core/src/controls/manager.tsxcode/addons/onboarding/src/Survey.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Enable TypeScript strict mode
Files:
code/core/src/components/components/Modal/Modal.styled.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsxcode/core/src/controls/components/SaveStory.tsxcode/core/src/controls/components/ControlsPanel.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsxcode/core/src/theming/global.tscode/addons/onboarding/src/Onboarding.tsxcode/core/src/controls/manager.tsxcode/addons/onboarding/src/Survey.tsx
code/**/*.{ts,tsx,js,jsx,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
code/**/*.{ts,tsx,js,jsx,mjs}: Use server-side logger from 'storybook/internal/node-logger' for Node.js code
Use client-side logger from 'storybook/internal/client-logger' for browser code
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/components/components/Modal/Modal.styled.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsxcode/core/src/controls/components/SaveStory.tsxcode/core/src/controls/components/ControlsPanel.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsxcode/core/src/theming/global.tscode/addons/onboarding/src/Onboarding.tsxcode/core/src/controls/manager.tsxcode/addons/onboarding/src/Survey.tsx
code/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Export functions that need to be tested from their modules
Files:
code/core/src/components/components/Modal/Modal.styled.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsxcode/core/src/controls/components/SaveStory.tsxcode/core/src/controls/components/ControlsPanel.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsxcode/core/src/theming/global.tscode/addons/onboarding/src/Onboarding.tsxcode/core/src/controls/manager.tsxcode/addons/onboarding/src/Survey.tsx
code/**/*.{js,jsx,json,html,ts,tsx,mjs}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
code/**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier with --write flag to format code before committing
Run ESLint with yarn lint:js:cmd to check for linting issues and fix errors before committing
Files:
code/core/src/components/components/Modal/Modal.styled.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsxcode/core/src/controls/components/SaveStory.tsxcode/core/src/controls/components/ControlsPanel.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsxcode/core/src/theming/global.tscode/addons/onboarding/src/Onboarding.tsxcode/core/src/controls/manager.tsxcode/addons/onboarding/src/Survey.tsx
🧠 Learnings (6)
📚 Learning: 2025-11-05T09:36:55.944Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.
Applied to files:
code/core/src/components/components/Modal/Modal.styled.tsxcode/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsx
📚 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/controls/components/ControlsPanel.tsxcode/addons/onboarding/src/Survey.tsx
📚 Learning: 2025-09-19T15:49:02.264Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32270
File: code/core/src/components/components/AriaTabs/AriaTabPanel.tsx:27-30
Timestamp: 2025-09-19T15:49:02.264Z
Learning: In AriaTabPanel component, when hasScrollbar=false, the Panel container intentionally maintains overflowY: hidden. This forces consumers to implement their own scrolling within tab content rather than relying on automatic browser scrolling, preventing double scrollbars and giving full control over scroll behavior.
Applied to files:
code/core/src/controls/manager.tsx
📚 Learning: 2025-11-28T14:50:24.889Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Follow existing patterns and conventions in the Storybook codebase
Applied to files:
code/addons/onboarding/src/Survey.tsx
📚 Learning: 2025-11-05T09:37:25.920Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/tooltip/WithTooltip.tsx:54-96
Timestamp: 2025-11-05T09:37:25.920Z
Learning: Repo: storybookjs/storybook — In code/core/src/components/components/tooltip/WithTooltip.tsx, the legacy WithTooltip implementation is intentionally reintroduced for backward compatibility and is deprecated; maintainers (per Sidnioulz) do not want maintenance or improvements on it. Prefer WithTooltipNew/Popover; avoid suggesting changes to WithTooltip.* going forward.
Applied to files:
code/addons/onboarding/src/Survey.tsx
📚 Learning: 2025-11-28T14:50:24.889Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Applies to code/**/*.{ts,tsx,js,jsx,mjs} : Use client-side logger from 'storybook/internal/client-logger' for browser code
Applied to files:
code/addons/onboarding/src/Survey.tsx
🧬 Code graph analysis (3)
code/core/src/controls/components/ControlsPanel.tsx (1)
code/addons/docs/src/blocks/components/ArgsTable/ArgsTable.tsx (1)
ArgsTable(320-481)
code/addons/onboarding/src/Onboarding.tsx (1)
code/addons/onboarding/src/constants.ts (2)
ADDON_ONBOARDING_CHANNEL(2-2)ADDON_CONTROLS_ID(5-5)
code/addons/onboarding/src/Survey.tsx (2)
code/addons/onboarding/src/constants.ts (1)
ADDON_ONBOARDING_CHANNEL(2-2)code/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsx (1)
IntentSurvey(67-257)
⏰ 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). (4)
- GitHub Check: normal
- GitHub Check: Core Unit Tests, windows-latest
- GitHub Check: nx
- GitHub Check: nx
🔇 Additional comments (6)
code/core/src/controls/manager.tsx (1)
120-128: LettingAddonPanelmanage its own scrollbar looks correct for the new layoutDropping
hasScrollbar={false}should allow the panel to provide a single scroll container, which fits with the removal of the innerScrollAreaand the new fixed‑viewport body styles. This should reduce nested scrolling and help guided‑tour highlighting stay in sync with the visible viewport.I’d just recommend exercising a story with many controls to confirm scrolling, Save bar positioning, and tour highlights all behave as expected in the manager and in tabbed layouts. Based on learnings, this aligns with the pattern of delegating scrolling to the panel container when possible.
code/core/src/components/components/Modal/Modal.styled.tsx (1)
188-199: Explicittype="button"onModal.Closeresolves form‑submission bugAdding
type="button"to the default CloseButtonensures it no longer acts as a submit button when rendered inside a<form>, while keeping existingasChildusages under caller control. This directly addresses the modal dismissal/form submission issue without side effects on other call sites.code/core/src/controls/components/ControlsPanel.tsx (1)
107-121: DirectArgsTablerendering inside the panel matches the new scroll modelRendering
ArgsTabledirectly insideAddonWrapper(withinAddonPanel,isLoading,sort, and the existingkey={path}) and dropping the extraScrollAreawrapper should eliminate nested scrollbars and align scrolling withAddonPanel’s own container.The prop set looks complete for the controls use case, and the
key={path}comment still accurately reflects that state will reset on story switches.code/addons/onboarding/src/features/IntentSurvey/IntentSurvey.stories.tsx (1)
9-13: DefaultisOpenstory arg matches new required prop and behaviorAdding
isOpen: truetometa.argskeeps the survey visible in the Default story and satisfies the new required prop, so theSubmittingplay function can still find and interact with the modal without extra setup.code/addons/onboarding/src/Onboarding.tsx (1)
84-97: Centralized query handling andisOpenwiring for IntentSurvey look solidUsing
api.applyQueryParams({ onboarding: undefined }, { replace: true })indisableOnboardingis a nice cleanup over manual URL manipulation and keeps the manager URL in sync when onboarding is dismissed. PassingisOpen={enabled}into<IntentSurvey>matches the new controlled API; even thoughenabledis always true while this component is mounted (because of the earlyif (!enabled) return null), it keeps the call site future‑proof if you ever decouple rendering from open state.Also applies to: 313-317
code/addons/onboarding/src/features/IntentSurvey/IntentSurvey.tsx (1)
67-75: ControlledModalviaisOpenprop is consistent and parent-drivenWiring
IntentSurveyto accept anisOpen: booleanand passing it through asopen={isOpen}onModal, withonOpenChangecallingonDismissonly when closing, makes visibility fully controlled by parents (Onboarding, Survey, stories) and fixes the previous reliance on internal default-open behavior. All call sites properly pass theisOpenprop.
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 49 | 39 | 🎉 -10 🎉 |
| Self size | 20.52 MB | 20.54 MB | 🚨 +15 KB 🚨 |
| Dependency size | 16.50 MB | 16.41 MB | 🎉 -98 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 127 | 128 | 🚨 +1 🚨 |
| Self size | 1.12 MB | 1.12 MB | 0 B |
| Dependency size | 21.97 MB | 21.96 MB | 🎉 -11 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 159 | 160 | 🚨 +1 🚨 |
| Self size | 30 KB | 30 KB | 🚨 +18 B 🚨 |
| Dependency size | 23.15 MB | 23.14 MB | 🎉 -11 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 117 | 118 | 🚨 +1 🚨 |
| Self size | 35 KB | 35 KB | 🎉 -19 B 🎉 |
| Dependency size | 19.76 MB | 19.75 MB | 🎉 -11 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 183 | 173 | 🎉 -10 🎉 |
| Self size | 775 KB | 774 KB | 🎉 -261 B 🎉 |
| Dependency size | 67.54 MB | 67.46 MB | 🎉 -83 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 176 | 166 | 🎉 -10 🎉 |
| Self size | 30 KB | 30 KB | 0 B |
| Dependency size | 66.11 MB | 66.03 MB | 🎉 -83 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 50 | 40 | 🎉 -10 🎉 |
| Self size | 999 KB | 1000 KB | 🚨 +217 B 🚨 |
| Dependency size | 37.03 MB | 36.94 MB | 🎉 -83 KB 🎉 |
| Bundle Size Analyzer | node | node |
Closes #
What I did
typeattribute.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake 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/coreteam 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
New Features
Bug Fixes
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.