From c4e473d438e36fabe2c195dad3f52f78ae2b2934 Mon Sep 17 00:00:00 2001 From: "nekomimi.pet" Date: Mon, 19 Oct 2026 20:55:27 -0400 Subject: [PATCH] web: a calmer phone chat: no bar, a skeleton while it loads, wide tables A phone chat drops its top bar for one floating back button. Until the first page is in and scrolled to its end, the thread stays hidden behind a skeleton shaped like the end of a typical chat, measured at phone width, so it no longer shows its top and then jumps to the bottom. Tables scroll sideways instead of squeezing columns to a letter a line, and a review names files by their last two path segments with the counts kept on the same line. --- robot-docs/web.md | 6 +- web/src/lib/Phone.svelte | 55 ++++++++++-------- web/src/lib/chat/Chat.svelte | 88 ++++++++++++++++++++++++++--- web/src/lib/chat/Markdown.svelte | 10 ++++ web/src/lib/views/ReviewView.svelte | 11 +++- 5 files changed, 135 insertions(+), 35 deletions(-) diff --git a/robot-docs/web.md b/robot-docs/web.md index 932b359f3..f73007601 100644 --- a/robot-docs/web.md +++ b/robot-docs/web.md @@ -24,9 +24,11 @@ The client shares the terminal's voice. `moods.ts` is a port of `cli/internal/tu Markdown (`markdown.ts`) also understands maths and diagrams: `$…$`, `\(…\)` and `$$…$$` / `\[…\]` (a dollar amount like "$5 or $10" stays prose: the opening `$` must touch its text and no digit may follow the closing one) and ```` ```mermaid ```` blocks. They render as placeholders carrying their source, and `enhance.ts` draws them after the message mounts: KaTeX for maths (`trust: false`), Pele (pele.run) for diagrams, themed with `--pele-*` from the canvas tokens, its SVG kept to drawing (no scripts, foreign objects, event attributes or outside links). Both load only when a message needs them. -**Notes** (`nodes/NoteNode.svelte`, `anchors.ts`, `notes.ts`, `Tethers.svelte`) are small text boxes on the canvas, saved with the board. Double-click empty canvas or press N for a loose one; the composer's pop-out button moves the draft into a note tied to its chat, for writing at length. Dragging a note's grip onto something ties the note to it: a window, a message or step in a chat (`data-entry`), or a line in a diff (found by the diff's `data-diff` key and the row's number inside Pierre's shadow root); dropping it on empty canvas sets it loose. While the grip is dragged, what it would land on is outlined (`pick` in `anchors.ts`); the drag follows the pointer on the whole document, so a note redrawn mid-drag, or dismissed, never leaves the tie or its outline behind. The target and a quote of it (the diff lines, or the message's first 600 characters) are kept on the note, so what it was about survives scrolling and closing. A line runs from each tied note to its target, and a target that is a passage (diff lines, a message, a step) is tinted while on screen; the note in hand, selected or under the pointer, draws its line and tint strongest. The line is measured in screen space every frame while any note is tied, held inside the window and whatever scrolls it. Notes float above windows (`zIndex`). A tied note sends on its own (⌘↵), from its chat's "send N notes" button, or with its review; notes for one session go as one message, each quoting what it was tied to (a note tied to a chat window itself is just a message). Sent notes stay on the board, quieter, until dismissed. +**Notes** (`nodes/NoteNode.svelte`, `anchors.ts`, `notes.ts`, `Tethers.svelte`) are small text boxes on the canvas, saved with the board. Double-click empty canvas or press N for a loose one; the composer's pop-out button moves the draft into a note tied to its chat, for writing at length. Dragging a note's grip onto something ties the note to it: a window, a message or step in a chat (`data-entry`), or a line in a diff (found by the diff's `data-diff` key and the row's number inside Pierre's shadow root); dropping it on empty canvas sets it loose. Until a chat's first page is in and scrolled to its end, the thread stays hidden behind a skeleton shaped like the end of a typical chat (measured at phone width: a work line, a message, more work, the reply's last lines and its sign-off), so it never shows its top and then jumps. Tables in messages scroll sideways instead of squeezing their columns. A review names each file by its last two path segments (`…/chat/Chat.svelte`), the full path as its title. -On a narrow screen (760 px or less) the client is a plain chat app unless settings ask for the canvas (`canvasOnPhone`): `layout.svelte.ts` and `Phone.svelte` show the session list, then one session's chat filling the screen, with a back button and the browser's back between them (`history.pushState`). There a review opens inside the chat, under the line that asked for it (`views/ReviewView.svelte`, the review window's body too), and notes and pop-out are off. The phone's chat reads at 16 px unscaled with narrow margins, its header shares the chat's ground, and the composer is one row (picture, field, stop, send; the working note moves into the placeholder). +While the grip is dragged, what it would land on is outlined (`pick` in `anchors.ts`); the drag follows the pointer on the whole document, so a note redrawn mid-drag, or dismissed, never leaves the tie or its outline behind. The target and a quote of it (the diff lines, or the message's first 600 characters) are kept on the note, so what it was about survives scrolling and closing. A line runs from each tied note to its target, and a target that is a passage (diff lines, a message, a step) is tinted while on screen; the note in hand, selected or under the pointer, draws its line and tint strongest. The line is measured in screen space every frame while any note is tied, held inside the window and whatever scrolls it. Notes float above windows (`zIndex`). A tied note sends on its own (⌘↵), from its chat's "send N notes" button, or with its review; notes for one session go as one message, each quoting what it was tied to (a note tied to a chat window itself is just a message). Sent notes stay on the board, quieter, until dismissed. + +On a narrow screen (760 px or less) the client is a plain chat app unless settings ask for the canvas (`canvasOnPhone`): `layout.svelte.ts` and `Phone.svelte` show the session list, then one session's chat filling the screen, with a back button and the browser's back between them (`history.pushState`). There a review opens inside the chat, under the line that asked for it (`views/ReviewView.svelte`, the review window's body too), and notes and pop-out are off. The phone's chat reads at 16 px unscaled with narrow margins, a chat has no bar, only a floating back button over it, and the composer is one row (picture, field, stop, send; the working note moves into the placeholder). The (?) beside the wordmark opens an about pane (`About.svelte`): a one-line description (a placeholder for now), the main contributors with their Bluesky handles, thanks to everyone else with a link to the full history on tangled, and the libraries the client is built on with their licences, linking `THIRD_PARTY_NOTICES.md`. diff --git a/web/src/lib/Phone.svelte b/web/src/lib/Phone.svelte index 26e557b1f..8fae88f51 100644 --- a/web/src/lib/Phone.svelte +++ b/web/src/lib/Phone.svelte @@ -1,7 +1,5 @@
+ {#if layout.session} + + + {:else}
- {#if layout.session} - -

{session?.name || 'untitled session'}

- {#if busy(session)}{/if} - {:else} albedo - {/if}
+ {/if}
{#if layout.session} {#key layout.session} @@ -44,6 +42,7 @@