Skip to content

Conversation

oscartbeaumont
Copy link
Member

@oscartbeaumont oscartbeaumont commented Oct 10, 2025

Summary by CodeRabbit

  • New Features

    • None
  • Bug Fixes

    • Duplicate Cap action is now correctly disabled while a duplicate is in progress or when the cap has an active upload, preventing unintended actions.
  • Refactor

    • Removed the beta toggle for upload progress; behavior is now consistent for all users.
    • Simplified upload progress handling to rely on explicit enablement where displayed, with no visual changes expected.

Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Removes the enableUploadProgress feature flag and its UI, updates CapCard duplicate disable logic to depend on mutation state or active upload, and simplifies the upload progress hook to use a direct enabled parameter without feature-flag gating.

Changes

Cohort / File(s) Summary of Changes
Feature flag removal
apps/web/app/Layout/features.ts, apps/web/app/Layout/providers.tsx
Deleted default feature flag key (enableUploadProgress) and commented out its UI controls in CapDevtools; feature loading/persistence remains unchanged.
Cap card menu behavior
apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx
Removed feature-flag hook and updated Duplicate Cap disabled condition to `duplicateMutation.isPending
Upload progress hook
apps/web/app/s/[videoId]/_components/ProgressCircle.tsx
Changed hook signature to (videoId, enabled); removed feature-flag gating; query enablement and short-circuiting now rely solely on the provided enabled boolean.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CapCard
  participant Backend as API

  User->>CapCard: Open • Action Menu
  rect rgba(200,240,255,0.25)
    note over CapCard: Disable "Duplicate" if pending or active upload
    CapCard->>CapCard: disabled = duplicateMutation.isPending || cap.hasActiveUpload
  end
  User->>CapCard: Click Duplicate
  alt not disabled
    CapCard->>Backend: duplicateCap(capId)
    Backend-->>CapCard: mutation result
  else disabled
    CapCard-->>User: No action (disabled)
  end
Loading
sequenceDiagram
  autonumber
  participant Page
  participant Hook as useUploadProgress
  participant API

  Page->>Hook: call(videoId, enabled)
  alt enabled == true
    Hook->>API: fetch upload progress (poll via refetchInterval)
    API-->>Hook: progress data
    Hook-->>Page: UploadProgress | null
  else enabled == false
    Hook-->>Page: null
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Brendonovich

Poem

In burrows of code I hop and pry,
Flags once waved now drift on by.
A duplicate waits—if uploads sleep—
Progress polls where signals keep.
With toggles trimmed and flows made clear,
Thump-thump! I ship without a fear. 🐇✨

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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately describes the main change by indicating that upload progress is now enabled in the web application and aligns with the modifications to remove feature-flag gating across the codebase.
✨ 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 enable-upload-progress-web

📜 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 4ed9088 and 629a24e.

📒 Files selected for processing (4)
  • apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx (1 hunks)
  • apps/web/app/Layout/features.ts (1 hunks)
  • apps/web/app/Layout/providers.tsx (2 hunks)
  • apps/web/app/s/[videoId]/_components/ProgressCircle.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
apps/web/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/web/**/*.{ts,tsx}: Use TanStack Query v5 for all client-side server state and data fetching in the web app
Web mutations should call Server Actions directly and perform targeted cache updates with setQueryData/setQueriesData rather than broad invalidations
Client code should use useEffectQuery/useEffectMutation and useRpcClient from apps/web/lib/EffectRuntime.ts; do not create ManagedRuntime inside components

Files:

  • apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx
  • apps/web/app/Layout/providers.tsx
  • apps/web/app/s/[videoId]/_components/ProgressCircle.tsx
  • apps/web/app/Layout/features.ts
apps/web/app/**/*.{tsx,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

Prefer Server Components for initial data in the Next.js App Router and pass initialData to client components

Files:

  • apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx
  • apps/web/app/Layout/providers.tsx
  • apps/web/app/s/[videoId]/_components/ProgressCircle.tsx
  • apps/web/app/Layout/features.ts
**/*.{ts,tsx,js,jsx,rs}

📄 CodeRabbit inference engine (CLAUDE.md)

Do not add inline, block, or docstring comments in any language; code must be self-explanatory

Files:

  • apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx
  • apps/web/app/Layout/providers.tsx
  • apps/web/app/s/[videoId]/_components/ProgressCircle.tsx
  • apps/web/app/Layout/features.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use strict TypeScript and avoid any; leverage shared types from packages

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

Files:

  • apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx
  • apps/web/app/Layout/providers.tsx
  • apps/web/app/s/[videoId]/_components/ProgressCircle.tsx
  • apps/web/app/Layout/features.ts
**/*.{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/(org)/dashboard/caps/components/CapCard/CapCard.tsx
  • apps/web/app/Layout/providers.tsx
  • apps/web/app/s/[videoId]/_components/ProgressCircle.tsx
  • apps/web/app/Layout/features.ts
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/(org)/dashboard/caps/components/CapCard/CapCard.tsx
  • apps/web/app/Layout/providers.tsx
  • apps/web/app/s/[videoId]/_components/ProgressCircle.tsx
  • apps/web/app/Layout/features.ts
🧬 Code graph analysis (1)
apps/web/app/s/[videoId]/_components/ProgressCircle.tsx (1)
packages/web-domain/src/Video.ts (3)
  • Video (16-59)
  • VideoId (12-12)
  • VideoId (13-13)
⏰ 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 (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (3)
apps/web/app/Layout/features.ts (1)

3-3: LGTM!

Removing the enableUploadProgress flag from the default feature flags correctly eliminates the feature-flag gating as intended by the PR.

apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx (1)

464-464: LGTM!

The duplicate button disable logic correctly depends on mutation state and active upload status without feature-flag gating.

apps/web/app/s/[videoId]/_components/ProgressCircle.tsx (1)

26-63: LGTM!

The hook signature change correctly uses a direct enabled parameter without feature-flag gating. The query's enabled state, refetchInterval logic, and early return all properly utilize the provided parameter.


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.

@oscartbeaumont oscartbeaumont merged commit a6aee1d into main Oct 13, 2025
15 checks passed
@oscartbeaumont oscartbeaumont deleted the enable-upload-progress-web branch October 13, 2025 04:16
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