diff --git a/packages/app/src/composer/input/input.tsx b/packages/app/src/composer/input/input.tsx index 015391162..3e4a8f5c6 100644 --- a/packages/app/src/composer/input/input.tsx +++ b/packages/app/src/composer/input/input.tsx @@ -2346,7 +2346,6 @@ export const MessageInput = forwardRef( , [glyphSize], ); - // The toolbar row bleeds 6px past the input padding; the inline glyph sits on that edge. - const enterStyle = useMemo(() => [styles.enterButton, { right: -6 + railOffset }], [railOffset]); + // Fullscreen controls share the text rail; the toolbar disc owns its separate corner inset. + const enterStyle = useMemo(() => [styles.enterButton, { right: railOffset }], [railOffset]); const exitStyle = useMemo(() => [styles.iconButton, { marginRight: railOffset }], [railOffset]); return ( { }); describe("fullscreen glyph rail", () => { - it("nudges 16px fullscreen glyphs onto the Send arrow's ink edge", () => { - expect( - resolveGlyphRailOffset({ controlSize: 28, sendIconSize: 16, glyphIconSize: 16 }), - ).toBeCloseTo(4 / 3); - expect( - resolveGlyphRailOffset({ controlSize: 28, sendIconSize: 20, glyphIconSize: 16 }), - ).toBeCloseTo(1 / 6); + it.each([ + { controlSize: 28, glyphIconSize: 16 }, + { controlSize: 44, glyphIconSize: 20 }, + ])("puts the visible fullscreen edge on the text rail ($controlSize)", (geometry) => { + const offset = resolveGlyphRailOffset(geometry); + // Maximize2 and Minimize2 reach x21 in a 24-unit viewBox, with a 2-unit stroke. + const inkInset = + (geometry.controlSize - geometry.glyphIconSize) / 2 + (geometry.glyphIconSize * 2) / 24; + expect(offset + inkInset).toBeCloseTo(0); }); }); diff --git a/packages/app/src/composer/input/state.ts b/packages/app/src/composer/input/state.ts index 67c803074..2fe296940 100644 --- a/packages/app/src/composer/input/state.ts +++ b/packages/app/src/composer/input/state.ts @@ -234,21 +234,16 @@ export async function stopRealtimeVoice(ctx: StopRealtimeVoiceContext): Promise< } /** - * Offset that aligns a glyph's visible ink with the Send arrow's ink when both sit in - * equal controls on the same right rail. In Lucide's 24px viewBox ArrowUp ends at - * x19 while Maximize2/Minimize2 end at x21, so equal boxes leave the fullscreen - * glyphs visibly past the arrow. + * Put the fullscreen glyph's visible right edge on the text rail, letting its + * hit area extend into the padding. Both Lucide glyphs reach x21 of 24 and use + * the default 2-unit stroke (one viewBox unit beyond the path). */ export function resolveGlyphRailOffset(input: { controlSize: number; - sendIconSize: number; glyphIconSize: number; }): number { - const arrowInkInset = - (input.controlSize - input.sendIconSize) / 2 + (5 * input.sendIconSize) / 24; - const glyphInkInset = - (input.controlSize - input.glyphIconSize) / 2 + (3 * input.glyphIconSize) / 24; - return arrowInkInset - glyphInkInset; + const inkInset = (input.controlSize - input.glyphIconSize) / 2 + (2 * input.glyphIconSize) / 24; + return -inkInset; } export function resolveComposerSurfaceText(