mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:57:09 +01:00
* feat(fields): sixteen text boxes get the microphone; chatkit 0.25 Fleet experience standard, step 9. The experience audit counted 34 hand-made text areas with no microphone; it now counts 17, and package-plan.json sets the ceiling at today's counts so the number can only fall. - @bitbaum/chatkit 0.22.1 -> 0.25.0. Composer behaviour and the class names Loki overrides are unchanged; LOKI_VOICE keeps the transcribe route's own sentence (showServerDetail), which names the fix. - <TextArea> (components/ui/text-area.tsx): Loki's one adapter over chatkit's DictationField, drawn to match ui-input. Sixteen files use it. One file is exempt with its reason on its first line (URL paths, one per line). - Field takes htmlFor, so its label names the control and a press on it focuses the field. - A signed-out visitor's microphone is the browser's own recogniser (VISITOR_VOICE): the server leg answers 401 without a session, so on /change the mic recorded a whole take and then failed. - The widget chat bundle budget goes 40 -> 41 KB: 41,414 -> 41,614 bytes gzipped, the two new dictation problems a person can act on. The other seventeen wait for props the shared field gains in bitbaum/chatkit#85 (autoFocus, onKeyDown, onBlur/onFocus, name, inputProps). The stylesheet in this commit also carries the public-site rules of the next one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * feat(public): say it on the first screen; a shorter homepage; a header that stays The way in - The homepage's one action is the shared composer. What a signed-out visitor says is kept in the tab (lib/first-words), shown back on sign-up and handed to the new-project form at the end of onboarding or sign-in. With a sentence carried, onboarding does not ask for a project name, a folder and a GitHub address first. The homepage - 10.66 -> 7.48 phone screens at 390x844, 6.6 -> 5.11 at 1440x900. - Three figures for the three steps, drawn in tokens (LoopFigure). - Three problems on the homepage, all twelve on /why. Where it runs is one sentence and two links. The closing block is the shared FinalCta. - One label for sign-up everywhere: Start a project. Header, menu, footer - The header was sticky in name only: .ui-public-surface was overflow: hidden, which made it the sticky container. overflow-x: clip. - The phone menu takes focus, keeps Tab inside and hands focus back. - The Product menu opens on a press, not on hover. - Navigation and Sign in show from 1120px (was 1280px). - A 2px focus ring, on the public surface and as the app-wide fallback. - A skip link. Four footer groups instead of five. Corners - An unknown address outside the app drew the framework's bare 404 with no way back; the in-app one said Back to Today and went to Loki; the error page printed the raw error; the loading placeholder drew cards on pages that are rows. The share image leads with the headline. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * fix(ux): dates render once; rows say the part that matters; a person's words - APP_LOCALE is a server variable, so a client component formatted dates in the default locale while the server used the configured one: a hydration error on /approvals with APP_LOCALE=de-CH. next.config.ts hands the same value to the browser as NEXT_PUBLIC_APP_LOCALE. - Home's running rows lead with the live step. A phone row holds about thirty characters and every row read 'Next best step · Editing src/app/pa…'. - The workbench's three rows on a phone were each cut before the words that say what the row is for. - Terminal without cloud access, Home's first-run row and the widget row use the person's words (computer, Loki button), not ours (runner, widget). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * docs(ux): the November UX pass, the public surface map, the changelog Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * feat(fields): the remaining text boxes get the microphone; chatkit 0.27 The second step of the fleet's experience standard for Loki. The shared field gained what a form's text area needs in bitbaum/chatkit#85 (0.27.0): autoFocus, onKeyDown, a submit key, a field-level blur, name, inputProps. Sixteen more files move onto <TextArea>; the experience audit goes bareTextareas 17 -> 1 and the ceiling in package-plan.json follows. Kept, file by file: Cmd/Ctrl+Enter saves where Cmd+Enter did (goal and person notes, project description, the idea step), Escape still cancels, Enter still sends an interview answer and confirms a queued prompt, notes still save when focus leaves the field, and an inline editor no longer closes when its microphone is pressed. The studio's forms still read their text by name from the native form. The scheduled job's prompt keeps the mono face and spell-check off. ProjectBriefFill's separate Speak button is the field's own microphone now (the same transcribe route). Left: control/prompt-input.tsx, a prompt box with its own attachments and paste-to-attach. It is a composer, not a form field. Checked: tsc, lint, the design gate, file inputs, 599 unit-test files; in a browser, autofocus, both submit keys, Escape, save on blur and not on the microphone, 44px microphone and 16px text at 390, and the chat and Home composers after the bump. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * test: a git fixture cannot reach the real repository from a hook in a linked worktree A hook run from a linked worktree exports an absolute GIT_DIR, which overrides git -C <sandbox>. dispatch-launch-dir.ts ran its fixture commands with that environment, so a pre-push from a second worktree wrote a test@test init commit onto the branch being pushed and set core.bare = true, a test identity and a hooks path of /dev/null in the real config. Nothing reached the remote; the repository was repaired by hand. worktree-workspace.ts already clears those variables for itself. The unit runner now clears them once for every test, and dispatch-launch-dir.ts does so for a direct run. Checked: with a bogus GIT_DIR inherited, the test passes and the real repository is untouched. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * docs(ux): the text boxes' second step, and what is left Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * chore(deps): chatkit 0.28.1, where a dictated take respects a field's maxLength bitbaum/chatkit#87, found while reviewing this branch's converted fields. 0.28 also draws a visible border on the composer while it has keyboard focus and stops thread-following from scrolling the page up. Checked on 0.28.1: the chat, Home and homepage boxes at 390px in both themes (text goes in, send enables, no sideways scroll, no console errors), tsc, lint, the design gate and the widget size test (41 KB budget holds). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 * Revert "feat(fields): thirty-two text boxes get the microphone; chatkit 0.28.1" This reverts commit2f2f3756a2, reversing changes made to7f8e731b08. * fix(ux): what the signed-in audit found first: a short message wraps, a field vanishes, pages slide on load Seven groups of signed-in screens were audited in a browser on 2026-11-12 (docs/development/ux-audit-signed-in-2026-11.md): 84 findings, each with a measurement. These are the blockers and the shell-wide ones, each reproduced on main first and measured again after. - A sent message was capped at 75-90% of a stack that shrinks to fit it, so it always wrapped: "What's going on?" was 106px on two lines where one line needs 141px. The cap is on the stack now. - Onboarding: the "Project name" field was replaced by a read-only row as soon as the name was not empty, that is after one keystroke. The row is for a repository that was picked. - A wrong password said nothing: Auth.js answers a refused sign-in with 200 and the reason in `error`, and the forms tested `ok`. One helper, lib/auth/sign-in-result. - A sentence carried from the homepage over 300 characters ended in "Invalid body": 2000 kept by the homepage, 300 in the form and the route. One number (config/project-brief); only the GitHub repository description is cut, at a word. The refusal is drawn beside the button. - Revoking a computer's token took one tap and removed the row even when the server refused. It asks in a sheet and reads the answer. - Every desktop load slid the page: the server drew the sidebar open and the browser folded it. The choice is in a cookie the layout reads; layout shift 0.19 -> 0.000 on Home, Projects and Approvals. The chat's "Recent" list is hidden by CSS, not by a viewport test after load: 0.5 -> 0.03. - The app has a skip link ("Skip to content" is the first Tab stop; the page's first control was the 22nd). The sidebar's navigation is named, the logo link is named, and a folded rail item shows its name on focus. - The desktop notifications panel is a dialog on <body>: its click-away layer was trapped in the top bar by the bar's blur, so a click on the page went through, and Escape did nothing. - The More sheet, the Sessions drawer and the command palette take the keyboard when they open, keep Tab inside and give focus back. - The account button and the page action in the phone top bar are 44px (40px circle inside), not 40. Pins: scripts/test/ux-round-two.ts, scripts/test/project-brief.ts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmsyW2aAn78GgfRxyn5 --------- Co-authored-by: Claude <noreply@anthropic.com>
55 lines
2.3 KiB
TypeScript
55 lines
2.3 KiB
TypeScript
/**
|
|
* One limit for "what do you want to build?" (config/project-brief).
|
|
*
|
|
* A sentence carried from the homepage (up to 2000 characters) reached a form
|
|
* whose box and route allowed 300, and Create answered "Invalid body". This
|
|
* pins the three places to one number and the repository description to its
|
|
* own shorter one.
|
|
*
|
|
* npx tsx scripts/test/project-brief.ts
|
|
*/
|
|
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
import {
|
|
PROJECT_BRIEF_MAX,
|
|
REPO_DESCRIPTION_MAX,
|
|
repoDescription,
|
|
} from "../../src/config/project-brief";
|
|
import { firstWordsHref } from "../../src/lib/first-words";
|
|
|
|
const read = (p: string) => readFileSync(resolve(process.cwd(), p), "utf8");
|
|
|
|
// The route takes what the form sends, and the form takes what the homepage keeps.
|
|
const route = read("src/app/api/projects/create-with-github/route.ts");
|
|
assert.match(route, /description: z\.string\(\)\.trim\(\)\.max\(PROJECT_BRIEF_MAX\)/);
|
|
assert.match(route, /repoDescription\(description\)/);
|
|
const page = read("src/app/(app)/control/new-from-scratch/page.tsx");
|
|
assert.match(page, /brief: PROJECT_BRIEF_MAX/);
|
|
assert.match(page, /maxLength=\{PROJECT_BRIEF_MAX\}/);
|
|
assert.doesNotMatch(page, /maxLength=\{300\}/);
|
|
|
|
// A carried sentence is cut at the same number, never longer than the route takes.
|
|
const long = "a".repeat(PROJECT_BRIEF_MAX + 50);
|
|
const carried = decodeURIComponent(firstWordsHref(long).split("brief=")[1]);
|
|
assert.equal(carried.length, PROJECT_BRIEF_MAX);
|
|
|
|
// The repository description: whole when it fits, cut at a word otherwise.
|
|
assert.equal(repoDescription("A website for my bakery"), "A website for my bakery");
|
|
assert.equal(repoDescription(" two\n lines "), "two lines");
|
|
const sentence = Array.from({ length: 80 }, (_, i) => `word${i}`).join(" ");
|
|
const short = repoDescription(sentence);
|
|
assert.ok(short.length <= REPO_DESCRIPTION_MAX, `${short.length} > ${REPO_DESCRIPTION_MAX}`);
|
|
assert.ok(short.endsWith("…"));
|
|
assert.ok(
|
|
!/word\d+…$/.test(short) || sentence.includes(short.slice(0, -1)),
|
|
"cut at a word boundary",
|
|
);
|
|
assert.ok(sentence.startsWith(short.slice(0, -1)));
|
|
// One unbroken run is cut hard rather than dropped.
|
|
assert.equal(repoDescription("x".repeat(900)).length, REPO_DESCRIPTION_MAX);
|
|
|
|
console.log(
|
|
"✓ project-brief: one limit for the brief; the repository description is cut at a word",
|
|
);
|