Skip to content

Commit 638649c

Browse files
samejrclaude
andcommitted
refactor(webapp): move the last hand-rolled links onto TextLink
Seven places styled something as a link with raw indigo, which meant they kept the same purple on a near-black card as on white and never followed the theme. Splitting them by what they actually are: Four read as links and now take `textLinkClassName()`, picking up the theme's link color, the color-shift hover and the "Underline links" preference - the concurrency page's inline "reset", "+ Add port" on both private-connection forms, "get in touch" on the regions page (which sits between two real TextLinks), and "Show more" on notification cards. None are anchors, which is what the class helper exists for. Two are labels inside a row that is itself the button - "View all" in the chart legend, "Upgrade" in the environment selector. They take the link color only: hover belongs to the row, and a row label isn't the body text the underline preference is for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 9d7fc59 commit 638649c

6 files changed

Lines changed: 16 additions & 9 deletions

File tree

apps/webapp/app/components/navigation/EnvironmentSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export function EnvironmentSelector({
197197
className={ENV_POPOVER_ITEM_LABEL}
198198
iconClassName={ENV_POPOVER_ITEM_ICON}
199199
/>
200-
<span className={cn("text-indigo-500", ENV_POPOVER_ITEM_LABEL)}>Upgrade</span>
200+
<span className={cn("text-text-link", ENV_POPOVER_ITEM_LABEL)}>Upgrade</span>
201201
</div>
202202
}
203203
isSelected={false}
@@ -215,7 +215,7 @@ export function EnvironmentSelector({
215215
className={ENV_POPOVER_ITEM_LABEL}
216216
iconClassName={ENV_POPOVER_ITEM_ICON}
217217
/>
218-
<span className={cn("text-indigo-500", ENV_POPOVER_ITEM_LABEL)}>Upgrade</span>
218+
<span className={cn("text-text-link", ENV_POPOVER_ITEM_LABEL)}>Upgrade</span>
219219
</div>
220220
}
221221
isSelected={false}

apps/webapp/app/components/navigation/NotificationCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function NotificationCard({
8888
<button
8989
type="button"
9090
onClick={handleToggleExpand}
91-
className="relative z-20 mt-0.5 text-xs text-indigo-400 hover:text-indigo-300"
91+
className={cn(textLinkClassName(), "relative z-20 mt-0.5 text-xs")}
9292
>
9393
{isExpanded ? "Show less" : "Show more"}
9494
</button>

apps/webapp/app/components/primitives/charts/ChartLegendCompound.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,10 @@ function ViewAllDataRow({ remainingCount, onViewAll }: ViewAllDataRowProps) {
319319
<div className="w-1 shrink-0 self-stretch rounded-[2px] border border-border-bright" />
320320
<span className="text-text-dimmed tabular-nums">{remainingCount} more…</span>
321321
</div>
322-
<span className="self-start text-indigo-500">View all</span>
322+
{/* The row is the button, so this only takes the link color - it gets its
323+
hover from the parent, and it isn't body text the underline
324+
preference should reach. */}
325+
<span className="self-start text-text-link">View all</span>
323326
</div>
324327
</div>
325328
);

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.concurrency/route.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import {
6161
getPlans,
6262
getSelfServePurchaseBlockReason,
6363
} from "~/services/platform.v3.server";
64+
import { textLinkClassName } from "~/components/primitives/TextLink";
6465
import { requireUserId } from "~/services/session.server";
6566
import { cn } from "~/utils/cn";
6667
import { formatCurrency, formatNumber } from "~/utils/numberFormatter";
@@ -436,7 +437,7 @@ function Upgradable({
436437
<span>
437438
Save your changes or{" "}
438439
<button
439-
className="inline text-indigo-500 hover:text-indigo-300"
440+
className={cn(textLinkClassName(), "inline")}
440441
onClick={() => {
441442
setAllocation(initialAllocation(environments));
442443
}}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions/route.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ import {
4545
TableHeaderCell,
4646
TableRow,
4747
} from "~/components/primitives/Table";
48-
import { TextLink } from "~/components/primitives/TextLink";
48+
import { TextLink, textLinkClassName } from "~/components/primitives/TextLink";
49+
import { cn } from "~/utils/cn";
4950
import { InfoIconTooltip } from "~/components/primitives/Tooltip";
5051
import { useFeatures } from "~/hooks/useFeatures";
5152
import { useOrganization } from "~/hooks/useOrganizations";
@@ -359,7 +360,7 @@ export default function Page() {
359360
<TextLink to="https://security.trigger.dev">security portal</TextLink> or{" "}
360361
<Feedback
361362
button={
362-
<span className="cursor-pointer text-xs text-indigo-500 transition hover:text-indigo-400">
363+
<span className={cn(textLinkClassName(), "cursor-pointer text-xs")}>
363364
get in touch
364365
</span>
365366
}

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.private-connections.new/route.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ import {
4444
SparklesIcon,
4545
TrashIcon,
4646
} from "@heroicons/react/20/solid";
47+
import { textLinkClassName } from "~/components/primitives/TextLink";
48+
import { cn } from "~/utils/cn";
4749
import { pageMeta } from "~/utils/pageTitle";
4850

4951
export const meta = pageMeta("Add Private Connection");
@@ -326,7 +328,7 @@ output "endpoint_service_name" {
326328
<button
327329
type="button"
328330
onClick={addPort}
329-
className="text-xs text-indigo-400 transition hover:text-indigo-300"
331+
className={cn(textLinkClassName(), "text-xs")}
330332
>
331333
+ Add port
332334
</button>
@@ -472,7 +474,7 @@ After creating everything, give me the VPC Endpoint Service name (it looks like
472474
<button
473475
type="button"
474476
onClick={addPort}
475-
className="text-xs text-indigo-400 transition hover:text-indigo-300"
477+
className={cn(textLinkClassName(), "text-xs")}
476478
>
477479
+ Add port
478480
</button>

0 commit comments

Comments
 (0)