Skip to content

Conversation

@ameer2468
Copy link
Collaborator

@ameer2468 ameer2468 commented Oct 22, 2025

Summary by CodeRabbit

  • New Features

    • Share and sidebar now surface the video owner's Pro status so the summary view and restricted "Unlock Cap AI" path reflect that status.
  • Refactor

    • Propagation of owner Pro status standardized across share, sidebar, and summary components.
  • Bug Fix

    • Share header visibility now depends on ownership, fixing who sees the header block.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

Threads an ownerIsPro boolean from page.tsxShareSidebarSummary, adds ownerIsPro to public component props, removes local owner/pro computations in Sidebar, and switches Summary/ShareHeader rendering gates to use the passed ownerIsPro.

Changes

Cohort / File(s) Summary
Page & Share plumbing
apps/web/app/s/[videoId]/page.tsx, apps/web/app/s/[videoId]/Share.tsx
Add ownerIsPro: boolean to assembled video info in page.tsx; extend ShareProps with ownerIsPro?: boolean and forward it to Sidebar.
Sidebar prop updates
apps/web/app/s/[videoId]/_components/Sidebar.tsx
Add ownerIsPro?: boolean to SidebarProps; remove local owner/pro computations (isOwner, isVideoOwnerPro) and forward ownerIsPro to Summary.
Summary prop rename
apps/web/app/s/[videoId]/_components/tabs/Summary.tsx
Replace `isVideoOwnerPro: boolean
Share header guard change
apps/web/app/s/[videoId]/_components/ShareHeader.tsx
Change top-level rendering guard to use ownership (isOwner) instead of user !== null, modifying visibility conditions tied to owner/pro status.

Sequence Diagram

sequenceDiagram
    participant Page as page.tsx
    participant Share as Share.tsx
    participant Sidebar as Sidebar.tsx
    participant Summary as Summary.tsx

    rect rgba(248,249,250,0.8)
    Page->>Share: pass ownerIsPro (from videoWithOrganizationInfo)
    end

    rect rgba(248,249,250,0.8)
    Share->>Sidebar: forward ownerIsPro
    end

    rect rgba(238,246,255,0.9)
    Sidebar->>Summary: forward ownerIsPro
    Summary->>Summary: use ownerIsPro for render gating (unlock/restricted UI)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hop props down the sunny row,
ownerIsPro tucked where data go.
From page to Share, then Sidebar's cheer,
Summary listens — the path is clear. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “web: improve owner check” accurately reflects the primary goal of this changeset, which updates the owner-check logic by introducing and propagating the ownerIsPro flag and refining render guards across Share, Sidebar, Summary, and ShareHeader components. It is concise and directly related to the main changes implemented.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 get-owner-from-db

📜 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 5cea4c7 and f4d2fab.

📒 Files selected for processing (1)
  • apps/web/app/s/[videoId]/_components/ShareHeader.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use a 2-space indent for TypeScript code.
Use Biome for formatting and linting TypeScript/JavaScript files by running pnpm format.

Use strict TypeScript and avoid any; leverage shared types

Files:

  • apps/web/app/s/[videoId]/_components/ShareHeader.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use kebab-case for filenames for TypeScript/JavaScript modules (e.g., user-menu.tsx).
Use PascalCase for React/Solid components.

Files:

  • apps/web/app/s/[videoId]/_components/ShareHeader.tsx
apps/web/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

On the client, always use useEffectQuery or useEffectMutation from @/lib/EffectRuntime; never call EffectRuntime.run* directly in components.

Files:

  • apps/web/app/s/[videoId]/_components/ShareHeader.tsx
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/web/**/*.{ts,tsx}: Use TanStack Query v5 for all client-side server state and fetching in the web app
Mutations should call Server Actions directly and perform targeted cache updates with setQueryData/setQueriesData
Run server-side effects via the ManagedRuntime from apps/web/lib/server.ts using EffectRuntime.runPromise/runPromiseExit; do not create runtimes ad hoc
Client code should use helpers from apps/web/lib/EffectRuntime.ts (useEffectQuery, useEffectMutation, useRpcClient); never call ManagedRuntime.make inside components

Files:

  • apps/web/app/s/[videoId]/_components/ShareHeader.tsx
apps/web/app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Server components needing Effect services must call EffectRuntime.runPromise(effect.pipe(provideOptionalAuth))

Files:

  • apps/web/app/s/[videoId]/_components/ShareHeader.tsx
⏰ 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). (3)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Analyze (rust)

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.

@ameer2468 ameer2468 merged commit 3e0b703 into main Oct 22, 2025
13 of 15 checks passed
@ameer2468 ameer2468 deleted the get-owner-from-db branch October 22, 2025 21:43
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