Skip to content

Commit 2eb35fb

Browse files
authored
🏷️ refactor: Drop Redundant Label Ink Overrides in Panels- #16830 (#16830)
1 parent 2b390d6 commit 2eb35fb

7 files changed

Lines changed: 30 additions & 45 deletions

File tree

‎client/src/components/Prompts/lists/ListCard.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function ListCard({
4343
<CategoryIcon category={category} className="icon-md shrink-0" aria-hidden="true" />
4444
<Label
4545
id={titleId}
46-
className="text-text-primary min-w-0 truncate text-sm font-medium select-none"
46+
className="min-w-0 truncate text-sm font-medium select-none"
4747
title={name}
4848
>
4949
{name}

‎client/src/components/SidePanel/Agents/Version/VersionItem.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export default function VersionItem({
180180
className="max-w-[28.125rem]"
181181
main={
182182
<div className="flex w-full flex-col gap-3 text-sm">
183-
<Label className="text-text-primary text-left font-medium">
183+
<Label className="text-left font-medium">
184184
{localize('com_ui_agent_version_restore_description')}
185185
</Label>
186186
<div className="border-border-light bg-surface-secondary rounded-lg border px-3 py-2">

‎client/src/components/SidePanel/Builder/ActionCallback.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function ActionCallback({ action_id }: { action_id?: string }) {
1919

2020
return (
2121
<div className="flex flex-col gap-1.5">
22-
<Label htmlFor="oauth-callback-url" className="text-sm font-medium text-text-primary">
22+
<Label htmlFor="oauth-callback-url" className="text-sm font-medium">
2323
{localize('com_ui_callback_url')}
2424
</Label>
2525
<div className="relative">
@@ -31,14 +31,14 @@ export default function ActionCallback({ action_id }: { action_id?: string }) {
3131
value={callbackURL}
3232
aria-label={localize('com_ui_callback_url')}
3333
onFocus={(event) => event.currentTarget.select()}
34-
className="pr-10 text-text-secondary"
34+
className="text-text-secondary pr-10"
3535
/>
3636
<CopyButton
3737
iconOnly
3838
isCopied={isCopied}
3939
onClick={() => copyCallbackURL(setIsCopied)}
4040
label={localize('com_ui_copy_link')}
41-
className="absolute right-1 top-1/2 -translate-y-1/2"
41+
className="absolute top-1/2 right-1 -translate-y-1/2"
4242
/>
4343
</div>
4444
</div>

‎client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default function MemoryCreateDialog({
113113
main={
114114
<div className="space-y-4">
115115
<div className="space-y-2">
116-
<Label htmlFor="memory-key" className="text-text-primary text-sm font-medium">
116+
<Label htmlFor="memory-key" className="text-sm font-medium">
117117
{localize('com_ui_key')}
118118
</Label>
119119
<Input
@@ -135,7 +135,7 @@ export default function MemoryCreateDialog({
135135
/>
136136
</div>
137137
<div className="space-y-2">
138-
<Label htmlFor="memory-value" className="text-text-primary text-sm font-medium">
138+
<Label htmlFor="memory-value" className="text-sm font-medium">
139139
{localize('com_ui_value')}
140140
</Label>
141141
<Textarea

‎client/src/components/SidePanel/Memories/MemoryEditDialog.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export default function MemoryEditDialog({
183183

184184
{/* Key input */}
185185
<div className="space-y-2">
186-
<Label htmlFor="memory-key" className="text-text-primary text-sm font-medium">
186+
<Label htmlFor="memory-key" className="text-sm font-medium">
187187
{localize('com_ui_key')}
188188
</Label>
189189
<Input
@@ -208,7 +208,7 @@ export default function MemoryEditDialog({
208208

209209
{/* Value textarea */}
210210
<div className="space-y-2">
211-
<Label htmlFor="memory-value" className="text-text-primary text-sm font-medium">
211+
<Label htmlFor="memory-value" className="text-sm font-medium">
212212
{localize('com_ui_value')}
213213
</Label>
214214
<Textarea

‎client/src/components/SidePanel/Schedules/ScheduleDialog.tsx‎

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export default function ScheduleDialog({
269269
{
270270
label: localize('com_ui_schedule_project_none'),
271271
value: '',
272-
icon: <Folder className="h-4 w-4 text-text-secondary" aria-hidden="true" />,
272+
icon: <Folder className="text-text-secondary h-4 w-4" aria-hidden="true" />,
273273
},
274274
...loadedProjectItems,
275275
],
@@ -551,7 +551,7 @@ export default function ScheduleDialog({
551551
const timezoneField = (
552552
<fieldset className="space-y-2">
553553
<legend>
554-
<Label id="schedule-timezone-label" className="text-sm font-medium text-text-primary">
554+
<Label id="schedule-timezone-label" className="text-sm font-medium">
555555
{localize('com_ui_schedule_timezone')}
556556
</Label>
557557
</legend>
@@ -605,7 +605,7 @@ export default function ScheduleDialog({
605605
<div className="space-y-1.5">
606606
<div className="grid gap-4 md:grid-cols-3">
607607
<div className="space-y-2">
608-
<Label htmlFor="schedule-name" className="text-sm font-medium text-text-primary">
608+
<Label htmlFor="schedule-name" className="text-sm font-medium">
609609
{localize('com_ui_name')}
610610
</Label>
611611
<Input
@@ -619,7 +619,7 @@ export default function ScheduleDialog({
619619
<FieldMessage id="schedule-name-message" message={errors.name?.message} />
620620
</div>
621621
<div className="space-y-2">
622-
<Label htmlFor="schedule-agent" className="text-sm font-medium text-text-primary">
622+
<Label htmlFor="schedule-agent" className="text-sm font-medium">
623623
{localize('com_ui_agent')}
624624
</Label>
625625
<Controller
@@ -656,10 +656,7 @@ export default function ScheduleDialog({
656656
<FieldMessage id="schedule-agent-message" message={errors.agent_id?.message} />
657657
</div>
658658
<div className="space-y-2">
659-
<Label
660-
htmlFor="schedule-project"
661-
className="text-sm font-medium text-text-primary"
662-
>
659+
<Label htmlFor="schedule-project" className="text-sm font-medium">
663660
{localize('com_ui_project')}
664661
</Label>
665662
{pinnedProjectId != null ? (
@@ -669,7 +666,7 @@ export default function ScheduleDialog({
669666
<div
670667
id="schedule-project"
671668
data-testid="schedule-project-pinned"
672-
className="flex h-10 w-full items-center gap-2 rounded-xl border border-border-light bg-surface-secondary px-3 text-sm text-text-secondary"
669+
className="border-border-light bg-surface-secondary text-text-secondary flex h-10 w-full items-center gap-2 rounded-xl border px-3 text-sm"
673670
>
674671
<Folder className="h-4 w-4 shrink-0" aria-hidden="true" />
675672
<span className="truncate">{projectDisplayName(pinnedProjectId)}</span>
@@ -704,7 +701,7 @@ export default function ScheduleDialog({
704701
onBlur={field.onBlur}
705702
items={projectItems}
706703
SelectIcon={
707-
<Folder className="h-4 w-4 text-text-secondary" aria-hidden="true" />
704+
<Folder className="text-text-secondary h-4 w-4" aria-hidden="true" />
708705
}
709706
ariaLabel={localize('com_ui_project')}
710707
ariaInvalid={errors.chatProjectId != null}
@@ -740,7 +737,7 @@ export default function ScheduleDialog({
740737
</div>
741738
{/* Full width, not inside the agent cell: at a third of the dialog this
742739
sentence wraps an extra line and makes the identity row needlessly tall. */}
743-
<p className="text-xs text-text-secondary">
740+
<p className="text-text-secondary text-xs">
744741
{localize('com_ui_schedule_target_new_chat')}
745742
</p>
746743
</div>
@@ -775,10 +772,7 @@ export default function ScheduleDialog({
775772

776773
<fieldset className="space-y-2">
777774
<legend>
778-
<Label
779-
id="schedule-frequency-label"
780-
className="text-sm font-medium text-text-primary"
781-
>
775+
<Label id="schedule-frequency-label" className="text-sm font-medium">
782776
{localize('com_ui_schedule_frequency')}
783777
</Label>
784778
</legend>
@@ -803,7 +797,7 @@ export default function ScheduleDialog({
803797
{frequency === 'cron' ? (
804798
<div className="grid gap-4 md:grid-cols-2">
805799
<div className="space-y-2">
806-
<Label htmlFor="schedule-cron" className="text-sm font-medium text-text-primary">
800+
<Label htmlFor="schedule-cron" className="text-sm font-medium">
807801
{localize('com_ui_schedule_cron_expression')}
808802
</Label>
809803
<Input
@@ -826,7 +820,7 @@ export default function ScheduleDialog({
826820
data-testid="schedule-cron-input"
827821
{...register('expression')}
828822
/>
829-
<p id="schedule-cron-hint" className="text-xs text-text-secondary">
823+
<p id="schedule-cron-hint" className="text-text-secondary text-xs">
830824
{localize('com_ui_schedule_cron_hint')}
831825
</p>
832826
<FieldMessage
@@ -847,10 +841,7 @@ export default function ScheduleDialog({
847841
{frequency === 'weekly' && (
848842
<fieldset className="space-y-2">
849843
<legend>
850-
<Label
851-
id="schedule-days-label"
852-
className="text-sm font-medium text-text-primary"
853-
>
844+
<Label id="schedule-days-label" className="text-sm font-medium">
854845
{localize('com_ui_schedule_days')}
855846
</Label>
856847
</legend>
@@ -905,10 +896,7 @@ export default function ScheduleDialog({
905896
)}
906897
<fieldset className="space-y-2">
907898
<legend>
908-
<Label
909-
id="schedule-time-label"
910-
className="text-sm font-medium text-text-primary"
911-
>
899+
<Label id="schedule-time-label" className="text-sm font-medium">
912900
{localize(
913901
frequency === 'hourly'
914902
? 'com_ui_schedule_minutes_past_hour'
@@ -959,7 +947,7 @@ export default function ScheduleDialog({
959947
contradict the "pick at least one day" message right below it. */}
960948
{daysAreValid && (
961949
<p
962-
className="break-words rounded-lg bg-surface-secondary px-3 py-2 text-sm text-text-secondary"
950+
className="bg-surface-secondary text-text-secondary rounded-lg px-3 py-2 text-sm break-words"
963951
data-testid="schedule-summary"
964952
>
965953
{summary}
@@ -968,10 +956,10 @@ export default function ScheduleDialog({
968956
<FieldMessage id="schedule-cadence-message" message={cadenceError ?? undefined} />
969957
{previewRuns.length > 0 && (
970958
<div className="space-y-1" data-testid="schedule-preview">
971-
<p className="text-xs font-medium text-text-primary">
959+
<p className="text-text-primary text-xs font-medium">
972960
{localize('com_ui_schedule_next_runs')}
973961
</p>
974-
<ul className="space-y-0.5 text-xs text-text-secondary">
962+
<ul className="text-text-secondary space-y-0.5 text-xs">
975963
{previewRuns.map((run) => (
976964
<li key={run.getTime()}>
977965
{formatRunInstant(run, timezone, locale, prefersMeridiem)}

‎eslint-suppressions.json‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,9 +1333,6 @@
13331333
"client/src/components/Prompts/lists/ListCard.tsx": {
13341334
"shadcn/no-arbitrary-values": {
13351335
"count": 1
1336-
},
1337-
"shadcn/no-restyle": {
1338-
"count": 1
13391336
}
13401337
},
13411338
"client/src/components/Prompts/sidebar/FilterPrompts.tsx": {
@@ -1647,7 +1644,7 @@
16471644
"count": 2
16481645
},
16491646
"shadcn/no-restyle": {
1650-
"count": 10
1647+
"count": 9
16511648
}
16521649
},
16531650
"client/src/components/SidePanel/Agents/Version/VersionPanel.tsx": {
@@ -1672,7 +1669,7 @@
16721669
},
16731670
"client/src/components/SidePanel/Builder/ActionCallback.tsx": {
16741671
"shadcn/no-restyle": {
1675-
"count": 3
1672+
"count": 2
16761673
}
16771674
},
16781675
"client/src/components/SidePanel/Builder/ActionsAuth.tsx": {
@@ -1758,12 +1755,12 @@
17581755
},
17591756
"client/src/components/SidePanel/Memories/MemoryCreateDialog.tsx": {
17601757
"shadcn/no-restyle": {
1761-
"count": 12
1758+
"count": 10
17621759
}
17631760
},
17641761
"client/src/components/SidePanel/Memories/MemoryEditDialog.tsx": {
17651762
"shadcn/no-restyle": {
1766-
"count": 13
1763+
"count": 11
17671764
}
17681765
},
17691766
"client/src/components/SidePanel/Memories/MemoryPanel.tsx": {
@@ -1816,7 +1813,7 @@
18161813
},
18171814
"client/src/components/SidePanel/Schedules/ScheduleDialog.tsx": {
18181815
"shadcn/no-restyle": {
1819-
"count": 22
1816+
"count": 14
18201817
}
18211818
},
18221819
"client/src/components/SidePanel/Schedules/SchedulePanel.tsx": {

0 commit comments

Comments
 (0)