feat(ui): the minimised chat composer is wider and taller, with larger text

This commit is contained in:
sam committed 2026-11-14 12:14:02 +11:00
1 parent 236d0b678a
commit 432e6280d6
3 files changed
+14 -8

No files matched your search

+3 -3
View File
@@ -199,7 +199,7 @@ function onKeydown(event: KeyboardEvent): void {
</script>
<template>
<div :class="flat ? 'p-1.5' : 'border-t p-3'">
<div :class="flat ? 'p-2' : 'border-t p-3'">
<ul v-if="queuedMessages.length" aria-label="Queued messages" class="mb-2 flex flex-col gap-1">
<li
v-for="(queued, index) in queuedMessages"
@@ -257,7 +257,7 @@ function onKeydown(event: KeyboardEvent): void {
cn(
'relative flex gap-2 rounded-xl border transition-colors duration-200',
// Minimised, the field is one line: the controls centre on it.
flat ? 'items-center border-transparent px-1.5 py-1' : 'items-end border-border-strong bg-muted px-3 py-2.5',
flat ? 'items-center border-transparent px-2 py-1.5' : 'items-end border-border-strong bg-muted px-3 py-2.5',
)
"
>
@@ -274,7 +274,7 @@ function onKeydown(event: KeyboardEvent): void {
aria-controls="slash-palette"
:aria-expanded="isCommandMenuOpen ? 'true' : 'false'"
:aria-activedescendant="isCommandMenuOpen && commandMatches.length ? `slash-palette-option-${commandSelection}` : undefined"
:class="cn('max-h-40 flex-1 resize-none rounded-none border-0 bg-transparent! px-0 text-label pointer-coarse:text-base shadow-none focus-visible:ring-0', flat ? 'min-h-8 py-1.5 leading-5' : 'min-h-11 py-1')"
:class="cn('max-h-40 flex-1 resize-none rounded-none border-0 bg-transparent! px-0 text-label pointer-coarse:text-base shadow-none focus-visible:ring-0', flat ? 'min-h-10 py-2.5 text-base leading-5' : 'min-h-11 py-1')"
@input="onInput"
@keydown="onKeydown"
/>
+4 -2
View File
@@ -27,6 +27,8 @@ export const LEGACY_DOCK_STORAGE_KEY = "archie.chat.dock";
export const MIN_W = 320;
export const MIN_H = 280;
export const MAX_W = 720;
/** The minimised bar is at least this wide, screen permitting. */
export const BAR_W = 640;
/** Margin kept between a floating window and the viewport edge. */
export const INSET = 8;
/** Pointer distance from a side edge that offers the snap preview. */
@@ -120,8 +122,8 @@ export function snapEdge(pointerX: number, vw: number, edge = EDGE): "left" | "r
* bottom offset so the bar's own height never has to be known here.
*/
export function barPlacement(rect: Rect, mode: DockMode, vw: number): { x: number; bottom: number; w: number } {
const w = rect.w;
const x = mode === "left" ? 0 : mode === "right" ? Math.max(0, vw - w) : rect.x;
const w = Math.max(rect.w, Math.min(BAR_W, vw - INSET * 2));
const x = mode === "left" ? 0 : mode === "right" ? Math.max(0, vw - w) : clamp(rect.x, INSET, Math.max(INSET, vw - w - INSET));
return { x, bottom: INSET, w };
}
+7 -3
View File
@@ -133,9 +133,13 @@ test("a pointer near a side edge offers that pinned split, otherwise none", () =
// Guards the minimised composer floating mid-page under where the window was.
test("the minimised bar docks at the bottom of the screen on the pinned side", () => {
const rect = { x: 300, y: 100, w: 440, h: 560 };
assert.deepEqual(barPlacement(rect, "float", VW), { x: 300, bottom: 8, w: 440 });
assert.deepEqual(barPlacement(rect, "left", VW), { x: 0, bottom: 8, w: 440 });
assert.deepEqual(barPlacement(rect, "right", VW), { x: 1280 - 440, bottom: 8, w: 440 });
assert.deepEqual(barPlacement(rect, "float", VW), { x: 300, bottom: 8, w: 640 });
assert.deepEqual(barPlacement(rect, "left", VW), { x: 0, bottom: 8, w: 640 });
assert.deepEqual(barPlacement(rect, "right", VW), { x: 1280 - 640, bottom: 8, w: 640 });
// A bar that would run off the right edge slides back on screen.
assert.deepEqual(barPlacement({ ...rect, x: 900 }, "float", VW), { x: 1280 - 640 - 8, bottom: 8, w: 640 });
// A narrow screen caps the bar at its width.
assert.deepEqual(barPlacement({ ...rect, x: 0, w: 320 }, "float", 500), { x: 8, bottom: 8, w: 484 });
});
test("the old edge-pin preference migrates into the new key and is removed", () => {