Skip to content

Shareable link limits - #2138

Merged
richiemcilroy merged 16 commits into
mainfrom
usage-limits
Aug 20, 2026
Merged

Shareable link limits#2138
richiemcilroy merged 16 commits into
mainfrom
usage-limits

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Aug 19, 2026

Copy link
Copy Markdown
Member

Capped amount of shareable link limits per month to reduce spam.

Greptile Summary

The PR introduces a free-plan monthly shareable-link allowance and consistently gates over-limit videos on both public share and embed surfaces.

  • Adds creation-order-based quota calculation and shared domain constants.
  • Displays current usage and upgrade messaging in the dashboard.
  • Adds owner/viewer-specific limit overlays and updates the Cap Pro upgrade experience.
  • Keeps over-limit links locked across month boundaries while granting a new allowance for videos created in each new month.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/web/lib/shareable-link-quota.ts Implements the creation-month quota ordering and current-month dashboard usage calculation consistently with the clarified anti-spam behavior.
apps/web/app/s/[videoId]/page.tsx Resolves the owner’s plan and quota state server-side before passing the result into the public share experience.
apps/web/app/embed/[videoId]/page.tsx Applies the same quota policy to embeds so they cannot bypass the share-page limit.
apps/web/app/s/[videoId]/_components/ShareVideo.tsx Replaces playback with the quota overlay for affected videos while preserving recording and processing states.
apps/web/components/UsageButton.tsx Adds the free-plan usage meter and explicitly distinguishes locked older links from the new monthly allowance.
apps/web/components/UpgradeModal.tsx Refreshes pricing presentation, feature messaging, keyboard behavior, and responsive layout without an accepted blocking issue.
packages/web-domain/src/Video.ts Defines the shared free-plan limit and non-retroactive enforcement date.

Reviews (2): Last reviewed commit: "style(web): drop redundant shareableLink..." | Re-trigger Greptile

Context used (3)

@superagent-security

Copy link
Copy Markdown

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

and(
eq(videos.ownerId, video.ownerId),
eq(videos.isScreenshot, false),
gte(videos.createdAt, quotaWindowStart(video.createdAt)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Creation-month quota never resets

When a video exceeds the allowance in its creation month, the quota check continues counting against that original month after later monthly resets, causing the video to remain locked while the dashboard reports a reset allowance.

Suggested change
gte(videos.createdAt, quotaWindowStart(video.createdAt)),
gte(videos.createdAt, quotaWindowStart(new Date())),
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/lib/shareable-link-quota.ts
Line: 41

Comment:
**Creation-month quota never resets**

When a video exceeds the allowance in its creation month, the quota check continues counting against that original month after later monthly resets, causing the video to remain locked while the dashboard reports a reset allowance.

```suggestion
				gte(videos.createdAt, quotaWindowStart(new Date())),
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is intentional. The cap is an anti-spam measure, so videos that exceed a month's allowance stay locked rather than unlocking when the month rolls over, otherwise a burst of spam links would all go live on the 1st. The monthly reset applies to newly created videos, and the dashboard copy now says this explicitly.

@@ -0,0 +1,84 @@
"use client";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Component filename breaks convention

The new PascalCase filename violates the repository-wide kebab-case convention, making component naming and discovery inconsistent with the required project structure.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/app/s/[videoId]/_components/ShareableLinkLimitOverlay.tsx
Line: 1

Comment:
**Component filename breaks convention**

The new PascalCase filename violates the repository-wide kebab-case convention, making component naming and discovery inconsistent with the required project structure.

**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

PascalCase filenames are the working convention for React component files in apps/web, including every component in this directory and recent additions across the app, so keeping this as is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for the correction. PascalCase is the right convention for component files in apps/web — I'll stop flagging that.

View rule

Comment thread apps/web/app/(org)/dashboard/DashboardContext.ts Outdated
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy merged commit aa10436 into main Aug 20, 2026
21 of 23 checks passed
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