Skip to content

Commit 4d5645d

Browse files
samejrclaude
andcommitted
fix(webapp): widen the theme select and correct the tooltip arrow
The trigger is now sized to the widest option, and its icon can no longer shrink - at the old width "System" and "Classic" squeezed it down to a sliver. The popover matches that width. The contrast label's arrow had its borders on the two left-hand edges rather than the two facing the handle; rotating a square clockwise sends the bottom and right edges downward, not the bottom and left. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 47d3246 commit 4d5645d

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

apps/webapp/app/components/primitives/Slider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export function Slider({
127127
{valueTooltip(currentValue)}
128128
{/* Straddles the bottom edge, hiding the border it overlaps, so the
129129
two outer sides read as an arrow pointing at the handle. */}
130-
<span className="absolute left-1/2 top-full size-2 -translate-x-1/2 -translate-y-1/2 rotate-45 border-b border-l border-grid-bright bg-background-bright" />
130+
<span className="absolute left-1/2 top-full size-2 -translate-x-1/2 -translate-y-1/2 rotate-45 border-b border-r border-grid-bright bg-background-bright" />
131131
</span>
132132
)}
133133
</RadixSlider.Thumb>

apps/webapp/app/routes/account._index/route.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ const DEFAULT_CONTRAST_MARK = 20;
4848

4949
function themeIcon(value: ThemePreference) {
5050
const Icon = THEME_OPTIONS_BY_VALUE[value].icon;
51-
return <Icon className="size-4 text-text-bright" />;
51+
// shrink-0: without it the icon is the flex item that gives way to a long
52+
// label, and "System"/"Classic" squash it to a sliver.
53+
return <Icon className="size-4 shrink-0 text-text-bright" />;
5254
}
5355

5456
function createSchema(
@@ -309,10 +311,12 @@ export default function Page() {
309311
{THEME_OPTIONS_BY_VALUE[value].label}
310312
</span>
311313
)}
312-
className="w-22"
314+
// Sized to the widest option (Classic, 106px) so no label
315+
// squeezes its icon, rounded up to the nearest step.
316+
className="w-27"
313317
// The popover's 180px floor left a gap past the longest
314-
// label; track the trigger's width instead.
315-
popoverClassName="min-w-22"
318+
// label; match the trigger instead.
319+
popoverClassName="min-w-27"
316320
>
317321
{(items) =>
318322
items.map((item) => (

0 commit comments

Comments
 (0)