Skip to content

Conversation

@apsinghdev
Copy link
Owner

@apsinghdev apsinghdev commented Nov 16, 2025

Summary by CodeRabbit

  • New Features

    • Visual active-status badge for premium subscribers
    • Per-module rows with completion checkboxes, progress bar, and per-row actions (read/video, download PDF, share)
  • UI Improvements

    • "Coming Soon" label shortened to "Soon"
    • Shortened module title for clearer display
    • Layout and copy refinements for readability and responsiveness

@vercel
Copy link

vercel bot commented Nov 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
opensox-web Ready Ready Preview Comment Nov 16, 2025 11:29am
opensox-website Ready Ready Preview Comment Nov 16, 2025 11:29am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 16, 2025

Walkthrough

Adds Next.js build optimizations, introduces an ActiveTag UI component, refactors account and sheet pages to use memoized internal components and hooks for performance, tweaks a module label, and configures subscription query caching.

Changes

Cohort / File(s) Summary
Build Configuration
apps/web/next.config.js
Added experimental.optimizePackageImports: ['lucide-react','@heroicons/react'] and enabled swcMinify: true.
New UI Component
apps/web/src/components/ui/ActiveTag.tsx
New exported ActiveTag component (props: className, text) rendering a styled inline badge.
Dashboard — Account Page
apps/web/src/app/(main)/dashboard/account/page.tsx
Extracted memoized AccountPageContent, centralized plan calculation via useMemo, and conditionally renders ActiveTag for paid users.
Dashboard — Sheet Page
apps/web/src/app/(main)/dashboard/sheet/page.tsx
Added memoized SheetTableRow, applied useMemo/useCallback for totals and handlers, added per-row isPaidUser badge logic, comingSoon gating, progress bar and download/share handlers with optimized query caching flows.
Module Detail
apps/web/src/app/(main)/sheet/[moduleId]/page.tsx
Changed Coming Soon badge text from "Coming Soon" to "Soon".
Data
apps/web/src/data/sheet/module-8.ts
Shortened exported module8.name from "Adhoc: How to learn anything fast while contributing?" to "Adhoc: How to learn anything fast?".
Hooks / Queries
apps/web/src/hooks/useSubscription.ts
Added tRPC query options: staleTime: 5 minutes, gcTime/cacheTime: 10 minutes for subscription status caching.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Sheet Page (UI)
  participant Row as SheetTableRow (memo)
  participant Hook as useSubscription / tRPC
  participant API as Backend tRPC

  rect rgb(220,235,255)
    Note right of UI: Page renders\n(useMemo totals, handlers)
  end

  UI->>Hook: query subscriptionStatus (cached)
  Hook->>API: fetch subscriptionStatus (if stale)
  API-->>Hook: subscription data
  Hook-->>UI: isPaidUser

  UI->>Row: render rows with isPaidUser, handlers
  Row->>Hook: mutate completedSteps (on checkbox)
  Hook->>API: mutation (onMutate -> optimistic update)
  API-->>Hook: mutation result
  Hook-->>Row: settled (revalidate/update)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus review on apps/web/src/app/(main)/dashboard/sheet/page.tsx (memoization correctness, handler dependencies, mutation optimistic update logic).
  • Verify AccountPageContent memoization scope and correct conditional rendering of ActiveTag.
  • Confirm subscription caching values in apps/web/src/hooks/useSubscription.ts align with intended freshness and cache retention.

Possibly related PRs

  • auto onboarding #131: Related subscription/payment work that touches payment flows, subscription models, and the useSubscription hook used here.

Poem

🐰 I hopped through pages, neat and spry,
Trimmed imports, gave components a try,
Memos stitched, ActiveTags gleam bright,
Cached subscriptions hold through the night,
A little rabbit cheers: code runs light! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The PR title 'ui: make sheet mob. responsive' is vague and unclear. While it attempts to reference sheet-related UI changes, the abbreviated 'mob.' is ambiguous and the title does not accurately reflect the substantial changes made across multiple files including performance optimizations, new components (ActiveTag), configuration updates, and content modifications. Consider using a more descriptive title such as 'ui: optimize sheet page with memoization and responsive improvements' or 'refactor: add performance optimizations and UI enhancements to sheet pages' to better reflect the comprehensive nature of the changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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 chore/fix-sheet

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a8f58f and bba2b43.

📒 Files selected for processing (1)
  • apps/web/src/hooks/useSubscription.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/hooks/useSubscription.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/src/data/sheet/module-8.ts (1)

5-9: Fix title inconsistency in docContent.

The module name was shortened to "Adhoc: How to learn anything fast?" but the docContent header on Line 7 still contains the old title "Adhoc: How to learn anything fast while contributing?". These should match for consistency.

Apply this diff to align the titles:

  docContent: `
-     <h1>Adhoc: How to learn anything fast while contributing?</h1>
+     <h1>Adhoc: How to learn anything fast?</h1>
      <p>Strategies and techniques for learning quickly while actively contributing to OPEN SOURCE projects.</p>
    `,
🧹 Nitpick comments (4)
apps/web/next.config.js (1)

15-18: LGTM! Consider removing redundant swcMinify.

The optimizePackageImports configuration is a valid optimization for tree-shaking icon libraries. However, swcMinify: true has been the default since Next.js 13 and is redundant in Next.js 15.

Apply this diff to remove the redundant setting:

  experimental: {
    optimizePackageImports: ['lucide-react', '@heroicons/react'],
  },
- swcMinify: true,
apps/web/src/components/ui/ActiveTag.tsx (1)

1-23: Consider using theme variables instead of hardcoded colors.

The component uses hardcoded hex values (#002d21, #00bd7c) for colors. For better maintainability and consistency with the design system, consider using CSS variables or Tailwind theme colors.

If theme variables exist for these colors (e.g., ox-active-bg, ox-active-text), refactor to use them:

  <span
    className={cn(
      "inline-flex items-center justify-center",
      "px-2 py-0.5 rounded-lg",
-     "bg-[#002d21] text-[#00bd7c]",
+     "bg-ox-active-bg text-ox-active-text",
      "text-xs font-sm",
-     "border border-[#00bd7c]",
+     "border border-ox-active-text",
      className
    )}
  >
    {text}
  </span>

Otherwise, define these colors in your Tailwind config for reusability.

apps/web/src/app/(main)/dashboard/account/page.tsx (1)

9-54: LGTM! Consider simplifying plan calculation.

The memoization pattern is good, but the useMemo for the plan variable (Line 14) is unnecessary overhead for a simple ternary operation. Direct computation would be more efficient.

Apply this diff to simplify:

-  const plan = useMemo(() => (isPaidUser ? "Pro" : "Free"), [isPaidUser]);
+  const plan = isPaidUser ? "Pro" : "Free";
apps/web/src/app/(main)/dashboard/sheet/page.tsx (1)

203-314: LGTM! Proper memoization patterns.

The callback memoization prevents unnecessary re-renders of child components. All dependency arrays are correctly specified.

Minor optimization: totalModules on Line 218 could be a simple constant since sheetModules.length doesn't change:

-const totalModules = useMemo(() => sheetModules.length, []);
+const totalModules = sheetModules.length;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae9a14 and 1a8f58f.

📒 Files selected for processing (7)
  • apps/web/next.config.js (1 hunks)
  • apps/web/src/app/(main)/dashboard/account/page.tsx (1 hunks)
  • apps/web/src/app/(main)/dashboard/sheet/page.tsx (8 hunks)
  • apps/web/src/app/(main)/sheet/[moduleId]/page.tsx (1 hunks)
  • apps/web/src/components/ui/ActiveTag.tsx (1 hunks)
  • apps/web/src/data/sheet/module-8.ts (1 hunks)
  • apps/web/src/hooks/useSubscription.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
apps/web/src/app/(main)/dashboard/account/page.tsx (2)
apps/web/src/components/ui/ActiveTag.tsx (1)
  • ActiveTag (8-23)
apps/web/src/hooks/useSubscription.ts (1)
  • useSubscription (11-77)
apps/web/src/components/ui/ActiveTag.tsx (2)
apps/web/src/lib/utils.ts (1)
  • cn (4-6)
apps/web/src/components/ui/badge.tsx (2)
  • Badge (30-34)
  • BadgeProps (26-28)
apps/web/src/app/(main)/dashboard/sheet/page.tsx (7)
apps/web/src/data/sheet/types.ts (1)
  • SheetModule (1-7)
apps/web/src/data/sheet/sheet.ts (2)
  • SheetModule (35-35)
  • sheetModules (36-69)
apps/web/src/components/icons/icons.tsx (1)
  • Youtube (200-202)
apps/web/src/components/ui/ActiveTag.tsx (1)
  • ActiveTag (8-23)
apps/web/src/components/sheet/OpensoxProBadge.tsx (1)
  • OpensoxProBadge (8-28)
apps/web/src/hooks/useSubscription.ts (1)
  • useSubscription (11-77)
apps/web/src/components/sheet/ProgressBar.tsx (1)
  • ProgressBar (11-64)
🔇 Additional comments (5)
apps/web/src/app/(main)/sheet/[moduleId]/page.tsx (1)

178-178: LGTM! Mobile-friendly text improvement.

The shortened badge text "Soon" is more appropriate for mobile displays while maintaining clarity.

apps/web/src/app/(main)/dashboard/sheet/page.tsx (4)

3-24: LGTM! Well-organized imports.

The additional imports support the memoization strategy and new ActiveTag component, aligning with the performance optimization goals of this PR.


26-33: LGTM! Column definitions updated.

The table columns are appropriately defined with the "Live Sessions" column added for the new isPaidUser feature.


35-131: LGTM! Well-structured memoized row component.

The SheetTableRow memo optimization is excellent for list rendering performance. The component properly handles:

  • Coming Soon state with appropriate disabled/visual states
  • Conditional rendering based on isPaidUser
  • Proper prop typing and event handling

329-424: LGTM! Mobile-responsive layout improvements.

The responsive width constraints and minimum table widths ensure proper rendering across device sizes. The custom scrollbar styling enhances the mobile experience while maintaining desktop usability.

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.

2 participants