Skip to content

Conversation

@mfts
Copy link
Owner

@mfts mfts commented Oct 4, 2025

Summary by CodeRabbit

  • New Features

    • Enables the Agreement option for Business workspaces when allowed by your plan.
    • Availability of the Agreement section now accurately reflects your subscription limits.
  • Bug Fixes

    • Corrects permission checks so Agreement features only appear when your plan supports them.

@vercel
Copy link

vercel bot commented Oct 4, 2025

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

Project Deployment Preview Comments Updated (UTC)
papermark Ready Ready Preview Comment Oct 4, 2025 6:43pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 4, 2025

Walkthrough

Adds a new nullable boolean limit agreementOnBusiness to limits schema and server config, derives allowAgreementOnBusiness in link options, and switches AgreementSection gating to this new flag.

Changes

Cohort / File(s) Summary
Limits schema updates
ee/limits/constants.ts, ee/limits/server.ts
Introduce nullable boolean field agreementOnBusiness to TPlanLimits and configSchema (z.boolean().nullish()), expanding plan/config limits without altering other fields.
UI usage update
components/links/link-sheet/link-options.tsx
Derives allowAgreementOnBusiness from limits?.agreementOnBusiness ?? false and replaces AgreementSection isAllowed check from allowWatermarkOnBusiness to allowAgreementOnBusiness.

Pre-merge checks

✅ 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 succinctly and accurately describes the primary change, which is adding an agreement flag to the limits configuration, and aligns with the modifications to the limits schema and related components. It uses conventional commit style and is both concise and clear without unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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

🧹 Nitpick comments (1)
ee/limits/constants.ts (1)

13-13: Verify default behavior for plan limits.

The agreementOnBusiness field is added to the type but not set in any of the exported plan constants (FREE_PLAN_LIMITS, PRO_PLAN_LIMITS, BUSINESS_PLAN_LIMITS, etc.). This means:

  • The field will be undefined for all plans unless explicitly configured in the database
  • Combined with the ?? false default in link-options.tsx (line 105), the agreement feature will be disabled by default for all plans

If certain plans (e.g., Business, Data Rooms) should have this feature enabled by default, consider adding it to their respective plan constants:

 export const BUSINESS_PLAN_LIMITS = {
   users: 3,
   links: null,
   documents: null,
   domains: 5,
   datarooms: 100,
   customDomainOnPro: true,
   customDomainInDataroom: false,
   advancedLinkControlsOnPro: false,
+  agreementOnBusiness: true,
   fileSizeLimits: {
     maxFiles: 500,
   },
 };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55dc8e3 and e2a6420.

📒 Files selected for processing (3)
  • components/links/link-sheet/link-options.tsx (2 hunks)
  • ee/limits/constants.ts (1 hunks)
  • ee/limits/server.ts (1 hunks)
🔇 Additional comments (3)
ee/limits/server.ts (1)

45-45: LGTM!

The schema definition is consistent with the existing watermarkOnBusiness pattern and correctly uses z.boolean().nullish() to allow null or undefined values.

components/links/link-sheet/link-options.tsx (2)

105-105: LGTM!

The flag derivation follows the same pattern as allowWatermarkOnBusiness on line 104 and correctly defaults to false when the limit is not set.


217-221: Verify migration for existing teams

AgreementSection now gates on allowAgreementOnBusiness instead of allowWatermarkOnBusiness. Both flags come from the limits JSON field, so teams with watermarkOnBusiness currently enabled will lose agreement access unless you backfill agreementOnBusiness. Confirm:

  1. A backfill or migration exists to set agreementOnBusiness: true for teams where watermarkOnBusiness: true.
  2. Or the change is intentional and teams should opt in again.

@mfts mfts merged commit 2abc67e into main Oct 4, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2025
@mfts mfts deleted the feat/limts branch November 19, 2025 11:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants