TypeScript
refactor(web): use ghost-muted where ghost buttons restyled to muted (#13020)
Julius Marmingec0490e9d0eb0
diff --git a/apps/web/src/components/DiffFilePathCopyButton.tsx b/apps/web/src/components/DiffFilePathCopyButton.tsxindex 49b00ed89b7..5e78949336c 100644--- a/apps/web/src/components/DiffFilePathCopyButton.tsx+++ b/apps/web/src/components/DiffFilePathCopyButton.tsx@@ -24,8 +24,7 @@ export function DiffFilePathCopyButton({ filePath }: { filePath: string }) {<Buttonref={ref}size="icon-micro"- variant="ghost"- className="text-muted-foreground [:hover,[data-pressed]]:bg-transparent"+ variant="ghost-muted"aria-label="Copy file path"onClick={() => copyToClipboard(filePath, undefined)}/>diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsxindex e1bc3f151fd..7fffbf10407 100644--- a/apps/web/src/components/RightPanelTabs.tsx+++ b/apps/web/src/components/RightPanelTabs.tsx@@ -1260,9 +1260,9 @@ export function RightPanelTabs(props: RightPanelTabsProps) {render={<Buttonaria-label="Add panel surface"- className="size-6 shrink-0 text-muted-foreground hover:text-foreground"+ className="size-6 shrink-0"size="icon-xs"- variant="ghost"+ variant="ghost-muted"/>}>diff --git a/apps/web/src/components/chat/ProviderStatusBanner.tsx b/apps/web/src/components/chat/ProviderStatusBanner.tsxindex 12f9dc04f26..210bff4d7ad 100644--- a/apps/web/src/components/chat/ProviderStatusBanner.tsx+++ b/apps/web/src/components/chat/ProviderStatusBanner.tsx@@ -117,10 +117,10 @@ export const ProviderStatusBanner = memo(function ProviderStatusBanner({</div><Buttonaria-label={`Dismiss ${providerName} provider ${status.status}`}- className="absolute top-2 right-2 size-6 text-muted-foreground hover:text-foreground"+ className="absolute top-2 right-2 size-6"onClick={onDismiss}size="icon-xs"- variant="ghost"+ variant="ghost-muted"><XIcon aria-hidden className="size-3.5" /></Button>diff --git a/apps/web/src/components/diffs/DiffCommentAnnotation.tsx b/apps/web/src/components/diffs/DiffCommentAnnotation.tsxindex bce9f7e55f5..6633a593067 100644--- a/apps/web/src/components/diffs/DiffCommentAnnotation.tsx+++ b/apps/web/src/components/diffs/DiffCommentAnnotation.tsx@@ -68,8 +68,8 @@ export function DiffCommentAnnotation({<p className="min-w-0 flex-1 whitespace-pre-wrap text-[13px] leading-5">{displayedText}</p>{onDelete ? (<Button- className="-my-1 -mr-1 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/comment:opacity-100 focus-visible:opacity-100 max-sm:opacity-100"- variant="ghost"+ className="-my-1 -mr-1 shrink-0 opacity-0 transition-opacity group-hover/comment:opacity-100 focus-visible:opacity-100 max-sm:opacity-100"+ variant="ghost-muted"size="icon-xs"aria-label="Delete comment"onClick={onDelete}@@ -115,12 +115,7 @@ export function DiffCommentAnnotation({/><div className="mt-1.5 flex items-center gap-1"><span className="mr-auto text-[10px] text-muted-foreground/70">⌘/Ctrl Enter to send</span>- <Button- className="text-muted-foreground hover:text-foreground"- variant="ghost"- size="xs"- onClick={onCancel}- >+ <Button variant="ghost-muted" size="xs" onClick={onCancel}>Cancel</Button>{secondaryAction ? (diff --git a/apps/web/src/components/pullRequest/PullRequestCommentBody.tsx b/apps/web/src/components/pullRequest/PullRequestCommentBody.tsxindex d730c0f859a..073cd2a07ef 100644--- a/apps/web/src/components/pullRequest/PullRequestCommentBody.tsx+++ b/apps/web/src/components/pullRequest/PullRequestCommentBody.tsx@@ -44,8 +44,8 @@ export function PullRequestCommentBody({{overflowing ? (<Buttonsize="xs"- variant="ghost"- className="mt-2 text-muted-foreground"+ variant="ghost-muted"+ className="mt-2"aria-expanded={expanded}aria-controls={id}onClick={() => {diff --git a/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx b/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsxindex 5d0ba801edb..e237848ffad 100644--- a/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx+++ b/apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx@@ -166,8 +166,8 @@ function OpenOnHostButton({ url, onOpen }: { url: string | null; onOpen: (url: sreturn url === null ? null : (<Buttonsize="icon-xs"- variant="ghost"- className="-mr-1 -mt-1 shrink-0 text-muted-foreground"+ variant="ghost-muted"+ className="-mr-1 -mt-1 shrink-0"aria-label="Open activity on host"onClick={() => onOpen(url)}>diff --git a/apps/web/src/components/settings/AddProviderInstanceDialog.tsx b/apps/web/src/components/settings/AddProviderInstanceDialog.tsxindex 810a1507930..65eb8ad7699 100644--- a/apps/web/src/components/settings/AddProviderInstanceDialog.tsx+++ b/apps/web/src/components/settings/AddProviderInstanceDialog.tsx@@ -369,8 +369,7 @@ export function AddProviderInstanceDialog({<Buttontype="button"size="xs"- variant="ghost"- className="text-muted-foreground"+ variant="ghost-muted"onClick={() => setAccentColor("")}>Cleardiff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsxindex 0adc7aed918..1d0b3e0b71f 100644--- a/apps/web/src/components/settings/ConnectionsSettings.tsx+++ b/apps/web/src/components/settings/ConnectionsSettings.tsx@@ -1626,9 +1626,8 @@ function SavedBackendListRow({render={<Buttontype="button"- variant="ghost"+ variant="ghost-muted"size="icon-xs"- className="text-muted-foreground hover:text-foreground"disabled={isRemoving}aria-label={`More actions for ${environment.label}`}/>@@ -3292,9 +3291,8 @@ export function ConnectionsSettings() {render={<Buttontype="button"- variant="ghost"+ variant="ghost-muted"size="icon-xs"- className="text-muted-foreground hover:text-foreground"aria-label="More actions for this machine"/>}diff --git a/apps/web/src/components/settings/KeybindingsSettings.tsx b/apps/web/src/components/settings/KeybindingsSettings.tsxindex bac46a56d00..4a22680b63f 100644--- a/apps/web/src/components/settings/KeybindingsSettings.tsx+++ b/apps/web/src/components/settings/KeybindingsSettings.tsx@@ -952,9 +952,8 @@ function KeybindingRowMenu({render={<Buttontype="button"- variant="ghost"+ variant="ghost-muted"size="icon-sm"- className="text-muted-foreground hover:text-foreground"disabled={isSaving}aria-label={`Actions for ${commandLabel(row.command)}`}/>@@ -1232,9 +1231,8 @@ function NewKeybindingCancelIcon({render={<Buttontype="button"- variant="ghost"+ variant="ghost-muted"size="icon-sm"- className="text-muted-foreground hover:text-foreground"disabled={isSaving}aria-label="Cancel new keybinding"onClick={onCancel}diff --git a/apps/web/src/components/settings/ProjectActionsList.tsx b/apps/web/src/components/settings/ProjectActionsList.tsxindex 1794a5fdaa2..812022a2b8f 100644--- a/apps/web/src/components/settings/ProjectActionsList.tsx+++ b/apps/web/src/components/settings/ProjectActionsList.tsx@@ -53,8 +53,8 @@ export function ProjectActionsList({) : null}<Buttonsize="icon-xs"- variant="ghost"- className="shrink-0 text-muted-foreground opacity-0 group-focus-within:opacity-100 group-hover:opacity-100"+ variant="ghost-muted"+ className="shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100"aria-label={`Edit ${script.name}`}disabled={disabled}onClick={() => onEdit(script)}diff --git a/apps/web/src/components/settings/ProviderInstanceCard.tsx b/apps/web/src/components/settings/ProviderInstanceCard.tsxindex 0a8c8fcbe40..ed8f5893f50 100644--- a/apps/web/src/components/settings/ProviderInstanceCard.tsx+++ b/apps/web/src/components/settings/ProviderInstanceCard.tsx@@ -767,8 +767,8 @@ export function ProviderInstanceCard({<Buttontype="button"size="icon-xs"- variant="ghost"- className="shrink-0 text-muted-foreground hover:text-foreground"+ variant="ghost-muted"+ className="shrink-0"onClick={() =>copyToClipboard(updateCommand, { providerName: displayName })}diff --git a/scripts/lint-restyle-ceiling.ts b/scripts/lint-restyle-ceiling.tsindex 30866b393a6..5f36d62c1d2 100644--- a/scripts/lint-restyle-ceiling.ts+++ b/scripts/lint-restyle-ceiling.ts@@ -8,7 +8,7 @@ import * as NodeURL from "node:url";// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you// migrate a file, and delete this script when the rule becomes an error.-export const RESTYLE_CEILING = 1207;+export const RESTYLE_CEILING = 1184;const RULE = "shadcn(no-restyle)";