🧽 refactor: Drop Classes Primitives Already Set (#16835)

This commit is contained in:
Marco Beretta 2026-10-06 20:32:15 +02:00 • committed by GitHub
parent 2eb35fb150
commit 1fcfbf40c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 62 additions and 77 deletions

View file

@ -362,7 +362,7 @@ const AgentDetailContent: React.FC<AgentDetailContentProps> = ({
<Button
key={`${starter}-${index}`}
variant="outline"
className="h-auto min-h-14 items-start justify-between gap-3 px-4 py-3 text-left whitespace-normal rtl:text-right"
className="h-auto min-h-14 items-start justify-between gap-3 py-3 text-left whitespace-normal rtl:text-right"
aria-disabled={actionsDisabled || undefined}
onClick={() => {
if (!actionsDisabled) {

View file

@ -84,7 +84,7 @@ const BookmarkForm = ({
<div className="space-y-4">
{/* Tag name input */}
<div className="space-y-2">
<Label htmlFor="bookmark-tag" className="text-text-primary text-sm font-medium">
<Label htmlFor="bookmark-tag" className="text-sm font-medium">
{localize('com_ui_bookmarks_title')}
</Label>
<Input
@ -120,7 +120,7 @@ const BookmarkForm = ({
<Label
id="bookmark-description-label"
htmlFor="bookmark-description"
className="text-text-primary text-sm font-medium"
className="text-sm font-medium"
>
{localize('com_ui_bookmarks_description')}
</Label>

View file

@ -159,7 +159,7 @@ function EventSubagentRows({
aria-expanded={expanded}
aria-controls={panelId}
aria-label={`${localize('com_ui_subagent_activity')}: ${summary}`}
className="text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-ring-primary flex h-auto min-h-10 w-full items-center justify-start gap-2 rounded-lg px-3 py-2 text-left focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-inset"
className="text-text-secondary focus-visible:ring-ring-primary flex h-auto min-h-10 w-full items-center justify-start px-3 text-left focus-visible:ring-offset-0 focus-visible:ring-inset"
>
<Bot size={15} className="shrink-0" aria-hidden="true" />
<span className="min-w-0 flex-1 truncate text-sm font-medium">{summary}</span>

View file

@ -289,7 +289,7 @@ function SubagentPrompt({ prompt }: { prompt: string }) {
aria-expanded={expanded}
aria-label={toggleLabel}
title={toggleLabel}
className="text-text-secondary hover:bg-surface-tertiary hover:text-text-primary focus:ring-text-primary h-8 gap-1.5 rounded-md px-2 text-xs font-medium transition focus:ring-2"
className="text-text-secondary hover:bg-surface-tertiary focus:ring-text-primary h-8 gap-1.5 rounded-md px-2 text-xs font-medium transition focus:ring-2"
>
{expanded ? <Minimize2 size={14} aria-hidden /> : <Maximize2 size={14} aria-hidden />}
<span className="hidden sm:inline">{toggleLabel}</span>

View file

@ -1670,7 +1670,7 @@ export default function SubagentThreadPanel({ selection }: { selection: ActiveSu
aria-label={action.label}
disabled={action.disabled}
onClick={action.onClick}
className="text-text-secondary hover:text-text-primary size-9 rounded-full"
className="text-text-secondary size-9 rounded-full"
>
{action.icon}
</Button>

View file

@ -113,7 +113,7 @@ function ProjectConversationDialog({
<OGDialogTitle>{localize('com_ui_change_project')}</OGDialogTitle>
</OGDialogHeader>
<div className="flex flex-col gap-2">
<Label htmlFor="change-project-select" className="text-text-primary text-sm font-medium">
<Label htmlFor="change-project-select" className="text-sm font-medium">
{localize('com_ui_select_project')}
</Label>
<ControlCombobox
@ -138,7 +138,7 @@ function ProjectConversationDialog({
<Button
type="button"
variant="link"
className="h-auto justify-start px-0 text-sm"
className="h-auto justify-start px-0"
onClick={() => fetchNextPage()}
disabled={isFetchingNextPage}
>

View file

@ -166,7 +166,7 @@ export default function ShareButton({
<Label
id="share-files-label"
htmlFor="share-files-switch"
className="text-text-primary cursor-pointer text-sm font-medium"
className="cursor-pointer text-sm font-medium"
>
{localize('com_ui_share_files')}
</Label>

View file

@ -396,7 +396,7 @@ export default function SharedLinkButton({
<OGDialogContent className="w-11/12 max-w-md" showCloseButton={false}>
<OGDialogHeader>
<OGDialogTitle>{localize('com_ui_update_shared_link_confirm_title')}</OGDialogTitle>
<OGDialogDescription className="text-text-secondary">
<OGDialogDescription>
{localize('com_ui_update_shared_link_confirm_description')}
</OGDialogDescription>
</OGDialogHeader>

View file

@ -158,7 +158,7 @@ const ProjectChatsInline = memo(function ProjectChatsInline({
variant="ghost"
size="sm"
onClick={onShowAll}
className="text-text-secondary hover:text-text-primary mt-0.5 ml-1 h-auto rounded-md px-2 py-1 text-xs font-medium transition-colors"
className="text-text-secondary mt-0.5 ml-1 h-auto rounded-md px-2 py-1 text-xs font-medium"
>
{localize('com_ui_show_all')}
</Button>

View file

@ -113,7 +113,7 @@ const RevokeKeysButton = ({
<OGDialogTrigger asChild>
<Button
variant="destructive"
className="flex items-center justify-center rounded-lg transition-colors duration-200"
className="flex items-center justify-center duration-200"
onClick={() => setOpen(true)}
disabled={disabled}
>
@ -137,7 +137,7 @@ const RevokeKeysButton = ({
variant="destructive"
onClick={onClick}
disabled={isLoading}
className="bg-surface-destructive text-text-on-status hover:bg-surface-destructive-hover transition-all duration-200"
className="transition-all duration-200"
>
{isLoading ? <Spinner /> : localize('com_ui_revoke')}
</Button>

View file

@ -788,7 +788,7 @@ export default function InsightsView() {
? localize('com_ui_clear_all')
: localize('com_insights_select_all_agents')
}
className="text-text-primary hover:bg-surface-hover h-10 w-full justify-start gap-2 rounded-none px-4 font-medium"
className="text-text-primary h-10 w-full justify-start rounded-none px-4 font-medium"
onClick={() =>
handleAgentSelection(
displayedAgentIds.length > 0 ? [] : agentItems.map((agent) => agent.value),

View file

@ -68,7 +68,7 @@ export default function McpOAuthDialog({
{localize('com_nav_mcp_connect_server', { 0: serverName })}
</OGDialogTitle>
</div>
<OGDialogDescription className="text-text-secondary text-sm">
<OGDialogDescription className="text-sm">
{localize('com_ui_mcp_oauth_description')}
</OGDialogDescription>

View file

@ -460,7 +460,7 @@ export const MermaidRenderer = memo(function MermaidRenderer({
variant="ghost"
size="sm"
onClick={handleRetry}
className="text-text-secondary hover:bg-surface-hover h-auto gap-1 rounded px-2 py-1 text-xs"
className="text-text-secondary h-auto gap-1 rounded px-2 py-1 text-xs"
>
<RefreshCw className="h-3 w-3" aria-hidden="true" />
{localize('com_ui_retry')}

View file

@ -84,7 +84,7 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(
<OGDialog open={open} onOpenChange={onOpenChange} triggerRef={triggerRef}>
<OGDialogContent
showCloseButton={false}
className="border-border-light bg-surface-dialog flex h-[85vh] max-h-[85vh] w-[90vw] max-w-[90vw] flex-col gap-0 overflow-hidden p-0"
className="flex h-[85vh] max-h-[85vh] w-[90vw] max-w-[90vw] flex-col gap-0 overflow-hidden p-0"
>
<OGDialogTitle className="border-border-light bg-surface-secondary text-text-secondary flex h-10 shrink-0 items-center justify-between border-b px-4 font-sans text-xs">
<span>{localize('com_ui_mermaid')}</span>
@ -100,7 +100,7 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(
variant="ghost"
size="sm"
aria-label={showCode ? localize('com_ui_hide_code') : localize('com_ui_show_code')}
className="text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-border-heavy size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:min-w-[6rem] sm:px-1 sm:py-0"
className="text-text-secondary focus-visible:ring-border-heavy size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:min-w-[6rem] sm:px-1 sm:py-0"
onClick={handleToggleCode}
>
<MorphIcon icon={showCode ? ChevronUp : ChevronDown} className="h-4 w-4" />
@ -113,7 +113,7 @@ const MermaidDialog: React.FC<MermaidDialogProps> = memo(
variant="ghost"
size="sm"
aria-label={localize('com_ui_copy_code')}
className="text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-border-heavy size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:px-1 sm:py-0"
className="text-text-secondary focus-visible:ring-border-heavy size-8 min-w-0 gap-1 rounded-sm p-0 text-xs focus-visible:ring-offset-0 sm:h-auto sm:w-auto sm:px-1 sm:py-0"
onClick={handleCopy}
>
<MorphIcon icon={isCopied ? Check : Copy} size="1.125rem" />

View file

@ -105,7 +105,7 @@ export default function ProjectCreateDialog({
main={
<form id={formId} onSubmit={handleCreate} className="flex flex-col gap-4">
<div className="space-y-2">
<Label htmlFor={`${formId}-name`} className="text-text-primary text-sm font-medium">
<Label htmlFor={`${formId}-name`} className="text-sm font-medium">
{localize('com_ui_project_name')}
</Label>
<Input
@ -119,10 +119,7 @@ export default function ProjectCreateDialog({
/>
</div>
<div className="space-y-2">
<Label
htmlFor={`${formId}-description`}
className="text-text-primary text-sm font-medium"
>
<Label htmlFor={`${formId}-description`} className="text-sm font-medium">
{localize('com_ui_description')}{' '}
<span className="text-text-secondary font-normal">
{localize('com_ui_optional')}

View file

@ -376,11 +376,7 @@ export function ShareHeader({
<div className="flex flex-wrap items-center justify-end gap-2 md:flex-nowrap md:self-start">
{langfuseSessionUrl && (
<Button
asChild
variant="outline"
className="border-border-medium text-text-primary gap-2 rounded-full px-4 py-2 text-sm"
>
<Button asChild variant="outline" className="border-border-medium rounded-full">
<a href={langfuseSessionUrl} target="_blank" rel="noopener noreferrer">
<span>{langfuseSessionLabel}</span>
<ExternalLink className="size-4 shrink-0" aria-hidden="true" />
@ -392,7 +388,7 @@ export function ShareHeader({
variant="submit"
onClick={onContinue}
disabled={isContinuing}
className="gap-2 rounded-full px-4 py-2 text-sm"
className="rounded-full"
>
{isContinuing ? (
<Spinner className="size-4" />

View file

@ -64,7 +64,7 @@ export default function SharePointPickerDialog({
* needed a scrim of its own: it takes the theme's. */}
<OGDialogContent
focusOutline="hidden"
className="sharepoint-picker-bg bg-surface-dialog fixed top-1/2 left-1/2 z-50 h-[42.5rem] max-h-[90vh] max-w-[90vw] -translate-x-1/2 -translate-y-1/2 rounded-lg border p-2 shadow-lg"
className="sharepoint-picker-bg fixed top-1/2 left-1/2 z-50 h-[42.5rem] max-h-[90vh] max-w-[90vw] -translate-x-1/2 -translate-y-1/2 rounded-lg border p-2 shadow-lg"
showCloseButton={true}
>
<OGDialogTitle className="sr-only">

View file

@ -29,7 +29,7 @@ const PeoplePickerAdminSettings = () => {
<Button
type="button"
variant="outline"
className="gap-2 rounded-lg font-medium"
className="font-medium"
aria-label={localize('com_ui_admin_settings')}
>
<ShieldEllipsis className="size-4" aria-hidden="true" />

View file

@ -63,10 +63,7 @@ export default function PublicSharingToggle({
<Globe className="size-5" />
</div>
<div className="flex items-center gap-2">
<Label
htmlFor="share-everyone-toggle"
className="cursor-pointer text-sm font-medium text-text-primary"
>
<Label htmlFor="share-everyone-toggle" className="cursor-pointer text-sm font-medium">
{localize('com_ui_share_everyone')}
</Label>
<InfoHoverCard
@ -95,7 +92,7 @@ export default function PublicSharingToggle({
<Shield className="size-5" />
</div>
<div className="flex flex-col gap-0.5">
<Label htmlFor="permission-level" className="text-sm font-medium text-text-primary">
<Label htmlFor="permission-level" className="text-sm font-medium">
{localize('com_ui_everyone_permission_level')}
</Label>
</div>

View file

@ -157,7 +157,7 @@ function AssistantToolsDialog({
}}
>
<OGDialogContent
className="bg-surface-dialog gap-0 overflow-hidden overflow-y-auto p-0 text-left max-sm:h-full sm:mx-7 sm:my-8 sm:max-w-2xl lg:max-w-5xl xl:max-w-7xl"
className="gap-0 overflow-hidden overflow-y-auto p-0 text-left max-sm:h-full sm:mx-7 sm:my-8 sm:max-w-2xl lg:max-w-5xl xl:max-w-7xl"
style={{ minHeight: 'min(38.125rem, 90vh)' }}
>
<div>
@ -169,7 +169,7 @@ function AssistantToolsDialog({
? localize('com_nav_tool_dialog_agents')
: localize('com_nav_tool_dialog')}
</OGDialogTitle>
<OGDialogDescription className="text-text-secondary text-sm">
<OGDialogDescription className="text-sm">
{localize('com_nav_tool_dialog_description')}
</OGDialogDescription>
</div>
@ -199,7 +199,7 @@ function AssistantToolsDialog({
onChange={handleSearch}
placeholder={localize('com_nav_tool_search')}
aria-label={localize('com_nav_tool_search')}
className="border-border-medium text-text-primary max-w-64 min-w-0 flex-1 rounded border bg-transparent px-2 py-1"
className="border-border-medium text-text-primary max-w-64 min-w-0 flex-1 rounded border px-2 py-1"
/>
</div>
<div

View file

@ -164,7 +164,7 @@ function ExpandedPanel({
aria-label={localize(toggleLabel)}
aria-expanded={expanded}
aria-keyshortcuts={toggleSidebarAriaKey}
className="h-9 w-9 rounded-lg"
className="h-9 w-9"
onClick={toggleClick}
>
<Sidebar aria-hidden="true" className="text-text-primary h-5 w-5" />

View file

@ -137,7 +137,7 @@ export default function VariableEditor({
variant="ghost"
onClick={() => setIsDialogOpen(true)}
aria-label={localize('com_ui_expand_editor')}
className="text-text-secondary hover:bg-surface-secondary hover:text-text-primary h-7 w-7 p-0"
className="text-text-secondary hover:bg-surface-secondary h-7 w-7 p-0"
>
<Maximize2 className="h-4 w-4" strokeWidth={1.75} aria-hidden={true} />
</Button>

View file

@ -74,7 +74,7 @@ function FileHovercardContent({
<Button
variant="link"
onClick={onClick}
className="text-text-primary h-auto min-w-0 justify-start truncate p-0 text-sm font-medium hover:underline"
className="h-auto min-w-0 justify-start truncate p-0 font-medium"
>
{fileName}
</Button>

View file

@ -425,7 +425,7 @@ const SourcesGroup = React.memo(function SourcesGroup({
</div>
</OGDialogTrigger>
)}
<OGDialogContent className="bg-surface-dialog flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[37.5rem]">
<OGDialogContent className="flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[37.5rem]">
<div className="border-border-light bg-surface-dialog sticky top-0 z-10 flex items-center justify-between border-b px-3 py-2">
<OGDialogTitle className="text-base font-medium">
{localize('com_sources_title')}
@ -521,7 +521,7 @@ function FilesGroup({ files, messageId, conversationId, limit = 3 }: FilesGroupP
</div>
</OGDialogTrigger>
)}
<OGDialogContent className="bg-surface-dialog flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[37.5rem]">
<OGDialogContent className="flex max-h-[80vh] max-w-full flex-col overflow-hidden rounded-lg p-0 md:max-w-[37.5rem]">
<div className="border-border-light bg-surface-dialog sticky top-0 z-10 flex items-center justify-between border-b px-3 py-2">
<OGDialogTitle className="text-base font-medium">
{localize('com_sources_agent_files')}
@ -758,7 +758,7 @@ export default function Sources(props: SourcesProps) {
variant="outline"
size="sm"
onClick={() => window.location.reload()}
className="bg-surface-primary text-text-primary hover:bg-surface-hover rounded-md px-3 py-1 text-sm"
className="bg-surface-primary rounded-md py-1"
aria-label={localize('com_sources_reload_page')}
>
{localize('com_ui_refresh')}

View file

@ -82,7 +82,7 @@ const LabelController: React.FC<LabelControllerProps> = ({
<div className="flex items-center justify-between gap-4 px-4 py-3.5">
<Label
htmlFor={id}
className="text-text-primary w-auto cursor-pointer text-sm font-medium break-normal select-none"
className="w-auto cursor-pointer text-sm font-medium break-normal select-none"
>
{label}
</Label>
@ -186,7 +186,7 @@ const AdminSettingsDialog: React.FC<AdminSettingsDialogProps> = ({
<Button
size="sm"
variant="outline"
className="border-border-light relative h-9 w-full gap-2 rounded-lg font-medium"
className="relative h-9 w-full font-medium"
aria-label={localize('com_ui_admin_settings')}
>
<ShieldEllipsis className="size-5 cursor-pointer" aria-hidden="true" />

View file

@ -14,7 +14,7 @@
"count": 4
},
"shadcn/no-restyle": {
"count": 17
"count": 16
}
},
"client/src/components/Agents/AgentGrid.tsx": {
@ -118,7 +118,7 @@
},
"client/src/components/Bookmarks/BookmarkForm.tsx": {
"shadcn/no-restyle": {
"count": 13
"count": 11
}
},
"client/src/components/Bookmarks/BookmarkItem.tsx": {
@ -760,7 +760,7 @@
"count": 1
},
"shadcn/no-restyle": {
"count": 11
"count": 5
}
},
"client/src/components/Chat/Subagents/SharedSubagentActivityDialog.tsx": {
@ -770,7 +770,7 @@
},
"client/src/components/Chat/Subagents/SubagentActivity.tsx": {
"shadcn/no-restyle": {
"count": 13
"count": 12
},
"shadcn/no-unknown-classes": {
"count": 1
@ -786,7 +786,7 @@
},
"client/src/components/Chat/Subagents/SubagentThreadPanel.tsx": {
"shadcn/no-restyle": {
"count": 9
"count": 8
}
},
"client/src/components/Chat/Trace/Button.tsx": {
@ -839,17 +839,12 @@
},
"client/src/components/Conversations/ConvoOptions/ProjectButton.tsx": {
"shadcn/no-restyle": {
"count": 13
"count": 11
}
},
"client/src/components/Conversations/ConvoOptions/ShareButton.tsx": {
"shadcn/no-restyle": {
"count": 11
}
},
"client/src/components/Conversations/ConvoOptions/SharedLinkButton.tsx": {
"shadcn/no-restyle": {
"count": 1
"count": 10
}
},
"client/src/components/Conversations/ConvoOptions/SharedLinkCopyButton.tsx": {
@ -869,7 +864,7 @@
},
"client/src/components/Conversations/ProjectsSection.tsx": {
"shadcn/no-restyle": {
"count": 11
"count": 9
}
},
"client/src/components/Conversations/RenameForm.tsx": {
@ -972,12 +967,12 @@
},
"client/src/components/Input/SetKeyDialog/SetKeyDialog.tsx": {
"shadcn/no-restyle": {
"count": 8
"count": 3
}
},
"client/src/components/Insights/InsightsView.tsx": {
"shadcn/no-restyle": {
"count": 30
"count": 28
}
},
"client/src/components/MCP/CustomUserVarsSection.tsx": {
@ -1005,7 +1000,7 @@
"count": 3
},
"shadcn/no-restyle": {
"count": 8
"count": 7
}
},
"client/src/components/MCP/StackedMCPIcons.tsx": {
@ -1042,7 +1037,7 @@
"count": 2
},
"shadcn/no-restyle": {
"count": 7
"count": 6
}
},
"client/src/components/Messages/Content/Mermaid/MermaidDialog.tsx": {
@ -1050,7 +1045,7 @@
"count": 1
},
"shadcn/no-restyle": {
"count": 40
"count": 34
}
},
"client/src/components/Messages/Content/RunCode.tsx": {
@ -1243,7 +1238,7 @@
},
"client/src/components/Projects/ProjectCreateDialog.tsx": {
"shadcn/no-restyle": {
"count": 3
"count": 1
}
},
"client/src/components/Projects/ProjectsView.tsx": {
@ -1365,12 +1360,12 @@
},
"client/src/components/Share/ShareView.tsx": {
"shadcn/no-restyle": {
"count": 23
"count": 14
}
},
"client/src/components/SharePoint/SharePointPickerDialog.tsx": {
"shadcn/no-restyle": {
"count": 6
"count": 5
}
},
"client/src/components/Sharing/GenericGrantAccessDialog.tsx": {
@ -1388,12 +1383,12 @@
},
"client/src/components/Sharing/PeoplePickerAdminSettings.tsx": {
"shadcn/no-restyle": {
"count": 3
"count": 1
}
},
"client/src/components/Sharing/PublicSharingToggle.tsx": {
"shadcn/no-restyle": {
"count": 3
"count": 1
}
},
"client/src/components/SidePanel/Agents/ActionsInput.tsx": {
@ -1907,7 +1902,7 @@
"count": 1
},
"shadcn/no-restyle": {
"count": 15
"count": 12
}
},
"client/src/components/Tools/ToolItem.tsx": {
@ -1917,7 +1912,7 @@
},
"client/src/components/UnifiedSidebar/ExpandedPanel.tsx": {
"shadcn/no-restyle": {
"count": 6
"count": 5
}
},
"client/src/components/UnifiedSidebar/Sidebar.tsx": {
@ -1945,7 +1940,7 @@
},
"client/src/components/Variables/Editor.tsx": {
"shadcn/no-restyle": {
"count": 12
"count": 11
},
"shadcn/require-static-classes": {
"count": 1
@ -1956,7 +1951,7 @@
"count": 1
},
"shadcn/no-restyle": {
"count": 6
"count": 3
}
},
"client/src/components/Web/Sources.tsx": {
@ -1964,7 +1959,7 @@
"count": 1
},
"shadcn/no-restyle": {
"count": 56
"count": 50
},
"shadcn/no-unknown-classes": {
"count": 1
@ -1972,7 +1967,7 @@
},
"client/src/components/ui/AdminSettingsDialog.tsx": {
"shadcn/no-restyle": {
"count": 18
"count": 14
},
"shadcn/require-static-classes": {
"count": 1