Skip to content

Signup refactor#491

Merged
goldflag merged 6 commits intomasterfrom
signup-refactor
Jul 22, 2025
Merged

Signup refactor#491
goldflag merged 6 commits intomasterfrom
signup-refactor

Conversation

@goldflag
Copy link
Copy Markdown
Collaborator

@goldflag goldflag commented Jul 21, 2025

Summary by CodeRabbit

  • New Features
    • Improved domain validation across the app with a new validation utility.
    • Enhanced "No Data" view with platform-specific guides and documentation links for easier setup.
  • Refactor
    • Signup flow streamlined from four steps to three, removing the tracking code step and redirecting users directly to their dashboard after site addition.
    • Signup page UI simplified with a horizontal progress bar and a more concise, single-column layout.
    • Code formatting and imports cleaned up for consistency and readability.

goldflag added 4 commits July 20, 2025 22:53
…larity

- Removed unused state and step icons to streamline the signup process.
- Updated navigation logic to redirect users directly to the dashboard after site addition.
- Simplified step content rendering by removing unnecessary elements and enhancing readability.
- Adjusted layout for better visual presentation and user engagement.
… and functionality

- Consolidated domain validation logic by importing isValidDomain from utils.
- Streamlined AddSite component structure for better readability.
- Enhanced domain normalization process in utils to handle various input formats.
- Updated SignupPage to utilize isValidDomain for domain validation during signup.
- Changed initial step state from 3 to 1 to improve the signup flow.
- Updated header text from "Create your account" to "Signup" for better clarity.
- Removed unnecessary spacing and adjusted layout for a cleaner presentation.
- Reintroduced error display within the content area for improved user feedback.
- Updated initial step state from 1 to 3 to reflect the correct signup flow.
- Adjusted header text for each step to enhance clarity and consistency.
- Removed unnecessary spacing in the layout for a cleaner presentation.
- Conditionally rendered the open-source link based on the environment.
@vercel
Copy link
Copy Markdown

vercel bot commented Jul 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rybbit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 1:03am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 21, 2025

Walkthrough

The changes refactor domain validation logic across components by introducing a reusable isValidDomain utility function. The signup flow is condensed from four to three steps, removing the tracking code step and updating the UI to a simplified horizontal progress bar. The NoData component was enhanced with platform-specific guide cards and new styling. Minor formatting and import improvements are made throughout.

Changes

File(s) Change Summary
client/src/app/components/AddSite.tsx Refactored to use imported isValidDomain, consolidated imports, and applied formatting updates.
client/src/app/signup/page.tsx Signup flow reduced to 3 steps, removed tracking code step, updated UI to horizontal progress bar, domain validation uses utility, and redirects user to dashboard after site addition.
client/src/lib/utils.ts Added isValidDomain function, reformatted sleep, cleaned up normalizeDomain string literals.
client/src/app/[site]/components/Header/NoData.tsx Enhanced NoData with platform guide cards, new dark-themed alert styling, and multiple platform icons. Added new Card component.
client/package.json Added dependency @icons-pack/react-simple-icons for platform icons.
docs/src/content/index.mdx Added trailing newline at file end.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SignupPage
    participant Utils
    participant Dashboard

    User->>SignupPage: Start signup
    SignupPage->>SignupPage: Show step 3 (Add your site)
    User->>SignupPage: Enter domain
    SignupPage->>Utils: isValidDomain(domain)
    Utils-->>SignupPage: Boolean result
    SignupPage->>SignupPage: Add site if valid
    SignupPage->>Dashboard: Redirect to dashboard after site addition
Loading

Estimated code review effort

3 (45 minutes)

Poem

Hopping through code with nimble delight,
The signup path now feels just right.
No more tracking step to slow the way—
Straight to the dashboard, hooray!
With domains checked neat and clean,
Guides and icons in a shiny scene.
This bunny’s proud of what’s been seen. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (2)
client/src/lib/utils.ts (1)

81-91: Consider protocol handling consistency.

The function implementation is solid. However, isValidDomain accepts URLs with protocols (http/https) while normalizeDomain removes them. Consider whether you want to:

  1. Keep current behavior (flexible validation)
  2. Reject protocols in validation to match normalization behavior

The current approach works well for user input validation before normalization.

client/src/app/signup/page.tsx (1)

32-43: Clarify step initialization behavior.

There's potential confusion between:

  1. currentStep initialized to 3 (line 49)
  2. StepHandler that can override it from URL params (lines 32-43)

This could lead to unexpected behavior if someone navigates to /signup?step=1. Consider documenting the intended behavior or adding validation.

Consider adding step validation:

 useEffect(() => {
   const step = searchParams.get("step");
   if (step && !isNaN(Number(step))) {
-    onSetStep(Number(step));
+    const stepNum = Number(step);
+    // Only allow valid step numbers
+    if (stepNum >= 1 && stepNum <= 3) {
+      onSetStep(stepNum);
+    }
   }
 }, [searchParams, onSetStep]);

Also applies to: 49-49, 355-357

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30ae5aa and 4ec823c.

📒 Files selected for processing (3)
  • client/src/app/components/AddSite.tsx (6 hunks)
  • client/src/app/signup/page.tsx (9 hunks)
  • client/src/lib/utils.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
{client,server}/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • CLAUDE.md
🧠 Learnings (3)
client/src/app/components/AddSite.tsx (3)
Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Applies to client/**/*.{tsx} : Client: Use React functional components with minimal useEffect and inline functions
Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Applies to {client,server}/**/*.{ts,tsx} : Use camelCase for variables and functions, PascalCase for components and types
Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Frontend: Use Next.js, Tailwind CSS, Shadcn UI, Tanstack Query, Zustand, Luxon, and Nivo
client/src/lib/utils.ts (1)
Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Applies to {client,server}/**/*.{ts,tsx} : Use camelCase for variables and functions, PascalCase for components and types
client/src/app/signup/page.tsx (2)
Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Frontend: Use Next.js, Tailwind CSS, Shadcn UI, Tanstack Query, Zustand, Luxon, and Nivo
Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Applies to client/**/*.{tsx} : Client: Use React functional components with minimal useEffect and inline functions
🔇 Additional comments (8)
client/src/lib/utils.ts (2)

30-30: LGTM! Clean reformatting.

The single-line arrow function is more concise while maintaining the same functionality.


61-80: LGTM! Good style consistency improvements.

The quote style changes and whitespace cleanup improve code consistency without affecting functionality.

client/src/app/components/AddSite.tsx (3)

19-19: LGTM! Clean import consolidation.

Consolidating related imports from the same module improves readability.


25-25: Excellent refactoring to centralize domain validation.

Moving domain validation to a shared utility improves maintainability and consistency across the application.

Also applies to: 54-57


27-27: LGTM! Consistent formatting improvements.

The single-line formatting for simple expressions improves code density while maintaining readability.

Also applies to: 36-36, 61-64, 127-127, 132-132, 145-145, 152-152, 158-158, 165-165, 177-177, 180-180

client/src/app/signup/page.tsx (3)

23-23: LGTM! Consistent domain validation implementation.

The centralized isValidDomain function is properly used for both form validation and UI state management.

Also applies to: 149-153, 308-308


158-159: Good UX improvement with direct dashboard navigation.

Removing the tracking code step and navigating directly to the dashboard streamlines the signup process.


377-403: Excellent UI modernization with horizontal progress indicator.

The horizontal step indicator provides better visual flow and takes up less screen space. The implementation correctly handles all step states with smooth transitions.

goldflag added 2 commits July 21, 2025 21:00
…onent with framework guide cards

- Added @icons-pack/react-simple-icons version 13.6.0 to package.json and package-lock.json.
- Refactored NoData component to include a custom Card component for displaying framework guides.
- Updated the alert message and layout for improved user experience and clarity.
- Changed initial step state from 3 to 1 to reflect the correct signup process.
- Ensured consistency with previous refactorings aimed at enhancing user experience.
Copy link
Copy Markdown
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 (2)
client/src/app/[site]/components/Header/NoData.tsx (2)

1-24: Sort icon imports alphabetically within the external group.

The icon imports from @icons-pack/react-simple-icons should be sorted alphabetically to follow the coding guidelines.

 import {
-  SiAngular,
+  SiAngular,
   SiAstro,
   SiDocusaurus,
   SiDrupal,
   SiFramer,
   SiGatsby,
   SiGoogletagmanager,
   SiHugo,
   SiJekyll,
   SiLaravel,
-  SiNextdotjs,
   SiNuxt,
+  SiNextdotjs,
   SiReact,
   SiRemix,
   SiShopify,
   SiSquarespace,
   SiSvelte,
-  SiVuedotjs,
   SiWebflow,
   SiWix,
+  SiVuedotjs,
   SiWoocommerce,
   SiWordpress,
 } from "@icons-pack/react-simple-icons";

63-63: Remove unnecessary fragment wrapper.

The fragment wrapper is unnecessary since there's only one child element (Alert).

-      <>
         <Alert className="mt-4 p-4  dark:bg-neutral-900 dark:border-amber-600/80">
           {/* ... alert content ... */}
         </Alert>
-      </>

Also applies to: 233-233

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ec823c and 8bb0273.

⛔ Files ignored due to path filters (1)
  • client/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • client/package.json (1 hunks)
  • client/src/app/[site]/components/Header/NoData.tsx (1 hunks)
  • client/src/app/signup/page.tsx (8 hunks)
  • docs/src/content/index.mdx (1 hunks)
📓 Path-based instructions (1)
{client,server}/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

{client,server}/**/*.{ts,tsx}: Use TypeScript with strict typing throughout both client and server
Use try/catch blocks with specific error types for error handling
Use camelCase for variables and functions, PascalCase for components and types
Group imports by external, then internal, and sort alphabetically within groups

Files:

  • client/src/app/[site]/components/Header/NoData.tsx
🧠 Learnings (1)
client/src/app/[site]/components/Header/NoData.tsx (2)

Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Applies to client/**/*.{tsx} : Client: Use React functional components with minimal useEffect and inline functions

Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Frontend: Use Next.js, Tailwind CSS, Shadcn UI, Tanstack Query, Zustand, Luxon, and Nivo

✅ Files skipped from review due to trivial changes (2)
  • docs/src/content/index.mdx
  • client/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • client/src/app/signup/page.tsx
🧰 Additional context used
📓 Path-based instructions (1)
{client,server}/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (CLAUDE.md)

{client,server}/**/*.{ts,tsx}: Use TypeScript with strict typing throughout both client and server
Use try/catch blocks with specific error types for error handling
Use camelCase for variables and functions, PascalCase for components and types
Group imports by external, then internal, and sort alphabetically within groups

Files:

  • client/src/app/[site]/components/Header/NoData.tsx
🧠 Learnings (1)
client/src/app/[site]/components/Header/NoData.tsx (2)

Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Applies to client/**/*.{tsx} : Client: Use React functional components with minimal useEffect and inline functions

Learnt from: CR
PR: rybbit-io/rybbit#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T15:10:29.485Z
Learning: Frontend: Use Next.js, Tailwind CSS, Shadcn UI, Tanstack Query, Zustand, Luxon, and Nivo

⏰ 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: Build Client Images (ubuntu-latest, linux/amd64)
  • GitHub Check: Build Client Images (ubuntu-24.04-arm, linux/arm64)
🔇 Additional comments (3)
client/src/app/[site]/components/Header/NoData.tsx (3)

31-54: Well-implemented Card component with proper TypeScript and accessibility.

The Card component follows React best practices with:

  • Proper TypeScript interface definition
  • Semantic HTML structure using anchor tags
  • Correct external link attributes for security
  • Good hover states and responsive design
  • Adherence to naming conventions (PascalCase for component, camelCase for props)

59-59: Good addition of site metadata retrieval.

Adding the useGetSite hook call provides necessary site metadata for the enhanced UI display.


64-232: Excellent enhancement with platform-specific guidance.

The Alert component has been significantly improved with:

  • Updated dark theme styling with amber borders
  • Comprehensive platform guides covering major frameworks and platforms
  • Proper integration of existing code snippet and documentation
  • Consistent Card component usage with appropriate icons and links
  • Good user experience with hover states and visual feedback

This provides much better guidance for users setting up analytics on different platforms.

@goldflag goldflag merged commit e4a0874 into master Jul 22, 2025
8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jul 22, 2025
This was referenced Oct 20, 2025
Merged
@coderabbitai coderabbitai bot mentioned this pull request Jan 27, 2026
This was referenced Feb 13, 2026
Merged
This was referenced Feb 26, 2026
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.

1 participant