git clone https://garage44.eu/jeroen/midas.gitcartopolis-agent · 2026-11-24T20:20:45Z
revert(web): a session's conversation reads oldest first again Reverts ac0e1df. The person wants the log as it was: from the start at the top to the newest at the foot, with the message box under it and the foldable box's handle above it on a phone.
web/src/app.css | 55 +++++----------
web/src/components/fold.tsx | 40 +++++------
web/src/components/main.tsx | 2 +-
web/src/components/sessions.tsx | 153 +++++++++++++++++++++-------------------
4 files changed, 120 insertions(+), 130 deletions(-)
diff --git a/web/src/app.css b/web/src/app.css
index 45b2f61..2a6edd0 100644
--- a/web/src/app.css
+++ b/web/src/app.css
@@ -1424,17 +1424,15 @@ code {
interpolate-size: allow-keywords;
}
-/* Scrolled down while more came: a chip at the top of the view takes the person up to it. */
+/* Scrolled up while more came: a chip at the foot of the view takes the person down to it. */
.jump-new {
position: sticky;
- top: var(--m-space-3);
- z-index: 2;
+ bottom: var(--m-space-3);
align-self: center;
display: inline-flex;
align-items: center;
gap: 6px;
- /* Hidden, it takes no room above the newest: its height and the gap after it given back. */
- margin-bottom: calc(-1 * (1lh + 12px + var(--m-space-2)));
+ margin-top: calc(-1 * var(--m-space-5));
padding: 6px 12px;
border: 0;
border-radius: var(--m-radius-full);
@@ -1446,7 +1444,7 @@ code {
font-weight: 700;
cursor: pointer;
opacity: 0;
- transform: translateY(-12px) scale(0.9);
+ transform: translateY(12px) scale(0.9);
pointer-events: none;
transition:
opacity var(--dur-state) var(--ease-out),
@@ -2038,7 +2036,7 @@ code {
font-size: 16px;
}
-/* The message box's fold: a bar under it on a phone, and all that is left of it when folded. */
+/* The message box's fold: a bar above it on a phone, and all that is left of it when folded. */
.fold__bar,
.fold__shut {
display: none;
@@ -2062,7 +2060,7 @@ code {
gap: 6px;
width: 100%;
min-height: 24px;
- margin: 2px 0 calc(-1 * var(--m-space-1));
+ margin: calc(-1 * var(--m-space-1)) 0 2px;
padding: 0;
border: 0;
background: none;
@@ -2095,10 +2093,10 @@ code {
background: var(--m-accent);
}
- /* Folded: a slim lifted pill, the composer's own shape, with its handle underneath,
+ /* Folded: a slim lifted pill, the composer's own shape, with its handle on top,
and in it a field to reply in beside the header's buttons. */
.fold--shut {
- padding: 6px 6px 2px;
+ padding: 2px 6px 6px;
border: 1px solid var(--m-border);
border-radius: 22px;
background: var(--m-surface);
@@ -2107,7 +2105,7 @@ code {
.fold--shut .fold__bar {
min-height: 14px;
- margin: 4px 0 0;
+ margin: 0 0 4px;
}
/* Sized by the screen, never by the draft: its one unwrapped line set the page's
@@ -2193,7 +2191,7 @@ code {
background: var(--m-accent);
}
- /* Two lines, and as much more as it was dragged down for: under the finger while dragged, gliding to rest after. */
+ /* Two lines, and as much more as it was dragged up for: under the finger while dragged, gliding to rest after. */
.fold .session__say .session__message {
min-height: calc(2lh + 8px + var(--fold-grow, var(--fold-grow-kept, 0px)));
transition: min-height 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
@@ -2217,7 +2215,7 @@ code {
display: none;
}
- /* Pulled down from folded: the box comes down under the finger, the folded field giving way to it. */
+ /* Pulled up from folded: the box comes up under the finger, the folded field giving way to it. */
.fold--shut.fold--peek .fold__shut {
display: none;
}
@@ -3127,7 +3125,7 @@ code {
@keyframes msg-enter {
from {
opacity: 0;
- transform: translateY(-6px);
+ transform: translateY(6px);
}
}
@@ -4995,28 +4993,11 @@ code {
}
}
-/* A session reads newest first, so its message box (the Shell's footer) sits under the
- header, beside the newest, and the conversation scrolls beneath it. */
-.midas--session .m-shell__main {
- grid-template-rows: auto auto minmax(0, 1fr);
-}
-
-.midas--session .m-shell__footer {
- grid-row: 2;
- border-top: 0;
- border-bottom: 1px solid var(--m-border);
-}
-
-.midas--session .m-shell__content {
- grid-row: 3;
- padding-bottom: calc(var(--m-space-5) + env(safe-area-inset-bottom));
-}
-
-/* The composer floats in its own box: around it is the page, not a bar. */
+/* The composer floats in its own box: the foot under it is the page, not a bar. */
.m-shell__footer:has(.session__say) {
- border-bottom: 0;
+ border-top: 0;
background: var(--m-bg);
- padding-bottom: var(--m-space-1);
+ padding-top: var(--m-space-1);
}
/* The tabs: frosted over what scrolls beneath. */
@@ -5027,7 +5008,7 @@ code {
@media (max-width: 720px) {
.m-shell__footer:has(.session__say) {
- padding: var(--m-space-2) var(--m-space-2) var(--m-space-1);
+ padding: var(--m-space-1) var(--m-space-2) calc(var(--m-space-2) + env(safe-area-inset-bottom));
}
}
@@ -5265,13 +5246,13 @@ code {
color: var(--m-danger);
}
-/* How it gets a node (nodeline.tsx): one line over the conversation, the label then where it is. */
+/* How it gets a node (nodeline.tsx): one line under the conversation, the label then where it is. */
.msg__node {
display: flex;
flex-direction: column;
gap: var(--m-space-1);
padding: var(--m-space-1) var(--m-space-3);
- border-bottom: 1px solid var(--m-border);
+ border-top: 1px solid var(--m-border);
font-size: var(--m-font-size-sm);
color: var(--m-text-dim);
font-variant-numeric: tabular-nums;
diff --git a/web/src/components/fold.tsx b/web/src/components/fold.tsx
index 7db6cb4..9a49e41 100644
--- a/web/src/components/fold.tsx
+++ b/web/src/components/fold.tsx
@@ -8,11 +8,11 @@ const fold = local({shut: read('midas-composer-shut') === '1', grow: Number(read
/** The most the box grows by: half the screen, so the conversation keeps the rest. */
const maxGrow = () => Math.round(window.innerHeight * 0.5)
-/** The folded field's height (app.css `.fold__reply`): a box pulled open from folded starts from it. */
+/** The folded field's height (app.css `.fold__reply`): a box pulled up from folded starts from it. */
const FIELD = 38
/** Dragged this far, it is a drag and not a tap: a finger wobbles more than a mouse. */
const SLOP = 8
-/** Pushed up this far past its two lines, it folds away; pulled down this far from folded, it opens. */
+/** Dragged down this far past its two lines, it folds away; up this far from folded, it opens. */
const SNAP = 56
/** A flick this fast (px/ms) settles it the way it was thrown, however short. */
const FLING = 0.4
@@ -56,8 +56,8 @@ function reveal(el: HTMLElement, from: number) {
/**
* The open box folds, and shrinks from its height (as the finger left it) to the folded
- * pill's. Folded first and then shrunk: the body slid to nothing went all the way to
- * the edge of the page, and the pill then jumped back out of it.
+ * pill's. Folded first and then shrunk: the body slid to nothing went all the way down
+ * to the page's foot, and the pill then jumped back up out of it.
*/
function collapse(el: HTMLElement) {
const start = el.offsetHeight
@@ -107,9 +107,9 @@ type Drag = {
grow: number
moved: boolean
el: HTMLElement
- /** The open body's height when the drag began: what folding it away squeezes. */
+ /** The open body's height when the drag began: what folding it down squeezes. */
height: number
- /** Where the finger is now, from where it started (down, which opens it, is negative: the box hangs under the header). */
+ /** Where the finger is now, from where it started (up is negative). */
dy: number
/** The last few positions, for how fast it was let go. */
trail: {t: number; y: number}[]
@@ -123,7 +123,7 @@ let draggedAt = 0
/** Past its end the box gives less and less, as a sheet does, rather than stopping dead. */
const rubber = (over: number) => (over <= 0 ? 0 : Math.sqrt(over) * 4)
-/** How fast the finger was moving when it lifted, in px/ms (up, towards folding, is positive). */
+/** How fast the finger was moving when it lifted, in px/ms (down is positive). */
function velocity(d: Drag): number {
const now = performance.now()
// A phone sends a fast flick as one or two moves: the last two are enough then.
@@ -132,14 +132,14 @@ function velocity(d: Drag): number {
if (recent.length < 2) return 0
const a = recent[0]
const b = recent[recent.length - 1]
- return b.t > a.t ? (a.y - b.y) / (b.t - a.t) : 0
+ return b.t > a.t ? (b.y - a.y) / (b.t - a.t) : 0
}
/** Where the box would settle with the finger `dy` px from where it started, thrown at `v`. */
function settle(d: Drag, dy: number, v = 0): {shut: boolean; grow: number} {
if (fold.shut) return dy < -SNAP || (v < -FLING && dy < 0) ? {shut: false, grow: 0} : {shut: true, grow: fold.grow}
const grow = d.grow - dy
- // Flicked up: a tall box goes back to its two lines, one at its two lines folds away.
+ // Flicked down: a tall box goes back to its two lines, one at its two lines folds away.
if (grow < -SNAP || (v > FLING && grow < SNAP)) return {shut: true, grow: 0}
if (v > FLING) return {shut: false, grow: 0}
return {shut: false, grow: Math.max(0, Math.min(maxGrow(), Math.round(grow)))}
@@ -164,14 +164,14 @@ function follow() {
el.classList.add('fold--dragging')
el.classList.toggle('fold--letgo', settle(drag, dy).shut !== fold.shut)
if (fold.shut) {
- // Folded, the box comes down under the finger as far as it is pulled.
+ // Folded, the box comes up under the finger as far as it is pulled.
el.classList.toggle('fold--peek', dy < 0)
el.style.setProperty('--fold-peek', `${Math.max(0, -dy)}px`)
return
}
const grow = drag.grow - dy
const max = maxGrow()
- // Down: the box grows with the finger, giving at its limit. Up past its two lines: it is squeezed.
+ // Up: the box grows with the finger, giving at its limit. Down past its two lines: it is squeezed.
el.style.setProperty('--fold-grow', `${Math.max(0, Math.min(grow, max) + rubber(grow - max))}px`)
if (!body) return
if (grow < 0) {
@@ -202,11 +202,11 @@ const handlers = {
const dy = e.clientY - drag.y
if (!drag.moved && Math.abs(dy) < SLOP) return
if (!drag.moved) {
- // Taken from where the finger is now, so passing the slop is not a jump.
+ // Taken up from where the finger is now, so passing the slop is not a jump.
drag.moved = true
drag.y += Math.sign(dy) * SLOP
}
- drag.dy = drag.y - e.clientY
+ drag.dy = e.clientY - drag.y
drag.trail.push({t: performance.now(), y: e.clientY})
if (drag.trail.length > 8) drag.trail.shift()
if (!drag.frame) drag.frame = requestAnimationFrame(follow)
@@ -219,14 +219,14 @@ const handlers = {
// A tap: its click does it (`tapped`).
if (!d.moved) return unpeek(d.el)
draggedAt = performance.now()
- d.dy = d.y - e.clientY
+ d.dy = e.clientY - d.y
d.trail.push({t: performance.now(), y: e.clientY})
const to = settle(d, d.dy, velocity(d))
const body = bodyOf(d.el)
d.el.classList.remove('fold--dragging', 'fold--letgo')
if (fold.shut) {
if (to.shut) {
- // Not pulled far enough: back up into the pill.
+ // Not pulled far enough: back down into the pill.
if (body && d.el.classList.contains('fold--peek')) springBack(d.el, body, FIELD + Math.max(0, -d.dy), FIELD)
else unpeek(d.el)
return
@@ -268,10 +268,10 @@ const handlers = {
}
/**
- * The message box under the page's header, foldable on a phone so the conversation
- * has the screen to be read. A handle under it, a pull-down sheet's: tapped, it folds
- * the box away or brings it back; dragged, the box follows the finger — down for
- * more room to write, up to fold it away, a flick either way enough. On a
+ * The message box at the page's foot, foldable on a phone so the conversation
+ * has the screen to be read. A handle above it, a sheet's: tapped, it folds the
+ * box away or brings it back; dragged, the box follows the finger — up for
+ * more room to write, down to fold it away, a flick either way enough. On a
* wider screen it is always open.
*
* Folded, it reads as a field to reply in, with the header's buttons (`tools`)
@@ -300,6 +300,7 @@ export function foldable(body: m.Children, o: {draft?: string; tools?: m.Childre
)
return (
<div class={`fold${fold.shut ? ' fold--shut' : ''}`} style={{'--fold-grow-kept': `${fold.grow}px`}}>
+ {bar('fold__bar', <span class="fold__grip" aria-hidden="true" />)}
{fold.shut ? (
<div class="fold__shut">
{bar(
@@ -314,7 +315,6 @@ export function foldable(body: m.Children, o: {draft?: string; tools?: m.Childre
</div>
) : null}
<div class="fold__body">{body}</div>
- {bar('fold__bar', <span class="fold__grip" aria-hidden="true" />)}
</div>
)
}
diff --git a/web/src/components/main.tsx b/web/src/components/main.tsx
index 1b75a26..4d07818 100644
--- a/web/src/components/main.tsx
+++ b/web/src/components/main.tsx
@@ -426,7 +426,7 @@ export class Main extends MithrilComponent {
return (
<div class="app-frame">
<Shell
- class={inSession() ? 'midas midas--session' : 'midas'}
+ class="midas"
navLabel="Midas hub"
navOpen={bind(layout, 'navOpen')}
navWidth={width('navWidth')}
diff --git a/web/src/components/sessions.tsx b/web/src/components/sessions.tsx
index bec194c..163baff 100644
--- a/web/src/components/sessions.tsx
+++ b/web/src/components/sessions.tsx
@@ -769,9 +769,29 @@ function render(items: LogItem[], s: Hosted) {
const i = out.findIndex((v) => (atOf.get(Number((v.attrs as Record<string, unknown> | undefined)?.['data-n'])) ?? 0) > mile.at)
out.splice(i < 0 ? out.length : i, 0, mile.view)
}
- // Newest first: what it does now under the message box, the past further down. Each block
- // reads as written, so a reply sits above the steps that led to it.
- const shown: m.Vnode[] = []
+ // Only the latest blocks, until the earlier ones are asked for: a search hit among them asks.
+ let shown = out
+ const hidden = drawn.all === s.id ? 0 : out.length - RECENT_BLOCKS
+ if (hidden > 0) {
+ const firstShown = Number((out[hidden].attrs as Record<string, unknown> | undefined)?.['data-n'] ?? 0)
+ if (jump && jump.id === s.id && jump.n < firstShown) {
+ showAll(s.id)
+ return render(items, s)
+ }
+ shown = [
+ <div key="earlier" class="msg__earlier">
+ <Button size="sm" variant="secondary" onclick={() => showAll(s.id)}>
+ Show {hidden} earlier
+ </Button>
+ </div>,
+ ...out.slice(hidden),
+ ]
+ }
+ const first = opening(s, items)
+ if (first) shown.push(<div key="opening" class="msg msg--user md">{markdown(first.text ?? '')}</div>)
+ sending.list.forEach((p, i) => {
+ if (p.session === s.id && !arrived(p, items, s)) shown.push(<div key={`sending:${p.at}:${i}`} class="msg msg--user md msg--sending">{markdown(p.text)}</div>)
+ })
const doing = activity(items, s)
if (doing)
shown.push(
@@ -785,41 +805,16 @@ function render(items: LogItem[], s: Hosted) {
<Elapsed since={doing.since} typical={doing.typical} />
</div>,
)
- const first = opening(s, items)
- if (!doing && !first) {
+ else if (!first) {
const end = endBar(s, lastEnd)
if (end) {
end.key = 'end'
shown.push(end)
}
}
- // How it gets a node, under what it is doing: in line and who holds them, or the node it is on.
+ // How it gets a node, under it all: in line and who holds them, or the node it is on.
const node = nodeFoot(s)
if (node) shown.push(node)
- const mine: m.Vnode[] = []
- sending.list.forEach((p, i) => {
- if (p.session === s.id && !arrived(p, items, s)) mine.push(<div key={`sending:${p.at}:${i}`} class="msg msg--user md msg--sending">{markdown(p.text)}</div>)
- })
- shown.push(...mine.reverse())
- if (first) shown.push(<div key="opening" class="msg msg--user md">{markdown(first.text ?? '')}</div>)
- // Only the latest blocks, until the earlier ones are asked for: a search hit among them asks.
- const hidden = drawn.all === s.id ? 0 : out.length - RECENT_BLOCKS
- if (hidden > 0) {
- const firstShown = Number((out[hidden].attrs as Record<string, unknown> | undefined)?.['data-n'] ?? 0)
- if (jump && jump.id === s.id && jump.n < firstShown) {
- showAll(s.id)
- return render(items, s)
- }
- }
- shown.push(...out.slice(Math.max(0, hidden)).reverse())
- if (hidden > 0)
- shown.push(
- <div key="earlier" class="msg__earlier">
- <Button size="sm" variant="secondary" onclick={() => showAll(s.id)}>
- Show {hidden} earlier
- </Button>
- </div>,
- )
return shown
}
@@ -853,9 +848,9 @@ function turnCut(reason: string | undefined): string | null {
}
/**
- * Idle, at the head of the conversation once a turn has ended and nothing runs
+ * Idle, at the foot of the conversation once a turn has ended and nothing runs
* for it: since when, how it stopped, and where its branch is. Nothing while it
- * works, asks (the card below is the signal) or has finished (its own line says so).
+ * works, asks (the card above is the signal) or has finished (its own line says so).
*/
/** When a landed session goes live, as far as the hub has planned it: "live around 12:00". */
function liveWhen(s: Hosted): string {
@@ -887,10 +882,10 @@ function endBar(s: Hosted, last: LogItem | undefined): m.Vnode | null {
</span>
<span class="hint">
{s.awaits
- ? 'It goes on once you have done what it says above.'
+ ? 'It goes on once you have done what it says below.'
: s.wake
- ? 'midas wakes it then; reply above to go on sooner.'
- : `Reply above to go on${s.finish || c?.stage === 'landed' ? '' : ', or Mark done in About when it is finished'}.`}
+ ? 'midas wakes it then; reply below to go on sooner.'
+ : `Reply below to go on${s.finish || c?.stage === 'landed' ? '' : ', or Mark done in About when it is finished'}.`}
</span>
</div>
)
@@ -939,14 +934,14 @@ function fileAsk(it: LogItem): string | null {
/** What the person is writing to the open session; kept while they look elsewhere. */
const draft = local({text: ''})
-/** Stay at the top, where the newest comes in, unless the person scrolled down to read back. */
+/** Follow the conversation down as it grows, unless the person scrolled up to read. */
let pinned = true
-/** The Shell's content column scrolls, not the log: that is what stays at the newest. */
-const followNewest = {
+/** The Shell's content column scrolls, not the log: that is what follows the conversation down. */
+const followDown = {
oncreate: (v: m.VnodeDOM) => {
- // Opened, it is at its newest at once.
- stick(v.dom as HTMLElement)
+ // Opened, it is at its end at once: only what arrives after glides.
+ stick(v.dom as HTMLElement, true)
// A picture or a film grows the log after it is drawn: follow that too.
const watch = new ResizeObserver(() => stick(v.dom as HTMLElement))
watch.observe(v.dom)
@@ -965,60 +960,74 @@ const followNewest = {
},
}
-/** Scrolled down to read back while more arrived: a chip says so, and brings the person up to it. */
+/** Scrolled up to read while more arrived: a chip says so, and brings the person down to it. */
function showNew(dom: HTMLElement, on: boolean) {
dom.parentElement?.querySelector('.jump-new')?.classList.toggle('is-shown', on)
}
-/** Back up to the newest. */
+/** To the end of the conversation, gliding. */
function toLatest(e: Event) {
- const el = (e.currentTarget as HTMLElement).closest<HTMLElement>('.m-shell__content')
+ const el = (e.currentTarget as HTMLElement).closest('.m-shell__content')
pinned = true
- if (el) el.style.overflowAnchor = 'none'
- el?.scrollTo({top: 0, behavior: reduced() ? 'auto' : 'smooth'})
+ el?.scrollTo({top: el.scrollHeight, behavior: 'smooth'})
showNew(e.currentTarget as HTMLElement, false)
}
-/** A block that grew by itself (Typed pacing a reply in), with no redraw of the page: kept at the top as `stick` would. */
-function following(dom: HTMLElement) {
- const el = dom.closest<HTMLElement>('.m-shell__content')
- if (el && pinned) el.scrollTop = 0
-}
+/** The conversation gliding down to its end: the frame it waits on, and where it last put the scroll. */
+const glide = {frame: 0, at: 0}
/**
- * The newest comes in at the top. At the top, the page stays there and what came pushes
- * the past down. Scrolled down to read back, the browser's scroll anchoring holds the
- * block being read in place while blocks arrive above it, and a chip counts that they
- * did. Anchoring is off while at the top: it would hold the block that was first there
- * and scroll the newest out of view above it.
+ * Down to the end of the conversation, a share of the way each frame. Set in one go, the
+ * page jumped by a whole message as it came; chasing the end, a reply that streams in
+ * chunk by chunk keeps sliding up as one movement.
*/
-function stick(dom: HTMLElement) {
+function glideDown(el: HTMLElement) {
+ if (glide.frame) return
+ const step = () => {
+ const gap = el.scrollHeight - el.clientHeight - el.scrollTop
+ if (!pinned || gap < 1) {
+ glide.frame = 0
+ return
+ }
+ el.scrollTop += Math.max(1, gap * 0.18)
+ glide.at = el.scrollTop
+ glide.frame = requestAnimationFrame(step)
+ }
+ glide.frame = requestAnimationFrame(step)
+}
+
+/** A block that grew by itself (Typed pacing a reply in), with no redraw of the page: followed down as `stick` would. */
+function following(dom: HTMLElement) {
+ const el = dom.closest('.m-shell__content') as HTMLElement | null
+ if (el && pinned && !reduced()) glideDown(el)
+}
+
+function stick(dom: HTMLElement, at = false) {
const el = (dom.closest('.m-shell__content') as HTMLElement | null) ?? dom
el.onscroll = () => {
- pinned = el.scrollTop < 80
- el.style.overflowAnchor = pinned ? 'none' : ''
+ // The glide's own scrolling, short of the end while it moves: still following.
+ if (glide.frame && el.scrollTop >= glide.at - 1) return
+ pinned = el.scrollHeight - el.scrollTop - el.clientHeight < 80
if (pinned) showNew(dom, false)
}
- el.style.overflowAnchor = pinned ? 'none' : ''
const grew = el.scrollHeight > Number(el.dataset.height ?? 0) + 8
el.dataset.height = String(el.scrollHeight)
if (!pinned && grew) showNew(dom, true)
if (jump && jump.id === live.following && live.logNext >= jump.n) {
- // The latest block at or before the item (an agent's text is many items in one), the
- // innermost on a tie: the calls in a run keep their own order inside it.
- const n = (b: HTMLElement) => Number(b.dataset.n)
- const at = [...dom.querySelectorAll<HTMLElement>('[data-n]')].filter((b) => n(b) <= jump!.n).reduce<HTMLElement | undefined>((a, b) => (!a || n(b) >= n(a) ? b : a), undefined)
+ // The last block at or before the item: an agent's text is many items in one.
+ const at = [...dom.querySelectorAll<HTMLElement>('[data-n]')].filter((b) => Number(b.dataset.n) <= jump!.n).pop()
jump = null
if (at) {
pinned = false
- el.style.overflowAnchor = ''
at.scrollIntoView({block: 'center'})
at.classList.add('msg--found')
setTimeout(() => at.classList.remove('msg--found'), 2400)
return
}
}
- if (pinned) el.scrollTop = 0
+ if (!pinned) return
+ if (at || reduced()) el.scrollTop = el.scrollHeight
+ else glideDown(el)
}
/** The session the address names (`/sessions/s3`), if there is one. */
@@ -1502,7 +1511,7 @@ const otherBoxes = (q: LogItem) => Object.keys(q.schema?.properties ?? {}).filte
/** A typed message as a question's answer: its "Other", for each question it asks. */
const typedAnswer = (q: LogItem, text: string) => Object.fromEntries(otherBoxes(q).map((k) => [k, text]))
-/** The message box over the conversation: in the Shell's footer, which a session's page moves under the header (app.css `.midas--session`), so it stays while the conversation scrolls. Folded on a phone, it carries the header's buttons (`tools`). */
+/** The message box under the conversation: in the Shell's footer, so it stays while the conversation scrolls. Folded on a phone, it carries the header's buttons (`tools`). */
export function sessionFooter(tools: (m.Vnode | null)[] = []): m.Children {
const s = openSession()
// No session open: a new one's composer; one asked for but not known (yet): nothing.
@@ -1613,7 +1622,7 @@ export function sessionFooter(tools: (m.Vnode | null)[] = []): m.Children {
!steers()
? 'steering takes the steer role'
: asked
- ? `pick an answer below, or type your own${keys('Mod+Enter answers')}`
+ ? `pick an answer above, or type your own${keys('Mod+Enter answers')}`
: s.autopilot?.on && !busy
? `say something: your word goes before the autopilot's${keys('Mod+Enter sends')}`
: busy
@@ -2798,15 +2807,15 @@ class SessionView extends MithrilComponent<{s: Hosted}> {
follow(s.id)
return (
<div class="session">
+ <div class="session__log" {...followDown}>
+ {live.following === s.id ? render(followedLog(), s) : null}
+ </div>
<button type="button" class="jump-new" onclick={toLatest}>
<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
- <path d="M12 19V5M6 11l6-6 6 6" />
+ <path d="M12 5v14M6 13l6 6 6-6" />
</svg>
- New above
+ New below
</button>
- <div class="session__log" {...followNewest}>
- {live.following === s.id ? render(followedLog(), s) : null}
- </div>
{sessionSheet(s)}
</div>
)