Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,13 @@ export function PlanUsageSettings() {
<Dialog.Content maxWidth="420px" size="2">
<Dialog.Title className="text-base">Upgrade to Pro</Dialog.Title>
<Dialog.Description color="gray" className="text-sm">
You are about to subscribe to the Pro plan. Your organization will
be charged $200/month starting immediately.
{seat?.organization_name ? (
<Text weight="medium">{seat.organization_name}</Text>
) : (
"Your organization"
)}{" "}
will be charged $200/month using the payment method on file in
PostHog.
</Dialog.Description>
Comment on lines 355 to 363
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 The suffix "will be charged $200/month using the payment method on file in PostHog." is identical in both branches, violating the OnceAndOnlyOnce simplicity rule. Factor out just the subject so the shared tail is expressed once.

Suggested change
<Dialog.Description color="gray" className="text-sm">
You are about to subscribe to the Pro plan. Your organization will
be charged $200/month starting immediately.
{seat?.organization_name ? (
<>
<Text weight="medium">{seat.organization_name}</Text> will be
charged $200/month using the payment method on file in PostHog.
</>
) : (
"Your organization will be charged $200/month using the payment method on file in PostHog."
)}
</Dialog.Description>
<Dialog.Description color="gray" className="text-sm">
{seat?.organization_name ? (
<Text weight="medium">{seat.organization_name}</Text>
) : (
"Your organization"
)}{" "}
will be charged $200/month using the payment method on file in
PostHog.
</Dialog.Description>
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/settings/components/sections/PlanUsageSettings.tsx
Line: 355-364

Comment:
The suffix "will be charged $200/month using the payment method on file in PostHog." is identical in both branches, violating the OnceAndOnlyOnce simplicity rule. Factor out just the subject so the shared tail is expressed once.

```suggestion
          <Dialog.Description color="gray" className="text-sm">
            {seat?.organization_name ? (
              <Text weight="medium">{seat.organization_name}</Text>
            ) : (
              "Your organization"
            )}{" "}
            will be charged $200/month using the payment method on file in
            PostHog.
          </Dialog.Description>
```

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!

<Flex direction="column" gap="2" mt="3">
<Flex align="center" gap="2">
Expand All @@ -370,6 +375,19 @@ export function PlanUsageSettings() {
<Text className="text-sm">All Claude and Codex models</Text>
</Flex>
</Flex>
<Flex
align="start"
gap="2"
mt="3"
p="3"
className="rounded-(--radius-2) bg-(--gray-2)"
>
<Info size={14} className="mt-[2px] shrink-0 text-(--gray-9)" />
<Text className="text-(--gray-11) text-[13px]">
Your first charge is prorated for the remainder of the current
billing cycle, then $200/month thereafter.
</Text>
</Flex>
<Flex justify="end" gap="3" mt="4">
<Dialog.Close>
<Button variant="soft" color="gray" size="2">
Expand Down
Loading