Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

docs(agents): add "Pricing" page to agents docs - #1134

Draft
jainpawan21 wants to merge 3 commits into
mainfrom
DOC-363
Draft

docs(agents): add "Pricing" page to agents docs#1134
jainpawan21 wants to merge 3 commits into
mainfrom
DOC-363

Conversation

@jainpawan21

@jainpawan21 jainpawan21 commented Jun 23, 2026

Copy link
Copy Markdown
Member

Greptile Summary

This PR adds a new "Pricing" documentation page for Novu Connect under the agents section, along with an interactive ConnectPricingCalculator React component that lets users estimate monthly costs by plan and conversation volume.

  • pricing.mdx: Comprehensive new page covering plan tiers, active conversation billing semantics, per-platform counting rules, and an FAQ section — all consistent with each other.
  • pricing-calculator.tsx: Client component with plan selector, conversation slider/number input, and a live estimate breakdown. The formatCurrency helper caps at 2 decimal places, which silently rounds the Team plan's $0.015 overage rate down to $0.01 for users.
  • meta.json: Registers the new page under a "Pricing" sidebar section in the agents navigation.

Confidence Score: 4/5

Safe to merge with one fix recommended: the Team plan overage rate displays as $0.01 instead of $0.015 in the calculator hint text.

The documentation content is accurate and well-structured. The calculator component works correctly for most scenarios, but formatCurrency with maximumFractionDigits: 2 mis-displays the Team plan's three-decimal overage rate, showing users $0.01/conversation instead of the correct $0.015/conversation. This is live pricing information in a docs page, so the wrong rate is worth fixing before shipping.

src/components/agents/pricing-calculator.tsx — specifically the formatCurrency function and the auto-switch thresholds.

Important Files Changed

Filename Overview
src/components/agents/pricing-calculator.tsx New interactive pricing calculator component. Contains a bug where formatCurrency with maximumFractionDigits: 2 mis-displays the Team plan's $0.015 overage rate as $0.01. Also has a missing label association for the number input and auto-switching logic that can override explicit plan selection.
content/docs/agents/pricing.mdx New pricing documentation page covering plans, active conversations, per-platform billing behaviour, and FAQ. Content is thorough and consistent with the pricing table data.
content/docs/agents/meta.json Adds a 'Pricing' navigation section with the new pricing page to the agents sidebar.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User changes conversation count] --> B[Clamp to 0–20,000]
    B --> C[setConversations]
    B --> D{Current plan?}
    D -- free AND value > 300 --> E[Switch to Pro]
    D -- pro/team AND value < 100 --> F[Switch to Free]
    D -- otherwise --> G[Keep current plan]
    E & F & G --> H[Re-compute estimate via useMemo]
    H --> I{Free plan over limit?}
    I -- yes --> J[Show cap warning]
    I -- no --> K{Paid plan with overage?}
    K -- yes --> L[Show overage hint\n⚠️ formatCurrency 0.015 → $0.01]
    K -- no --> M[Show clean total]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User changes conversation count] --> B[Clamp to 0–20,000]
    B --> C[setConversations]
    B --> D{Current plan?}
    D -- free AND value > 300 --> E[Switch to Pro]
    D -- pro/team AND value < 100 --> F[Switch to Free]
    D -- otherwise --> G[Keep current plan]
    E & F & G --> H[Re-compute estimate via useMemo]
    H --> I{Free plan over limit?}
    I -- yes --> J[Show cap warning]
    I -- no --> K{Paid plan with overage?}
    K -- yes --> L[Show overage hint\n⚠️ formatCurrency 0.015 → $0.01]
    K -- no --> M[Show clean total]
Loading

Fix All in Cursor

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
src/components/agents/pricing-calculator.tsx:52-58
**`formatCurrency` truncates Team overage rate to wrong value**

`maximumFractionDigits: 2` causes `formatCurrency(0.015)` to render as `$0.01` instead of `$0.015`. In JavaScript, `0.015` is stored as `0.01499999...` in IEEE 754, so rounding to 2 decimal places floors to `$0.01` — a 33% understatement of the Team plan's per-conversation rate. This appears in the overage hint on line 228 when the Team plan is selected with extra conversations. `maximumFractionDigits` should be increased to `3` to accommodate this rate.

### Issue 2 of 3
src/components/agents/pricing-calculator.tsx:148-162
**Number input has no accessible label**

The `<label>` element's `htmlFor="connect-pricing-conversations"` points to the range slider, but the numeric `<input>` has `id="connect-pricing-conversations-input"` with no associated label. Screen readers will not announce the purpose of the number field when it receives focus.

### Issue 3 of 3
src/components/agents/pricing-calculator.tsx:91-101
**Auto-switching overrides manual Team plan selection unexpectedly**

When a user explicitly clicks Team and then drags the slider below 100, the plan silently resets to Free. There's also a one-way threshold inconsistency: Free auto-promotes to Pro at 300 conversations but Pro/Team never auto-promotes to Team — a user on the Pro plan with 5,001 conversations (above the Team threshold) simply sees growing overage instead of being guided toward Team. Both behaviours could confuse users trying to compare plans.

Reviews (1): Last reviewed commit: "docs(agents): enhance pricing documentat..." | Re-trigger Greptile

Greptile also left 3 inline comments on this PR.

@linear-code

linear-code Bot commented Jun 23, 2026

Copy link
Copy Markdown

DOC-363

@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for docs-novu ready!

Name Link
🔨 Latest commit b871a65
🔍 Latest deploy log https://app.netlify.com/projects/docs-novu/deploys/6a3a9edc0d4a960008537188
😎 Deploy Preview https://deploy-preview-1134--docs-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@merrcury
merrcury self-requested a review June 23, 2026 15:05
Comment on lines +52 to +58
function formatCurrency(value: number): string {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: value % 1 === 0 ? 0 : 2,
maximumFractionDigits: 2,
}).format(value);

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 formatCurrency truncates Team overage rate to wrong value

maximumFractionDigits: 2 causes formatCurrency(0.015) to render as $0.01 instead of $0.015. In JavaScript, 0.015 is stored as 0.01499999... in IEEE 754, so rounding to 2 decimal places floors to $0.01 — a 33% understatement of the Team plan's per-conversation rate. This appears in the overage hint on line 228 when the Team plan is selected with extra conversations. maximumFractionDigits should be increased to 3 to accommodate this rate.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/agents/pricing-calculator.tsx
Line: 52-58

Comment:
**`formatCurrency` truncates Team overage rate to wrong value**

`maximumFractionDigits: 2` causes `formatCurrency(0.015)` to render as `$0.01` instead of `$0.015`. In JavaScript, `0.015` is stored as `0.01499999...` in IEEE 754, so rounding to 2 decimal places floors to `$0.01` — a 33% understatement of the Team plan's per-conversation rate. This appears in the overage hint on line 228 when the Team plan is selected with extra conversations. `maximumFractionDigits` should be increased to `3` to accommodate this rate.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Cursor

Comment on lines +148 to +162
<label
htmlFor="connect-pricing-conversations"
className="text-sm font-medium text-fd-foreground"
>
Active conversations per billing cycle
</label>
<input
id="connect-pricing-conversations-input"
type="number"
min={0}
max={MAX_CONVERSATIONS}
value={conversations}
onChange={(event) => handleConversationsChange(Number(event.target.value))}
className="w-28 rounded-md border border-fd-border bg-fd-background px-2 py-1 text-right text-sm text-fd-foreground"
/>

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 Number input has no accessible label

The <label> element's htmlFor="connect-pricing-conversations" points to the range slider, but the numeric <input> has id="connect-pricing-conversations-input" with no associated label. Screen readers will not announce the purpose of the number field when it receives focus.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/agents/pricing-calculator.tsx
Line: 148-162

Comment:
**Number input has no accessible label**

The `<label>` element's `htmlFor="connect-pricing-conversations"` points to the range slider, but the numeric `<input>` has `id="connect-pricing-conversations-input"` with no associated label. Screen readers will not announce the purpose of the number field when it receives focus.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Cursor

Comment on lines +91 to +101
setSelectedPlanId((currentPlanId) => {
if (currentPlanId === 'free' && nextValue > FREE_TO_PRO_THRESHOLD) {
return 'pro';
}

if (
(currentPlanId === 'pro' || currentPlanId === 'team') &&
nextValue < PRO_TEAM_TO_FREE_THRESHOLD
) {
return 'free';
}

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 Auto-switching overrides manual Team plan selection unexpectedly

When a user explicitly clicks Team and then drags the slider below 100, the plan silently resets to Free. There's also a one-way threshold inconsistency: Free auto-promotes to Pro at 300 conversations but Pro/Team never auto-promotes to Team — a user on the Pro plan with 5,001 conversations (above the Team threshold) simply sees growing overage instead of being guided toward Team. Both behaviours could confuse users trying to compare plans.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/agents/pricing-calculator.tsx
Line: 91-101

Comment:
**Auto-switching overrides manual Team plan selection unexpectedly**

When a user explicitly clicks Team and then drags the slider below 100, the plan silently resets to Free. There's also a one-way threshold inconsistency: Free auto-promotes to Pro at 300 conversations but Pro/Team never auto-promotes to Team — a user on the Pro plan with 5,001 conversations (above the Team threshold) simply sees growing overage instead of being guided toward Team. Both behaviours could confuse users trying to compare plans.

How can I resolve this? If you propose a fix, please make it concise.

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!

Fix in Cursor

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.

1 participant