Skip to content

Conversation

@AnthonyRonning
Copy link
Contributor

@AnthonyRonning AnthonyRonning commented Oct 6, 2025

Fixes #249

Adds an info tooltip showing all 6 available models with their friendly names next to the "6 Powerful Models" feature text on pricing pages.

Changes

  • Created ModelTooltip.tsx component showing all available models
  • Updated pricing config to include tooltip on model feature text
  • Enhanced PlanFeature type to support React elements
  • Models display with appropriate Pro/New/Starter badges
  • Appears on both pricing page and marketing page

Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added an in-app tooltip showing available AI models with clear labels/badges and an accessible info icon trigger.
  • Style
    • Pricing plan features now include contextual tooltips for clearer model availability by plan (free, starter, pro), with models grouped by tier and alphabetically ordered for readability.

- Create ModelTooltip component showing all 6 available models with friendly names
- Update pricing config to include tooltip on '6 Powerful Models' feature text
- Enhance PlanFeature type to support React elements in addition to strings
- Models display with appropriate badges (Pro, New, Starter requirements)
- Tooltip appears on both pricing page and marketing page pricing section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Oct 6, 2025

Walkthrough

Adds a new ModelTooltip React component that reads MODEL_CONFIG, sorts models by access tier and name, and renders an info-triggered tooltip listing available models with badges. Updates pricingConfig to allow JSX in PlanFeature.text and integrates ModelTooltip alongside feature text.

Changes

Cohort / File(s) Summary
New tooltip component
frontend/src/components/ModelTooltip.tsx
Introduces ModelTooltip: imports tooltip primitives and Info icon, derives model list from MODEL_CONFIG, sorts by free/starter/pro then alphabetically, and renders an accessible tooltip with model names and badges. Exports ModelTooltip.
Pricing config JSX/text type update
frontend/src/config/pricingConfig.tsx
Changes PlanFeature.text type from string to string | React.ReactNode; imports and embeds ModelTooltip within feature text spans; updates feature entries to render JSX with the tooltip.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant PricingPage
  participant ModelTooltip
  participant MODEL_CONFIG as MODEL_CONFIG

  User->>PricingPage: View pricing features
  PricingPage->>ModelTooltip: Render feature text with tooltip
  ModelTooltip->>MODEL_CONFIG: Read models (id, displayName, badges, tiers)
  MODEL_CONFIG-->>ModelTooltip: Model list
  Note over ModelTooltip: Sort by tier (free → starter → pro), then alphabetically
  User->>ModelTooltip: Hover/click info icon
  ModelTooltip-->>User: Show tooltip: "Available Models:" + list with badges
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

A nibble of code, a tooltip’s delight,
I twitch my ears at models in sight.
Free, Starter, Pro—lined up in a row,
Little (i) bubbles that softly glow.
Hop-click-hover, the list unfurls—
Carrots of config for curious squirrels. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “Add model information tooltip to pricing pages” succinctly and accurately describes the primary change of introducing a tooltip that lists available models on pricing pages, matching the PR’s main functionality without extraneous details.
Linked Issues Check ✅ Passed The pull request adds a new ModelTooltip component that reads and displays all supported models with friendly names, extends the PlanFeature type to accept React nodes, and wraps the “6 Powerful Models” feature text with an info icon tooltip in the pricing configuration so that the tooltip appears on both the pricing and marketing pages, fulfilling each coding objective of issue #249.
Out of Scope Changes Check ✅ Passed All modifications are limited to creating the tooltip component and updating the pricing configuration and type definitions to support it, with no unrelated or extraneous code changes present in this pull request.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/issue-249-20251006-1552

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

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Summary

This PR enhances the pricing pages by adding an interactive model information tooltip next to the "6 Powerful Models" feature text. The implementation creates a new `ModelTooltip.tsx` component that displays all available AI models with their friendly names and appropriate tier badges (Pro/New/Starter). The component leverages the existing `MODEL_CONFIG` from the `ModelSelector` to ensure consistency and avoid code duplication.

The changes integrate seamlessly with the existing pricing configuration system by extending the PlanFeature type to support React elements instead of just strings. This allows the tooltip to be embedded inline with feature text while maintaining the existing layout structure. The tooltip appears across Pro, Max, and Team plans, providing users with detailed information about what models they'll have access to with each tier.

The implementation uses the established UI patterns from the codebase, utilizing the existing tooltip component and badge styling conventions. The models are intelligently sorted by access tier (free, starter, pro) to provide a logical ordering in the tooltip display.

PR Description Notes:

  • The PR description mentions "6 available models" but the code shows 8 models in the MODEL_CONFIG

Important Files Changed

Changed Files
Filename Score Overview
frontend/src/components/ModelTooltip.tsx 4/5 New tooltip component displaying all available AI models with badges and sorting logic
frontend/src/config/pricingConfig.tsx 5/5 Updated pricing configuration to integrate model tooltip and enhanced type definitions

Confidence score: 4/5

  • This PR is safe to merge with minimal risk and provides clear user value
  • Score reflects solid implementation with proper TypeScript support, but complex sorting logic needs attention
  • Pay close attention to the ModelTooltip component's sorting logic and ensure model count accuracy

Sequence Diagram

sequenceDiagram
    participant User
    participant PricingPage as "Pricing Page"
    participant ModelTooltip as "ModelTooltip Component"
    participant TooltipProvider as "Tooltip Provider"
    participant ModelSelector as "MODEL_CONFIG"
    
    User->>PricingPage: "Views pricing page"
    PricingPage->>PricingPage: "Renders pricing plans from config"
    PricingPage->>ModelTooltip: "Renders ModelTooltip for Pro/Max/Team plans"
    ModelTooltip->>ModelSelector: "Fetches MODEL_CONFIG data"
    ModelSelector-->>ModelTooltip: "Returns model configurations"
    ModelTooltip->>ModelTooltip: "Processes and sorts models by tier"
    ModelTooltip->>TooltipProvider: "Wraps tooltip in provider"
    TooltipProvider-->>ModelTooltip: "Provides tooltip context"
    ModelTooltip-->>PricingPage: "Renders info icon next to model text"
    User->>ModelTooltip: "Hovers over info icon"
    ModelTooltip->>TooltipProvider: "Triggers tooltip display"
    TooltipProvider->>ModelTooltip: "Shows tooltip content"
    ModelTooltip-->>User: "Displays sorted list of 6 models with badges"
    User->>ModelTooltip: "Moves cursor away"
    ModelTooltip->>TooltipProvider: "Triggers tooltip hide"
    TooltipProvider-->>User: "Hides tooltip with animation"
Loading

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +17 to +32
const sortedModels = models.sort((a, b) => {
// Free models (no requirements) first
if (!a.requiresPro && !a.requiresStarter && (b.requiresPro || b.requiresStarter)) return -1;
if (!b.requiresPro && !b.requiresStarter && (a.requiresPro || a.requiresStarter)) return 1;

// Then starter models
if (a.requiresStarter && !b.requiresStarter && !b.requiresPro) return 1;
if (b.requiresStarter && !a.requiresStarter && !a.requiresPro) return -1;

// Then pro models
if (a.requiresPro && !b.requiresPro) return 1;
if (b.requiresPro && !a.requiresPro) return -1;

// Within same tier, sort alphabetically
return a.displayName.localeCompare(b.displayName);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The sorting logic is complex and may not behave as expected - models with requiresStarter will be placed after free models but the logic on lines 23-24 seems reversed

Suggested change
const sortedModels = models.sort((a, b) => {
// Free models (no requirements) first
if (!a.requiresPro && !a.requiresStarter && (b.requiresPro || b.requiresStarter)) return -1;
if (!b.requiresPro && !b.requiresStarter && (a.requiresPro || a.requiresStarter)) return 1;
// Then starter models
if (a.requiresStarter && !b.requiresStarter && !b.requiresPro) return 1;
if (b.requiresStarter && !a.requiresStarter && !a.requiresPro) return -1;
// Then pro models
if (a.requiresPro && !b.requiresPro) return 1;
if (b.requiresPro && !a.requiresPro) return -1;
// Within same tier, sort alphabetically
return a.displayName.localeCompare(b.displayName);
});
const sortedModels = models.sort((a, b) => {
// Free models (no requirements) first
if (!a.requiresPro && !a.requiresStarter && (b.requiresPro || b.requiresStarter)) return -1;
if (!b.requiresPro && !b.requiresStarter && (a.requiresPro || a.requiresStarter)) return 1;
// Then starter models
if (a.requiresStarter && !b.requiresStarter && !b.requiresPro) return -1;
if (b.requiresStarter && !a.requiresStarter && !a.requiresPro) return 1;
// Then pro models
if (a.requiresPro && !b.requiresPro) return 1;
if (b.requiresPro && !a.requiresPro) return -1;
// Within same tier, sort alphabetically
return a.displayName.localeCompare(b.displayName);
});
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/components/ModelTooltip.tsx
Line: 17:32

Comment:
**logic:** The sorting logic is complex and may not behave as expected - models with requiresStarter will be placed after free models but the logic on lines 23-24 seems reversed

```suggestion
  const sortedModels = models.sort((a, b) => {
    // Free models (no requirements) first
    if (!a.requiresPro && !a.requiresStarter && (b.requiresPro || b.requiresStarter)) return -1;
    if (!b.requiresPro && !b.requiresStarter && (a.requiresPro || a.requiresStarter)) return 1;

    // Then starter models
    if (a.requiresStarter && !b.requiresStarter && !b.requiresPro) return -1;
    if (b.requiresStarter && !a.requiresStarter && !a.requiresPro) return 1;

    // Then pro models
    if (a.requiresPro && !b.requiresPro) return 1;
    if (b.requiresPro && !a.requiresPro) return -1;

    // Within same tier, sort alphabetically
    return a.displayName.localeCompare(b.displayName);
  });
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8772564 and faebf6c.

📒 Files selected for processing (2)
  • frontend/src/components/ModelTooltip.tsx (1 hunks)
  • frontend/src/config/pricingConfig.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js,jsx}: Use 2-space indentation, double quotes, and a 100-character line limit for formatting
Use camelCase for variable and function names
Use try/catch with specific error types for error handling

Files:

  • frontend/src/config/pricingConfig.tsx
  • frontend/src/components/ModelTooltip.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use strict TypeScript typing and avoid any when possible

Files:

  • frontend/src/config/pricingConfig.tsx
  • frontend/src/components/ModelTooltip.tsx
🧬 Code graph analysis (2)
frontend/src/config/pricingConfig.tsx (1)
frontend/src/components/ModelTooltip.tsx (1)
  • ModelTooltip (5-72)
frontend/src/components/ModelTooltip.tsx (1)
frontend/src/components/ModelSelector.tsx (1)
  • MODEL_CONFIG (27-81)
⏰ 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: build-macos (universal-apple-darwin)
  • GitHub Check: build-linux
  • GitHub Check: build-android
  • GitHub Check: build-ios

Comment on lines +1 to +2
import { Info } from "lucide-react";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add the 'use client' directive.

Tooltip, TooltipTrigger, and friends are client components. Without the 'use client' pragma, Next.js treats ModelTooltip as a server component and bails out with “Attempted to import the client component ... into a server component.” Please mark this file as a client component.

+'use client';
+
 import { Info } from "lucide-react";
 import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Info } from "lucide-react";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
'use client';
import { Info } from "lucide-react";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
🤖 Prompt for AI Agents
In frontend/src/components/ModelTooltip.tsx around lines 1-2, this file imports
Tooltip and related client components but lacks the 'use client' directive; add
a top-of-file "use client" pragma as the very first line so Next.js treats
ModelTooltip as a client component and the imports of Tooltip, TooltipTrigger,
etc. succeed.

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.

Show available models in a tooltip on the pricing page

2 participants