Skip to content
Merged
Show file tree
Hide file tree
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
@@ -1,3 +1,4 @@
import { Badge } from "@superset/ui/badge";
import { Button } from "@superset/ui/button";
import { toast } from "@superset/ui/sonner";
import { Switch } from "@superset/ui/switch";
Expand Down Expand Up @@ -49,7 +50,7 @@ type ComparisonValue = string | boolean | null;
type ComparisonRow = {
label: string;
values: ComparisonValue[];
comingSoon?: boolean;
badge?: { label: string; variant: "default" | "secondary" };
};

type ComparisonSection = {
Expand Down Expand Up @@ -135,18 +136,22 @@ const COMPARISON_SECTIONS: ComparisonSection[] = [
values: [true, true, true],
},
{
label: "GitHub integration",
values: [true, true, true],
label: "Remote workspaces",
values: [null, true, true],
badge: { label: "Beta", variant: "default" },
},
{
label: "Cloud workspaces",
label: "Automations",
values: [null, true, true],
comingSoon: true,
},
{
label: "Mobile app",
values: [null, true, true],
comingSoon: true,
badge: { label: "Coming soon", variant: "secondary" },
},
{
label: "GitHub integration",
values: [true, true, true],
},
{
label: "Linear integration",
Expand Down Expand Up @@ -583,10 +588,13 @@ function PlansPage() {
<Fragment key={row.label}>
<div className="flex items-center gap-1.5 px-2 py-2.5 text-xs text-muted-foreground">
{row.label}
{row.comingSoon && (
<span className="text-[10px] text-muted-foreground/60">
(Coming Soon)
</span>
{row.badge && (
<Badge
variant={row.badge.variant}
className="px-1.5 py-0 text-[10px] font-medium"
>
{row.badge.label}
</Badge>
)}
</div>
{row.values.map((value, valueIndex) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function DesktopRow({ row }: { row: ComparisonRow }) {
<td className="py-4 pr-4 text-sm text-foreground">
<div className="flex items-center gap-2">
<span>{row.label}</span>
{row.comingSoon && <ComingSoonBadge />}
{row.badge && <RowBadge badge={row.badge} />}
</div>
</td>
{row.values.map((value, index) => (
Expand Down Expand Up @@ -143,7 +143,7 @@ function MobileTable() {
>
<div className="flex items-center gap-2 text-sm text-foreground">
<span>{row.label}</span>
{row.comingSoon && <ComingSoonBadge />}
{row.badge && <RowBadge badge={row.badge} />}
</div>
<div className="shrink-0 text-sm text-foreground">
<Cell value={row.values[selectedIndex] ?? null} />
Expand Down Expand Up @@ -173,14 +173,18 @@ function Cell({ value }: { value: ComparisonRow["values"][number] }) {
return <span>{value}</span>;
}

function ComingSoonBadge() {
function RowBadge({ badge }: { badge: NonNullable<ComparisonRow["badge"]> }) {
const isPrimary = badge.variant === "default";
return (
<span
className={cn(
"rounded-sm bg-accent/40 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
"rounded-sm px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide",
isPrimary
? "bg-foreground text-background"
: "bg-accent/40 text-muted-foreground",
)}
>
Coming soon
{badge.label}
</span>
);
Comment on lines +176 to 189
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 Badge text casing differs from desktop

RowBadge applies uppercase tracking-wide in the marketing component, so "Beta" renders as BETA and "Coming soon" renders as COMING SOON. The desktop <Badge> component renders text exactly as-is, giving "Beta" and "Coming soon". Since this PR explicitly aligns the two tables, the uppercase transform creates a visible inconsistency that will be obvious when both surfaces show the same label.

Consider dropping uppercase from the class list (or applying it in both), so the rendered text matches what's in the data.

Suggested change
function RowBadge({ badge }: { badge: NonNullable<ComparisonRow["badge"]> }) {
const isPrimary = badge.variant === "default";
return (
<span
className={cn(
"rounded-sm bg-accent/40 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
"rounded-sm px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide",
isPrimary
? "bg-foreground text-background"
: "bg-accent/40 text-muted-foreground",
)}
>
Coming soon
{badge.label}
</span>
);
function RowBadge({ badge }: { badge: NonNullable<ComparisonRow["badge"]> }) {
const isPrimary = badge.variant === "default";
return (
<span
className={cn(
"rounded-sm px-2 py-0.5 text-[10px] font-medium tracking-wide",
isPrimary
? "bg-foreground text-background"
: "bg-accent/40 text-muted-foreground",
)}
>
{badge.label}
</span>
);
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/marketing/src/app/pricing/components/ComparisonTable/ComparisonTable.tsx
Line: 176-189

Comment:
**Badge text casing differs from desktop**

`RowBadge` applies `uppercase tracking-wide` in the marketing component, so "Beta" renders as **BETA** and "Coming soon" renders as **COMING SOON**. The desktop `<Badge>` component renders text exactly as-is, giving "Beta" and "Coming soon". Since this PR explicitly aligns the two tables, the uppercase transform creates a visible inconsistency that will be obvious when both surfaces show the same label.

Consider dropping `uppercase` from the class list (or applying it in both), so the rendered text matches what's in the data.

```suggestion
function RowBadge({ badge }: { badge: NonNullable<ComparisonRow["badge"]> }) {
	const isPrimary = badge.variant === "default";
	return (
		<span
			className={cn(
				"rounded-sm px-2 py-0.5 text-[10px] font-medium tracking-wide",
				isPrimary
					? "bg-foreground text-background"
					: "bg-accent/40 text-muted-foreground",
			)}
		>
			{badge.label}
		</span>
	);
}
```

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

}
16 changes: 6 additions & 10 deletions apps/marketing/src/app/pricing/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface ComparisonRow {
string | boolean | null,
string | boolean | null,
];
comingSoon?: boolean;
badge?: { label: string; variant: "default" | "secondary" };
}

export interface ComparisonSection {
Expand All @@ -134,22 +134,18 @@ export const COMPARISON_SECTIONS: ComparisonSection[] = [
rows: [
{ label: "Desktop app", values: [true, true, true] },
{ label: "Local workspaces", values: [true, true, true] },
{ label: "GitHub integration", values: [true, true, true] },
{
label: "CLI",
values: [true, true, true],
comingSoon: true,
},
{
label: "Remote workspaces",
values: [null, true, true],
comingSoon: true,
badge: { label: "Beta", variant: "default" },
},
{ label: "Automations", values: [null, true, true] },
{
label: "Mobile",
label: "Mobile app",
values: [null, true, true],
comingSoon: true,
badge: { label: "Coming soon", variant: "secondary" },
},
{ label: "GitHub integration", values: [true, true, true] },
{ label: "Linear integration", values: [null, true, true] },
{ label: "Slack integration", values: [null, true, true] },
{ label: "Team collaboration", values: [null, true, true] },
Expand Down
Loading