feat: onboarding wizard #3#2732
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR implements a structured multi-step onboarding flow with step-based navigation, introducing new layout and navigation components ( Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
fb9c4e1 to
c7b168f
Compare
36ec7ad to
2ea4d80
Compare
c7b168f to
d4c7269
Compare
2ea4d80 to
92a2a24
Compare
d4c7269 to
01e7e87
Compare
92a2a24 to
3617da7
Compare
01e7e87 to
ee941e6
Compare
3617da7 to
e209c6d
Compare
ee941e6 to
5f66acd
Compare
a514ecb to
e6f529b
Compare
5f66acd to
8e9b3b9
Compare
e6f529b to
40cc6c6
Compare
8e9b3b9 to
ba6b860
Compare
40cc6c6 to
d82c5c2
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ondrej/eng-9192-onboarding-wizard-from-signup-to-live-metrics-topic #2732 +/- ##
=======================================================================================================
- Coverage 41.63% 1.56% -40.08%
=======================================================================================================
Files 1005 311 -694
Lines 131568 42346 -89222
Branches 5716 447 -5269
=======================================================================================================
- Hits 54784 663 -54121
+ Misses 75048 41383 -33665
+ Partials 1736 300 -1436
🚀 New features to boost your workflow:
|
ba6b860 to
48b7707
Compare
d82c5c2 to
48b7ff4
Compare
48b7707 to
73b489b
Compare
5b218b9 to
d2879ea
Compare
c549aa5 to
33c347d
Compare
7b01777 to
1f54f6f
Compare
33c347d to
254191d
Compare
1f54f6f to
7b01777
Compare
254191d to
33c347d
Compare
7b01777 to
d462062
Compare
33c347d to
bd2472e
Compare
d462062 to
b60b50a
Compare
bd2472e to
c1d7bc2
Compare
c1d7bc2 to
0c525ab
Compare
c12252a to
c98818e
Compare
0c525ab to
087a6b2
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (8)
studio/src/components/onboarding/traffic-animation.tsx (2)
180-192: Consider using an interface for props.Same as
Edge, this component uses an inline type annotation instead of an interface.♻️ Suggested refactor
+interface ResolvePulseProps { + cx: number; + cy: number; + delay: number; +} + -function ResolvePulse({ cx, cy, delay }: { cx: number; cy: number; delay: number }) { +function ResolvePulse({ cx, cy, delay }: ResolvePulseProps) {As per coding guidelines: "Prefer interfaces over type aliases for object shapes in TypeScript".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/components/onboarding/traffic-animation.tsx` around lines 180 - 192, The ResolvePulse component uses an inline type annotation for its props; define a named interface (e.g., ResolvePulseProps) describing cx: number, cy: number, delay: number and replace the inline annotation in the ResolvePulse signature with that interface; update any related references if necessary so the function becomes ResolvePulse(props: ResolvePulseProps) or function ResolvePulse({ cx, cy, delay }: ResolvePulseProps) to comply with the project's guideline to prefer interfaces for object shapes.
120-146: Consider using an interface for props.Per coding guidelines, interfaces are preferred over inline type annotations for object shapes. While this is a simple single-prop case, consistency helps with maintainability.
♻️ Suggested refactor
+interface EdgeProps { + d: string; +} + -function Edge({ d }: { d: string }) { +function Edge({ d }: EdgeProps) {As per coding guidelines: "Prefer interfaces over type aliases for object shapes in TypeScript".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/components/onboarding/traffic-animation.tsx` around lines 120 - 146, Convert the inline prop type for the Edge component into a named interface: create an interface EdgeProps { d: string } and update the function signature to function Edge(props: EdgeProps) or function Edge({ d }: EdgeProps). Replace the current inline annotation ({ d }: { d: string }) with the new interface reference so the component uses EdgeProps for its props and stays consistent with project TypeScript style.studio/src/components/onboarding/onboarding-provider.tsx (1)
14-19: Prefer an interface for theOnboardingobject shape.♻️ Suggested refactor
-type Onboarding = { +interface Onboarding { finishedAt?: Date; federatedGraphsCount: number; slack: boolean; email: boolean; -}; +}As per coding guidelines:
**/*.{ts,tsx}should prefer interfaces over type aliases for object shapes.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/components/onboarding/onboarding-provider.tsx` around lines 14 - 19, Replace the type alias Onboarding with an interface declaration to comply with the code style: change the declaration "type Onboarding = { finishedAt?: Date; federatedGraphsCount: number; slack: boolean; email: boolean; }" to an equivalent "interface Onboarding { finishedAt?: Date; federatedGraphsCount: number; slack: boolean; email: boolean; }" and update any imports/exports or references if needed (e.g., ensure React props or function signatures that reference Onboarding continue to resolve to the new interface).studio/src/components/onboarding/stepper.tsx (1)
7-15: Prefer a props interface and explicit return type forStepper.♻️ Suggested refactor
+interface StepperProps { + steps: StepperStep[]; + currentStep: number; + className?: string; +} + -export function Stepper({ +export function Stepper({ steps, currentStep, className, -}: { - steps: StepperStep[]; - currentStep: number; - className?: string; -}) { +}: StepperProps): React.ReactElement {As per coding guidelines:
**/*.{ts,tsx}should prefer interfaces for object shapes and explicit function return types.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/components/onboarding/stepper.tsx` around lines 7 - 15, The Stepper function should use a named props interface and an explicit return type: create an exported interface (e.g., StepperProps) describing steps: StepperStep[]; currentStep: number; className?: string, then change the component signature to accept props: StepperProps and annotate the function with an explicit return type (e.g., : JSX.Element). Update any internal references to the parameter destructuring (steps, currentStep, className) to match the new typed props shape and ensure imports/types for StepperStep and JSX are available.studio/src/components/onboarding/onboarding-navigation.tsx (1)
6-16: Extract props to an interface and add an explicit return type.♻️ Suggested refactor
+interface OnboardingNavigationProps { + backHref?: string; + forward: { href: string } | { onClick: () => void; isLoading?: boolean; disabled?: boolean }; + forwardLabel?: string; + onSkip: () => void; +} + export const OnboardingNavigation = ({ backHref, forward, forwardLabel = 'Next', onSkip, -}: { - backHref?: string; - forward: { href: string } | { onClick: () => void; isLoading?: boolean; disabled?: boolean }; - forwardLabel?: string; - onSkip: () => void; -}) => { +}: OnboardingNavigationProps): React.ReactElement => {As per coding guidelines:
**/*.{ts,tsx}should prefer interfaces for object shapes and explicit function return types.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/components/onboarding/onboarding-navigation.tsx` around lines 6 - 16, Extract the component props into a named interface (e.g., OnboardingNavigationProps) that declares backHref?: string; forward: { href: string } | { onClick: () => void; isLoading?: boolean; disabled?: boolean }; forwardLabel?: string; onSkip: () => void; and update the OnboardingNavigation signature to accept (props: OnboardingNavigationProps) and add an explicit return type of JSX.Element for the function; keep existing prop names (backHref, forward, forwardLabel, onSkip) and export the interface if other modules may reuse it.studio/src/components/onboarding/onboarding-container.tsx (1)
1-3: Use a typed props interface and explicit component return type.This is readable, but it currently uses an inline object shape and inferred return type.
♻️ Suggested refactor
+interface OnboardingContainerProps { + children: React.ReactNode; +} + -export const OnboardingContainer = ({ children }: { children: React.ReactNode }) => { +export const OnboardingContainer = ({ children }: OnboardingContainerProps): React.ReactElement => { return <div className="flex flex-1 flex-col items-center gap-4 text-center">{children}</div>; };As per coding guidelines:
**/*.{ts,tsx}should prefer interfaces for object shapes and explicit function return types.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/components/onboarding/onboarding-container.tsx` around lines 1 - 3, Change the inline props shape to a named interface (e.g., OnboardingContainerProps) and annotate the component with an explicit return type (e.g., React.ReactElement or JSX.Element) so the signature reads something like: declare interface OnboardingContainerProps { children: React.ReactNode } and update the OnboardingContainer function to accept OnboardingContainerProps and return the explicit type; keep the implementation body the same and only change the prop type and return type declarations.studio/src/pages/onboarding/[step].tsx (1)
39-39: Add explicit type annotations togetLayout.Please annotate the
pageparameter and return type explicitly to match the repo TypeScript rule.As per coding guidelines: `**/*.{ts,tsx}`: "Use explicit type annotations for function parameters and return types in TypeScript".💡 Suggested fix
-OnboardingStep.getLayout = (page) => page; +OnboardingStep.getLayout = (page: JSX.Element): JSX.Element => page;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/pages/onboarding/`[step].tsx at line 39, Add explicit TypeScript annotations for the getLayout function assigned to OnboardingStep: annotate the page parameter type (e.g., ReactElement or NextPage) and the function return type (e.g., ReactNode or ReactElement) so the signature is fully typed; update the OnboardingStep.getLayout assignment to include these parameter and return types while keeping the same implementation (OnboardingStep.getLayout = (page) => page), referencing the OnboardingStep.getLayout symbol and the page parameter in your change.studio/src/components/layout/onboarding-layout.tsx (1)
7-7: Use a props interface and explicit return type forOnboardingLayout.This keeps the component aligned with the repo TypeScript conventions.
As per coding guidelines: `**/*.{ts,tsx}`: "Prefer interfaces over type aliases for object shapes in TypeScript" and "Use explicit type annotations for function parameters and return types in TypeScript".💡 Suggested fix
-export const OnboardingLayout = ({ children, title }: { children?: React.ReactNode; title?: string }) => { +interface OnboardingLayoutProps { + children?: React.ReactNode; + title?: string; +} + +export const OnboardingLayout = ({ children, title }: OnboardingLayoutProps): JSX.Element => {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@studio/src/components/layout/onboarding-layout.tsx` at line 7, Replace the inline prop type with a dedicated interface (e.g., interface OnboardingLayoutProps { children?: React.ReactNode; title?: string }) and update the component signature to use that interface and an explicit return type (for example: export const OnboardingLayout = ({ children, title }: OnboardingLayoutProps): React.ReactElement | null => { ... }). Ensure the function parameter uses the new OnboardingLayoutProps and the return type is explicitly annotated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@studio/src/components/onboarding/onboarding-navigation.tsx`:
- Around line 24-27: The InfoCircledIcon used as the child of TooltipTrigger is
not keyboard-focusable; wrap the icon in a semantic, focusable button element
inside TooltipTrigger (keep asChild) and add a clear aria-label (e.g.,
"Onboarding help" or "Open onboarding tooltip") so keyboard users can open the
tooltip; preserve the existing InfoCircledIcon className and visual styles and
ensure the button is visually minimal (transparent background, no border) and
forwards focus to the icon, updating the JSX around TooltipTrigger,
InfoCircledIcon, and TooltipContent accordingly.
In `@studio/src/components/onboarding/step-1.tsx`:
- Around line 59-64: The onSuccess handler currently calls form.getValues()
which can differ from the actual payload sent if the user toggles inputs while
the request is in flight; capture the submitted channel values before calling
mutate (e.g., const submittedChannels = form.getValues().channels) and then use
that captured submittedChannels in onSuccess when calling setOnboarding (instead
of calling form.getValues() there). Do the same replacement for the second
occurrence (the other onSuccess block that sets slack/email) so both use the
saved submitted payload rather than live form.getValues().
In `@studio/src/components/onboarding/stepper.tsx`:
- Line 27: The list item key currently uses the mutable content field step.label
which can change; update the JSX in the step rendering (the div with
key={step.label}) to use the stable identifier step.number instead (e.g.,
key={step.number} or key={String(step.number)}) so React reconciliation relies
on the intended stable id.
In `@studio/src/pages/onboarding/`[step].tsx:
- Around line 11-16: Normalize and guard router.query.step before using it:
ensure router.query.step is parsed to a bounded integer (e.g., fallback to 1 or
null on invalid/NaN) and clamp it within ONBOARDING_STEPS length so stepNumber
is never NaN or out of range; compute title from ONBOARDING_STEPS only when
stepNumber is a valid index and update the switch/case logic (refer to
router.query.step, stepNumber, ONBOARDING_STEPS, title, and the switch block) to
handle invalid or missing steps by routing to a safe default or showing a
fallback UI instead of relying on case 0/1 or default: null.
---
Nitpick comments:
In `@studio/src/components/layout/onboarding-layout.tsx`:
- Line 7: Replace the inline prop type with a dedicated interface (e.g.,
interface OnboardingLayoutProps { children?: React.ReactNode; title?: string })
and update the component signature to use that interface and an explicit return
type (for example: export const OnboardingLayout = ({ children, title }:
OnboardingLayoutProps): React.ReactElement | null => { ... }). Ensure the
function parameter uses the new OnboardingLayoutProps and the return type is
explicitly annotated.
In `@studio/src/components/onboarding/onboarding-container.tsx`:
- Around line 1-3: Change the inline props shape to a named interface (e.g.,
OnboardingContainerProps) and annotate the component with an explicit return
type (e.g., React.ReactElement or JSX.Element) so the signature reads something
like: declare interface OnboardingContainerProps { children: React.ReactNode }
and update the OnboardingContainer function to accept OnboardingContainerProps
and return the explicit type; keep the implementation body the same and only
change the prop type and return type declarations.
In `@studio/src/components/onboarding/onboarding-navigation.tsx`:
- Around line 6-16: Extract the component props into a named interface (e.g.,
OnboardingNavigationProps) that declares backHref?: string; forward: { href:
string } | { onClick: () => void; isLoading?: boolean; disabled?: boolean };
forwardLabel?: string; onSkip: () => void; and update the OnboardingNavigation
signature to accept (props: OnboardingNavigationProps) and add an explicit
return type of JSX.Element for the function; keep existing prop names (backHref,
forward, forwardLabel, onSkip) and export the interface if other modules may
reuse it.
In `@studio/src/components/onboarding/onboarding-provider.tsx`:
- Around line 14-19: Replace the type alias Onboarding with an interface
declaration to comply with the code style: change the declaration "type
Onboarding = { finishedAt?: Date; federatedGraphsCount: number; slack: boolean;
email: boolean; }" to an equivalent "interface Onboarding { finishedAt?: Date;
federatedGraphsCount: number; slack: boolean; email: boolean; }" and update any
imports/exports or references if needed (e.g., ensure React props or function
signatures that reference Onboarding continue to resolve to the new interface).
In `@studio/src/components/onboarding/stepper.tsx`:
- Around line 7-15: The Stepper function should use a named props interface and
an explicit return type: create an exported interface (e.g., StepperProps)
describing steps: StepperStep[]; currentStep: number; className?: string, then
change the component signature to accept props: StepperProps and annotate the
function with an explicit return type (e.g., : JSX.Element). Update any internal
references to the parameter destructuring (steps, currentStep, className) to
match the new typed props shape and ensure imports/types for StepperStep and JSX
are available.
In `@studio/src/components/onboarding/traffic-animation.tsx`:
- Around line 180-192: The ResolvePulse component uses an inline type annotation
for its props; define a named interface (e.g., ResolvePulseProps) describing cx:
number, cy: number, delay: number and replace the inline annotation in the
ResolvePulse signature with that interface; update any related references if
necessary so the function becomes ResolvePulse(props: ResolvePulseProps) or
function ResolvePulse({ cx, cy, delay }: ResolvePulseProps) to comply with the
project's guideline to prefer interfaces for object shapes.
- Around line 120-146: Convert the inline prop type for the Edge component into
a named interface: create an interface EdgeProps { d: string } and update the
function signature to function Edge(props: EdgeProps) or function Edge({ d }:
EdgeProps). Replace the current inline annotation ({ d }: { d: string }) with
the new interface reference so the component uses EdgeProps for its props and
stays consistent with project TypeScript style.
In `@studio/src/pages/onboarding/`[step].tsx:
- Line 39: Add explicit TypeScript annotations for the getLayout function
assigned to OnboardingStep: annotate the page parameter type (e.g., ReactElement
or NextPage) and the function return type (e.g., ReactNode or ReactElement) so
the signature is fully typed; update the OnboardingStep.getLayout assignment to
include these parameter and return types while keeping the same implementation
(OnboardingStep.getLayout = (page) => page), referencing the
OnboardingStep.getLayout symbol and the page parameter in your change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 62b243fa-c34f-404e-85f9-3a30e131d5a0
📒 Files selected for processing (13)
studio/src/components/layout/onboarding-layout.tsxstudio/src/components/onboarding/onboarding-container.tsxstudio/src/components/onboarding/onboarding-navigation.tsxstudio/src/components/onboarding/onboarding-provider.tsxstudio/src/components/onboarding/onboarding-steps.tsstudio/src/components/onboarding/step-1.tsxstudio/src/components/onboarding/step-2.tsxstudio/src/components/onboarding/step-3.tsxstudio/src/components/onboarding/stepper.tsxstudio/src/components/onboarding/traffic-animation.tsxstudio/src/hooks/use-onboarding-navigation.tsstudio/src/pages/onboarding/[step].tsxstudio/tailwind.config.js
Summary by CodeRabbit
Checklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.
PR (3) UI for onboarding wizard + step 1 (welcome) implementation
Parent: #2720