Skip to content

Commit 4f43e20

Browse files
committed
fix(web): row icons line up with the first line of their text
Icons beside wrapping text sat 1-2px above or below the first line because their top margins assumed a different line height than the text next to them. The icons now take the line's height (h-lh, or h-5 where the text sets its own leading) so the glyph centers on the first line whatever its size. The PR hover card's conflict warning drops its stray leading-5 to match the card's other rows.
1 parent 320ba9e commit 4f43e20

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎apps/web/src/components/chat/ThreadDetailsPrRow.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export function ThreadDetailsPrRow({
285285
{detail.isDraft && conflicting ? (
286286
<div className="flex min-w-0 items-start gap-2 text-destructive">
287287
<TriangleAlertIcon aria-hidden className="mt-0.5 size-3 shrink-0 stroke-current" />
288-
<div className="min-w-0 flex-1 wrap-break-word leading-5">
288+
<div className="min-w-0 flex-1 wrap-break-word">
289289
Merge conflicts with {detail.baseBranch}
290290
</div>
291291
</div>

‎apps/web/src/components/diffs/DiffCommentAnnotation.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function DiffCommentAnnotation({
6464
contentEditable={false}
6565
onPointerDown={(event) => event.stopPropagation()}
6666
>
67-
<MessageCircle className="mt-0.5 size-3.5 shrink-0 text-primary/70" aria-hidden="true" />
67+
<MessageCircle className="size-3.5 h-5 shrink-0 text-primary/70" aria-hidden="true" />
6868
<p className="min-w-0 flex-1 whitespace-pre-wrap text-sm leading-5">{displayedText}</p>
6969
{onDelete ? (
7070
<span className="-my-1 -mr-1 flex shrink-0 opacity-0 transition-opacity group-hover/comment:opacity-100 focus-within:opacity-100 max-sm:opacity-100">

‎apps/web/src/components/pullRequest/guide/GuideStop.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export function GuideStop({
267267
>
268268
<MessageCircleQuestionIcon
269269
aria-hidden
270-
className="mt-0.5 size-3.5 shrink-0 text-muted-foreground"
270+
className="size-3.5 h-lh shrink-0 text-muted-foreground"
271271
/>
272272
<span className="sr-only">Ask an agent: </span>
273273
<span>

‎apps/web/src/components/settings/DiagnosticsSettings.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -987,13 +987,13 @@ export function DiagnosticsSettingsPanel() {
987987
<div className="space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5">
988988
{processDiagnosticsError ? (
989989
<div className="flex items-start gap-2 text-destructive">
990-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
990+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
991991
<span>{processDiagnosticsError.message}</span>
992992
</div>
993993
) : null}
994994
{processError ? (
995995
<div className="flex items-start gap-2 text-destructive">
996-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
996+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
997997
<span>{processError}</span>
998998
</div>
999999
) : null}
@@ -1053,13 +1053,13 @@ export function DiagnosticsSettingsPanel() {
10531053
<div className="space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5">
10541054
{processResourceError ? (
10551055
<div className="flex items-start gap-2 text-destructive">
1056-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
1056+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
10571057
<span>{processResourceError.message}</span>
10581058
</div>
10591059
) : null}
10601060
{resourceError ? (
10611061
<div className="flex items-start gap-2 text-destructive">
1062-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
1062+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
10631063
<span>{resourceError}</span>
10641064
</div>
10651065
) : null}
@@ -1136,7 +1136,7 @@ export function DiagnosticsSettingsPanel() {
11361136
<div className="space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5">
11371137
{openLogsDirectoryError ? (
11381138
<div className="flex items-start gap-2 text-destructive">
1139-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
1139+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
11401140
<span>{openLogsDirectoryError}</span>
11411141
</div>
11421142
) : null}
@@ -1147,7 +1147,7 @@ export function DiagnosticsSettingsPanel() {
11471147
traceDiagnosticsPartialFailure ? "text-warning-foreground" : "text-destructive",
11481148
)}
11491149
>
1150-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
1150+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
11511151
<span>
11521152
{traceDiagnosticsPartialFailure
11531153
? `Some trace files could not be read, so diagnostics may be incomplete. ${traceDiagnosticsError.message}`
@@ -1157,7 +1157,7 @@ export function DiagnosticsSettingsPanel() {
11571157
) : null}
11581158
{error ? (
11591159
<div className="flex items-start gap-2 text-destructive">
1160-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
1160+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
11611161
<span>{error}</span>
11621162
</div>
11631163
) : null}

‎apps/web/src/components/settings/ResourceTelemetryDiagnostics.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ export function ResourceTelemetryDiagnostics({
10651065
</div>
10661066
{telemetry.error ? (
10671067
<div className="flex items-start gap-2 border-t border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5">
1068-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
1068+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
10691069
<span>{telemetry.error}</span>
10701070
</div>
10711071
) : null}
@@ -1243,7 +1243,7 @@ export function ResourceTelemetryDiagnostics({
12431243
<div className="overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5">
12441244
{history.error ? (
12451245
<div className="flex items-start gap-2 border-b border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5">
1246-
<AlertTriangleIcon className="mt-0.5 size-3.5 shrink-0" />
1246+
<AlertTriangleIcon className="size-3.5 h-lh shrink-0" />
12471247
<span>{history.error}</span>
12481248
</div>
12491249
) : null}

‎apps/web/src/components/settings/SettingsSidebarNav.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const SETTINGS_NAV_ITEMS: ReadonlyArray<{
106106

107107
function SettingsSectionIcon({ to }: { to: SettingsPath }) {
108108
const Icon = SETTINGS_SECTION_ICONS[to];
109-
return <Icon className="mt-0.5 size-3.5 shrink-0 text-sidebar-muted-foreground/60" />;
109+
return <Icon className="size-3.5 h-5 shrink-0 text-sidebar-muted-foreground/60" />;
110110
}
111111

112112
export function SettingsSidebarNav({ pathname }: { pathname: string }) {

‎apps/web/src/components/ui/toast.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function ToastDescriptionAndExpandable({
246246
</div>
247247
<MorphIcon
248248
aria-hidden
249-
className="mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80"
249+
className="size-3.5 h-lh shrink-0 text-muted-foreground opacity-80"
250250
icon={open ? ChevronUp : ChevronDown}
251251
strokeWidth={2.25}
252252
/>

0 commit comments

Comments
 (0)