Skip to content

Commit 6909d36

Browse files
committed
fix(zoom): put the custom level on the preset row, drop the blur hint
1 parent 48b7f60 commit 6909d36

1 file changed

Lines changed: 32 additions & 31 deletions

File tree

‎src/components/ai-edition/v4/FloatingInspector.tsx‎

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -515,37 +515,38 @@ export function ZoomLevelControl({
515515

516516
return (
517517
<>
518-
{/* A level outside the row presses no button; the field below shows it. With no
519-
preset within reach, the row goes and the field alone remains. */}
520-
{presets.length > 0
521-
? paneStack(
522-
ts("zoom.level"),
523-
<ChoiceRow<number>
524-
label={ts("zoom.level")}
525-
options={presets}
526-
value={requested}
527-
onChange={setScale}
528-
/>,
529-
)
530-
: null}
531-
{paneRow(
532-
ts("zoom.customScale"),
533-
<input
534-
type="text"
535-
inputMode="decimal"
536-
aria-label={ts("zoom.customScale")}
537-
placeholder={`${requested}×`}
538-
value={draft}
539-
onChange={(e) => setDraft(e.target.value)}
540-
onBlur={commitDraft}
541-
// Enter blurs, and the blur handler commits: one path, so a keyboard commit
542-
// can't apply the same draft twice.
543-
onKeyDown={(e) => {
544-
if (e.key === "Enter") e.currentTarget.blur();
545-
}}
546-
className={shell.control}
547-
style={{ width: 84, textAlign: "right" }}
548-
/>,
518+
{/* A level outside the row presses no button; the field beside it shows it. With no
519+
preset within reach, the field alone remains. */}
520+
{paneStack(
521+
ts("zoom.level"),
522+
<div style={{ display: "flex", gap: 6, alignItems: "center" }}>
523+
{presets.length > 0 ? (
524+
<div style={{ flex: 1, minWidth: 0 }}>
525+
<ChoiceRow<number>
526+
label={ts("zoom.level")}
527+
options={presets}
528+
value={requested}
529+
onChange={setScale}
530+
/>
531+
</div>
532+
) : null}
533+
<input
534+
type="text"
535+
inputMode="decimal"
536+
aria-label={ts("zoom.customScale")}
537+
placeholder={`${requested}×`}
538+
value={draft}
539+
onChange={(e) => setDraft(e.target.value)}
540+
onBlur={commitDraft}
541+
// Enter blurs, and the blur handler commits: one path, so a keyboard commit
542+
// can't apply the same draft twice.
543+
onKeyDown={(e) => {
544+
if (e.key === "Enter") e.currentTarget.blur();
545+
}}
546+
className={shell.control}
547+
style={{ width: 56, textAlign: "right" }}
548+
/>
549+
</div>,
549550
)}
550551
</>
551552
);

0 commit comments

Comments
 (0)