Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Brendonovich
Copy link
Member

@Brendonovich Brendonovich commented Aug 25, 2025

Fixes/silences all typescript errors in @cap/web so that we can include it in typecheck CI

Summary by CodeRabbit

  • New Features

    • Added a visible loading state for video analytics.
    • Enhanced embed pages with additional video details and a password-protected indicator.
  • Improvements

    • Simplified AI status reporting for videos; removed obsolete error state handling.
    • More secure embeds by excluding password data while still signaling protection.
    • More accurate video duration display on thumbnails.
  • Bug Fixes

    • Prevented crashes when tool metadata tags are missing.
    • Increased media player stability with safer internal state handling.
    • Improved changelog parsing to ignore empty frontmatter keys.
  • Chores

    • Internal project configuration updates.

Copy link
Contributor

coderabbitai bot commented Aug 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removes generationError from AI metadata paths and API surface, adds hasPassword and video dimensions to embed/share queries, tightens IDs to Video.VideoId in several places, introduces optional analytics loading prop wiring, adds Dropdown container prop, adjusts types/utilities for safety, removes a hook, and updates tsconfig references.

Changes

Cohort / File(s) Summary
AI metadata status cleanup
apps/web/actions/videos/generate-ai-metadata.ts, apps/web/actions/videos/get-status.ts, apps/web/app/s/[videoId]/Share.tsx, apps/web/app/s/[videoId]/page.tsx, apps/web/scripts/reset-ai-processing-flags.ts
Removes reading/writing/returning of generationError; AI status now relies on transcriptionStatus, aiProcessing, aiTitle, summary, chapters. Related checks and updates are commented out or deleted.
Embed/share: hasPassword and media fields
apps/web/app/embed/[videoId]/page.tsx, apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx, apps/web/app/s/[videoId]/page.tsx
Queries now include width, height, duration, fps; computes hasPassword via SQL and passes it through. EmbedVideo’s data prop omits "password"; share page converts numeric hasPassword to boolean and removes NODE_ENV prop from ShareHeader usage.
Analytics loading prop wiring
apps/web/app/(org)/dashboard/folder/[id]/components/ClientCapCard.tsx, apps/web/app/s/[videoId]/_components/tabs/Activity/Analytics.tsx, apps/web/app/s/[videoId]/_components/tabs/Activity/index.tsx
Introduces and forwards isLoadingAnalytics through components; Activity sets it to false.
Typed identifiers and schema
packages/database/schema.ts, apps/web/app/s/[videoId]/Share.tsx, apps/web/app/embed/[videoId]/page.tsx
Adds Video type; videos.id column annotated as Video.VideoId; useVideoStatus and usages switch to Video.VideoId.
Ref and store robustness
apps/web/app/lib/compose-refs.ts, apps/web/app/s/[videoId]/_components/video/media-player.tsx
Broadens accepted ref types (LegacyRef); guards null refs in store subscribe/notify/get/set; uses non-null assertions where needed.
Dropdown portal targeting
packages/ui/src/components/Dropdown.tsx
Adds optional container prop to DropdownMenuContent and forwards it to Portal.
Tool content flexibility
apps/web/components/tools/types.ts, apps/web/app/(site)/tools/trim/metadata.ts
Makes several ToolPageContent fields optional (slug, publishedAt, category, author, tags); keywords now uses optional chaining on tags.
Upload API import cleanup
apps/web/app/api/upload/[...route]/multipart.ts
Removes unused type import; adjusts drizzle-orm imports to use and, eq.
Folder/shared spaces refactor
apps/web/lib/folder.ts
Refactors accumulation pattern; adds default "" for iconUrl.
Component prop adjustments
apps/web/app/s/[videoId]/_components/Toolbar.tsx, apps/web/app/s/[videoId]/_components/ShareHeader.tsx, apps/web/app/(org)/dashboard/spaces/[spaceId]/folder/[folderId]/page.tsx
Makes comment callbacks optional (guarded calls); removes NODE_ENV from ShareHeader props (uses module import); stops passing userId to FolderVideosSection.
Removals and minor tweaks
apps/web/app/(org)/dashboard/folder/[id]/components/useUploadPlaceholders.ts, apps/web/components/VideoThumbnail.tsx, apps/web/app/(org)/verify-otp/form.tsx, apps/web/app/s/page.tsx, apps/web/lib/effect-react-query.ts, tsconfig.json, apps/web/app/(org)/dashboard/folder/[id]/components/NewSubfolderButton.tsx, apps/web/utils/changelog.ts
Removes useUploadPlaceholders hook; fixes duration argument type; ref callback formatting; whitespace-only change; loosens options typing with any spread; adds apps/web to tsconfig references; parentFolderId typed as Folder.FolderId; changelog parser adds non-null assertion and empty-key guard.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Share Page UI
  participant API as getVideoStatus
  participant DB as DB

  UI->>API: Request video status (videoId: Video.VideoId)
  API->>DB: Fetch transcriptionStatus, aiProcessing, aiTitle, summary, chapters
  DB-->>API: Status data (no generationError)
  API-->>UI: {transcriptionStatus, aiProcessing, aiTitle, summary, chapters}

  rect rgba(200,230,255,0.3)
    note right of UI: Loading/UI logic uses fields above only
  end
Loading
sequenceDiagram
  autonumber
  participant Client as Embed/Share Request
  participant Server as Page Loader
  participant DB as DB

  Client->>Server: GET /embed/:videoId or /s/:videoId
  Server->>DB: Select video {width,height,duration,fps, ...}
  Server->>DB: Compute hasPassword = IF(password IS NULL, 0, 1)
  DB-->>Server: Video row (+ hasPassword)
  Server-->>Client: Rendered page (password omitted, hasPassword flag)
  note over Client,Server: Components receive data without password field
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

Thump-thump! I hop through code so bright,
Trimming errors out of sight,
Passwords hidden, flags made lean,
Analytics loading—calm and clean.
With tidy types and portals fair,
I nibble bugs with careful care. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 60e76c1 and e94ea61.

📒 Files selected for processing (29)
  • apps/web/actions/videos/generate-ai-metadata.ts (0 hunks)
  • apps/web/actions/videos/get-status.ts (10 hunks)
  • apps/web/app/(org)/dashboard/folder/[id]/components/ClientCapCard.tsx (1 hunks)
  • apps/web/app/(org)/dashboard/folder/[id]/components/NewSubfolderButton.tsx (1 hunks)
  • apps/web/app/(org)/dashboard/folder/[id]/components/useUploadPlaceholders.ts (0 hunks)
  • apps/web/app/(org)/dashboard/spaces/[spaceId]/folder/[folderId]/page.tsx (0 hunks)
  • apps/web/app/(org)/verify-otp/form.tsx (1 hunks)
  • apps/web/app/(site)/tools/trim/metadata.ts (1 hunks)
  • apps/web/app/api/upload/[...route]/multipart.ts (1 hunks)
  • apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx (1 hunks)
  • apps/web/app/embed/[videoId]/page.tsx (2 hunks)
  • apps/web/app/lib/compose-refs.ts (2 hunks)
  • apps/web/app/s/[videoId]/Share.tsx (4 hunks)
  • apps/web/app/s/[videoId]/_components/ShareHeader.tsx (1 hunks)
  • apps/web/app/s/[videoId]/_components/Toolbar.tsx (5 hunks)
  • apps/web/app/s/[videoId]/_components/tabs/Activity/Analytics.tsx (2 hunks)
  • apps/web/app/s/[videoId]/_components/tabs/Activity/index.tsx (1 hunks)
  • apps/web/app/s/[videoId]/_components/video/media-player.tsx (1 hunks)
  • apps/web/app/s/[videoId]/page.tsx (4 hunks)
  • apps/web/app/s/page.tsx (1 hunks)
  • apps/web/components/VideoThumbnail.tsx (1 hunks)
  • apps/web/components/tools/types.ts (1 hunks)
  • apps/web/lib/effect-react-query.ts (1 hunks)
  • apps/web/lib/folder.ts (2 hunks)
  • apps/web/scripts/reset-ai-processing-flags.ts (2 hunks)
  • apps/web/utils/changelog.ts (1 hunks)
  • packages/database/schema.ts (2 hunks)
  • packages/ui/src/components/Dropdown.tsx (1 hunks)
  • tsconfig.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-web-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
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@Brendonovich Brendonovich merged commit 055951f into main Aug 25, 2025
13 of 15 checks passed
@ameer2468 ameer2468 deleted the fix-web-ts branch August 25, 2025 13:06
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