Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(ruflo-console): boot border; icon row (menu, palette, help, settings, refresh); menu-pick fix; nav and menu reorganised (ADR-430, ADR-432)

ruvf98d982f06b4
diff --git a/plugins/ruflo-console/hooks/controller.ts b/plugins/ruflo-console/hooks/controller.ts
index 9c5f93c697..7cd644025f 100644
--- a/plugins/ruflo-console/hooks/controller.ts
+++ b/plugins/ruflo-console/hooks/controller.ts
@@ -414,6 +414,8 @@ export function createController(state: State, host: Host): Controller {
if (view !== state.view) {
if (view === 'agent' || state.view !== 'agent') state.back = state.view === 'agent' ? state.back : state.view
state.view = view
+ // A group picked on one page (the menu's pages row) does not follow you to the next, or back to this one.
+ state.navPick = null
state.pane.viewAtMs = Date.now()
state.select.item = 0
state.mounted.clear()
diff --git a/plugins/ruflo-console/hooks/gfx/boot.ts b/plugins/ruflo-console/hooks/gfx/boot.ts
index bde27b74d4..6c966ba511 100644
--- a/plugins/ruflo-console/hooks/gfx/boot.ts
+++ b/plugins/ruflo-console/hooks/gfx/boot.ts
@@ -12,8 +12,11 @@ import { drawCyber } from './boot-cyber'
import { neonPicture, NEON_ROWS } from './neon'
import { Grid } from './raster'
-const SIGN_TOP = 0
-export const BOOT_ROWS = SIGN_TOP + NEON_ROWS + 3
+/** The sign sits one row down, inside a border of its own: a row above it and a row below. */
+const SIGN_TOP = 1
+export const BOOT_ROWS = SIGN_TOP + NEON_ROWS + 4
+/** The border strikes up over this long once the sign switches on. */
+const FRAME_MS = 900
const GREEN = 0x39ff14
const CYAN = 0x05d9e8
@@ -56,6 +59,41 @@ export const BOOT_MODULES: readonly { name: string; note: string }[] = [
]
const NAME_WIDTH = 15
+/** The blue behind the white leading cell, and how many cells of it, while the border strikes: white, then blue, then pink. */
+const BLUE = 0x3a7bff
+const FRAME_BLUE = 10
+
+/**
+ * A neon border round the whole animation area, the brick wall included: a double line along the edge of the picture, a row above the sign and
+ * a row below it. Dim before the sign switches on; then a run of light goes round it clockwise from the top left, a white leading cell, a
+ * stretch of blue behind it, then pink; when the run has gone all the way round the whole border is that one pink. Left out only when the pane
+ * is too narrow to draw a box at all.
+ */
+export function drawFrame(grid: Grid, columns: number, age: number): void {
+ const x0 = 0
+ const x1 = columns - 1
+ const y0 = 0
+ const y1 = SIGN_TOP + NEON_ROWS
+
+ if (columns < 8) return
+
+ const cells: { x: number; y: number; ch: string }[] = []
+
+ for (let x = x0; x <= x1; x++) cells.push({ x, y: y0, ch: x === x0 ? 'β•”' : x === x1 ? 'β•—' : '═' })
+ for (let y = y0 + 1; y < y1; y++) cells.push({ x: x1, y, ch: 'β•‘' })
+ for (let x = x1; x >= x0; x--) cells.push({ x, y: y1, ch: x === x0 ? 'β•š' : x === x1 ? '╝' : '═' })
+ for (let y = y1 - 1; y > y0; y--) cells.push({ x: x0, y, ch: 'β•‘' })
+
+ const progress = Math.max(0, Math.min(1, (age - SIGN_ON_MS) / FRAME_MS))
+ const lit = Math.floor(progress * cells.length)
+
+ cells.forEach((cell, i) => {
+ const color = progress >= 1 ? PINK : i >= lit ? DIM : i === lit - 1 ? 0xffffff : lit - i <= FRAME_BLUE ? BLUE : PINK
+
+ grid.set(cell.x, cell.y, cell.ch, color)
+ })
+}
+
/**
* `age` is ms since the pane opened; the bar mixes elapsed time with the reads that have answered (`done` of
* `total`), so it moves before any read returns and reads 100% before the boot ends at BOOT_MIN_MS. `rows` is the
@@ -74,6 +112,7 @@ export function bootPicture(project: string, columns: number, age: number, done:
const sign = neonPicture(columns, age - SIGN_ON_MS, true)
grid.cells.set(sign.cells, SIGN_TOP * columns * 3)
+ drawFrame(grid, columns, age)
type(BOOT_ROWS - 2, 1300, `> handshake ok Β· node ${project}`, CYAN, 14)
diff --git a/plugins/ruflo-console/hooks/nav-state.ts b/plugins/ruflo-console/hooks/nav-state.ts
index 7439c62d19..c8076938b4 100644
--- a/plugins/ruflo-console/hooks/nav-state.ts
+++ b/plugins/ruflo-console/hooks/nav-state.ts
@@ -60,7 +60,10 @@ export type NavActions = {
export function navActions(state: State, invalidate: () => void, open: (view: ViewId) => void): NavActions {
return {
group: title => {
- state.navPick = { group: title, view: state.view }
+ // On the main menu, picking the group that is already picked closes its row of pages again.
+ const isPicked = state.view === 'menu' && state.navPick !== null && state.navPick.view === 'menu' && state.navPick.group === title
+
+ state.navPick = isPicked ? null : { group: title, view: state.view }
state.navQuery = ''
invalidate()
},
diff --git a/plugins/ruflo-console/hooks/views/nav.ts b/plugins/ruflo-console/hooks/views/nav.ts
index 841fd69853..df11a583ef 100644
--- a/plugins/ruflo-console/hooks/views/nav.ts
+++ b/plugins/ruflo-console/hooks/views/nav.ts
@@ -80,6 +80,8 @@ export function groupedTabs(ctx: Ctx, hasHotkey: (view: View) => boolean): Rende
? ctx.kit.Box({ key: `nav-group-${group.title}`, children: [ctx.kit.Text({ ...(isBbs() ? chip(NAV_ACCENT[group.title] ?? THEME.head) : { bold: true, color: THEME.head }), children: `[${icons ? `${group.icon} ` : ''}${group.title} β–Ύ]` })] })
: ctx.kit.Button({ key: `nav-group-${group.title}`, label: ` ${icons ? `${group.icon} ` : ''}${group.title} `, plain: true, dimColor: true, onPress: () => ctx.act.navigator.group(group.title) }),
)
+ // On the main menu a picked group's pages are open: a βœ• beside the chips closes them again.
+ const closePick = open === 'menu' && !isMenuIdle ? [ctx.kit.Button({ key: 'nav-pick-close', label: ' βœ• ', plain: true, dimColor: true, onPress: () => ctx.act.navigator.group(shown) })] : []
const Input = ctx.kit.Input
const search = Input === undefined ? [] : [Input({ key: 'nav-find', label: 'πŸ”Ž', placeholder: 'find a page', submitLabel: 'go', onSubmit: (value: string) => ctx.act.navigator.find(value) })]
const clear = query === '' ? [] : [ctx.kit.Button({ key: 'nav-find-clear', label: ' βœ• ', plain: true, dimColor: true, onPress: () => ctx.act.navigator.clear() })]
@@ -87,7 +89,7 @@ export function groupedTabs(ctx: Ctx, hasHotkey: (view: View) => boolean): Rende
flexDirection: 'row',
gap: 1,
key: 'tabs-groups',
- children: [menu === undefined ? ctx.kit.Text({ children: '' }) : open === 'menu' ? tab(menu) : ctx.kit.Button({ key: 'tab-menu', label: ' πŸ“Ÿ MAIN ', plain: true, hotkey: '0', onPress: () => ctx.act.view('menu') }), ...chips, ...(isSearchInline ? [...search, ...clear] : [])],
+ children: [menu === undefined ? ctx.kit.Text({ children: '' }) : open === 'menu' ? tab(menu) : ctx.kit.Button({ key: 'tab-menu', label: ' πŸ“Ÿ MAIN ', plain: true, hotkey: '0', onPress: () => ctx.act.view('menu') }), ...chips, ...closePick, ...(isSearchInline ? [...search, ...clear] : [])],
})
const findRow = isSearchInline ? [] : [ctx.kit.Box({ flexDirection: 'row', gap: 1, key: 'tabs-find', children: [...search, ...clear] })]
const lines =
diff --git a/plugins/ruflo-console/hooks/views/pane.ts b/plugins/ruflo-console/hooks/views/pane.ts
index 6ea878da64..0e46a69dce 100644
--- a/plugins/ruflo-console/hooks/views/pane.ts
+++ b/plugins/ruflo-console/hooks/views/pane.ts
@@ -291,6 +291,59 @@ const RESULT_OF: Partial<Record<ViewId, (ctx: Ctx) => RenderElement[]>> = {
learning: neuralResult,
}
+/** How many cells of space follow the last icon, so the row does not touch the host's βœ• at the edge. */
+const ICON_MARGIN = 2
+
+/**
+ * The icons' glyphs: one cell each, and none an emoji or with an emoji form. A glyph that is also an emoji (βš™, β„Ή) can be drawn two cells wide when a terminal
+ * switches to its emoji font for it, as it can when the glyph is bold, which is how the page you are on is drawn: the row then jumps when that page is
+ * selected. A plain ? is also visibly larger than the small symbols beside it. So: βŒ‚ the main menu, ⌘ the palette, Κ” help (a small question-mark shape: a plain ? is too large, β“˜ was not obvious), β›­ settings (a gear with no emoji form),
+ * ⟳ refresh last (it draws a little larger than ↻, as asked). A bare glyph is not always obvious (help most of all), so from WORDS_FROM columns each icon also says its word.
+ */
+const ICON_GLYPHS = { menu: 'βŒ‚', palette: '⌘', refresh: '⟳', help: 'Κ”', settings: 'β›­' } as const
+
+/** The pane width from which each icon spells its word beside its glyph. */
+export const ICON_WORDS_FROM = 110
+
+/** The icons on one line, at the right of the first row, beside the host's βœ•: the main menu, the palette, refresh, help and settings. The one for the page you are on is lit: coloured text, the same width as a button. */
+export function iconRow(ctx: Ctx): RenderElement {
+ const { state } = ctx
+ const withWords = ctx.columns >= ICON_WORDS_FROM
+ // A plain Button draws exactly its label, so the page you are on is coloured text of exactly the same width: nothing moves when it changes.
+ const icon = (key: string, glyph: string, word: string, isCurrent: boolean, press: () => void): RenderElement => {
+ const label = withWords ? `${glyph} ${word} ` : `${glyph} `
+
+ return isCurrent
+ ? ctx.kit.Box({ key, children: [ctx.kit.Text({ bold: true, color: THEME.head, children: label })] })
+ : ctx.kit.Button({ key, label, plain: true, dimColor: true, onPress: press })
+ }
+
+ return ctx.kit.Box({
+ flexDirection: 'row',
+ key: 'pane-icons',
+ children: [
+ icon('pane-icon-menu', ICON_GLYPHS.menu, 'menu', state.view === 'menu' && !state.isHelp && !state.palette.isOpen, () => ctx.act.view('menu')),
+ icon('pane-icon-palette', ICON_GLYPHS.palette, 'palette', state.palette.isOpen, () => ctx.act.palette('all')),
+ icon('pane-icon-help', ICON_GLYPHS.help, 'help', state.isHelp, ctx.act.help),
+ icon('pane-icon-settings', ICON_GLYPHS.settings, 'settings', state.view === 'settings' && !state.isHelp && !state.palette.isOpen, () => ctx.act.view('settings')),
+ // Last, beside the close mark: refresh re-reads everything and replays the intro, as the footer's Refresh and the r key do; it is an action, never the page you are on.
+ icon('pane-icon-refresh', ICON_GLYPHS.refresh, 'refresh', false, ctx.act.restart),
+ ctx.kit.Text({ children: ' '.repeat(ICON_MARGIN) }),
+ ],
+ })
+}
+
+/** Puts the icon row at the right of the first line of the pane, beside the header art and its purpose line; with no header, on a row of its own. */
+function withIcons(ctx: Ctx, parts: RenderElement[], lead: number): RenderElement[] {
+ if (ctx.columns < 40) return parts
+
+ if (lead === 0) {
+ return [ctx.kit.Box({ flexDirection: 'row', key: 'pane-top', children: [ctx.kit.Box({ flexGrow: 1, key: 'pane-top-gap', children: [ctx.kit.Text({ children: ' ' })] }), iconRow(ctx)] }), ...parts]
+ }
+
+ return [ctx.kit.Box({ flexDirection: 'row', key: 'pane-top', children: [ctx.kit.Box({ flexDirection: 'column', flexGrow: 1, key: 'pane-lead', children: parts.slice(0, lead) }), iconRow(ctx)] }), ...parts.slice(lead)]
+}
+
export function paneView(base: Ctx): RenderElement {
setLook(base.state.options.look)
@@ -365,7 +418,14 @@ export function paneView(base: Ctx): RenderElement {
[...bbs.art, ...(about !== null ? [about] : []), ...(cardsOn ? [] : [...gap, ...bbs.strip, ...gap]), tabs(ctx), ...(cardsOn ? [] : gap), footer(ctx, attention.placed), ...(confirm !== null && !isTerminal && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : [])]
: [...title, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...bbs.strip, ...(isMenu && isBbs() ? [text(ctx, ' ')] : []), ...gap, tabs(ctx), ...gap, ...(isMenu && isBbs() ? [] : [...bbs.art, ...(about !== null ? [about] : [])]), ...gap, ...(isMenu ? [] : [footer(ctx, attention.placed)]), ...(confirm !== null && !isTerminal && !confirmInline(ctx.state.view, ctx.state.pending?.scope) ? [confirm] : []), body, ...(confirm !== null && isTerminal ? [confirm] : []), ...gap, ...(isMenu ? [footer(ctx, attention.placed)] : [])]
- return ctx.kit.Box({ flexDirection: 'column', children: parts })
+ // The leading rows that sit beside the icons: the header art (one picture) and the line that says what the page is for; on the menu, the banner and the blank row under it.
+ const lead = isCompact
+ ? (ctx.state.view === 'menu' && title.length > 0 ? title.length : bbs.art.length) + (about !== null ? 1 : 0)
+ : !isMenu && isBbs()
+ ? bbs.art.length + (about !== null ? 1 : 0)
+ : title.length + (isMenu && isBbs() ? 1 : 0)
+
+ return ctx.kit.Box({ flexDirection: 'column', children: withIcons(ctx, parts, lead) })
}
type Plain = { type: string; props: { children?: unknown; label?: string } }
diff --git a/plugins/ruflo-console/tests/boot-cyber.spec.ts b/plugins/ruflo-console/tests/boot-cyber.spec.ts
index 4b445645d8..c05b0ea228 100644
--- a/plugins/ruflo-console/tests/boot-cyber.spec.ts
+++ b/plugins/ruflo-console/tests/boot-cyber.spec.ts
@@ -7,6 +7,7 @@ import { describe, expect, it } from 'vitest'
import { bootFacts } from '../hooks/boot-facts'
import { bootPicture, BOOT_MODULES, BOOT_ROWS } from '../hooks/gfx/boot'
+import { NEON_ROWS } from '../hooks/gfx/neon'
import { eggText, scramble, EGG_FROM_MS } from '../hooks/gfx/boot-cyber'
import { newState, type State } from '../hooks/state'
@@ -146,3 +147,65 @@ describe('the constellation animation', () => {
expect(dots(1500 + 1000 + 100)).toBeLessThan(dots(1500 + 1000 + 1000))
})
})
+
+describe('the border round the boot animation', () => {
+ const at = (grid: ReturnType<typeof bootPicture>, x: number, y: number): string => String.fromCodePoint(grid.glyph(x, y))
+ const frame = (age: number, columns = 90) => bootPicture('p', columns, age, 10, 10, BOOT_ROWS + 20, allOk, undefined)
+ const row = (grid: ReturnType<typeof bootPicture>, y: number): string => Array.from({ length: grid.columns }, (_, x) => at(grid, x, y)).join('')
+
+ it('encloses the whole area, wall included: corners at the edges of the picture, a row above and a row below the sign', () => {
+ for (const columns of [90, 60, 44]) {
+ const grid = frame(4_000, columns)
+
+ expect(at(grid, 0, 0), `${columns} columns`).toBe('β•”')
+ expect(at(grid, columns - 1, 0)).toBe('β•—')
+ expect(at(grid, 0, NEON_ROWS + 1)).toBe('β•š')
+ expect(at(grid, columns - 1, NEON_ROWS + 1)).toBe('╝')
+ expect(row(grid, 0)).toMatch(/^╔═+β•—$/)
+ expect(row(grid, 3)[0]).toBe('β•‘')
+ expect(row(grid, 3).at(-1)).toBe('β•‘')
+ }
+ })
+
+ const colours = (age: number): Set<number> => {
+ const grid = frame(age)
+ const found = new Set<number>()
+
+ for (let i = 0; i < grid.columns * (NEON_ROWS + 2); i++) if ('β•”β•β•—β•‘β•šβ•'.includes(String.fromCodePoint(grid.cells[i * 3] as number))) found.add(grid.cells[i * 3 + 1] as number)
+
+ return found
+ }
+
+ it('is dim before the sign switches on', () => {
+ expect([...colours(100)]).toEqual([0x6b7280])
+ })
+
+ it('is one single colour (pink) once the animation is complete, and stays so', () => {
+ expect([...colours(4_000)]).toEqual([0xff2a6d])
+ expect([...colours(9_000)]).toEqual([0xff2a6d])
+ })
+
+ it('goes white, then blue, then pink while it strikes, with the dim yet to come', () => {
+ const mid = colours(400 + 450)
+
+ expect(mid.has(0xffffff)).toBe(true)
+ expect(mid.has(0x3a7bff)).toBe(true)
+ expect(mid.has(0xff2a6d)).toBe(true)
+ expect(mid.has(0x6b7280)).toBe(true)
+ })
+
+ it('strikes round the edge over time: more of it is lit later', () => {
+ const lit = (age: number): number => {
+ const grid = frame(age)
+ let n = 0
+
+ for (let i = 0; i < grid.columns * (NEON_ROWS + 2); i++) if ([0xff2a6d, 0x05d9e8, 0xffffff].includes(grid.cells[i * 3 + 1] as number) && 'β•”β•β•—β•‘β•šβ•'.includes(String.fromCodePoint(grid.cells[i * 3] as number))) n++
+
+ return n
+ }
+
+ expect(lit(300)).toBe(0)
+ expect(lit(400 + 450)).toBeGreaterThan(0)
+ expect(lit(400 + 450)).toBeLessThan(lit(4_000))
+ })
+})
diff --git a/plugins/ruflo-console/tests/design.spec.ts b/plugins/ruflo-console/tests/design.spec.ts
index 0ac475a8c1..f1ce089bc5 100644
--- a/plugins/ruflo-console/tests/design.spec.ts
+++ b/plugins/ruflo-console/tests/design.spec.ts
@@ -170,6 +170,14 @@ describe('the nav card on the main menu', () => {
expect(flat(picked[0]).some(node => node.props.key === 'tab-learning')).toBe(true)
})
+ it('offers a βœ• beside the chips once a group is picked, which closes its pages again, and none while idle', () => {
+ expect(flat(draw(false)).some(node => node.props.key === 'nav-pick-close')).toBe(false)
+
+ const close = flat(draw(true)).find(node => node.props.key === 'nav-pick-close')
+
+ expect(close).toBeDefined()
+ })
+
it('keeps every page reachable by its key from the menu: they are hidden buttons, not gone', () => {
const keys = flat(draw(false)).filter(node => String(node.props.key).startsWith('tab-') && node.props.hotkey !== undefined).map(node => String(node.props.key))
diff --git a/plugins/ruflo-console/tests/pane-icons.spec.ts b/plugins/ruflo-console/tests/pane-icons.spec.ts
new file mode 100644
index 0000000000..4ddde69fc8
--- /dev/null
+++ b/plugins/ruflo-console/tests/pane-icons.spec.ts
@@ -0,0 +1,155 @@
+/**
+ * The three icons in one row on the first line, beside the host's close mark: the main menu, help and settings. They sit beside the page's header rows in every
+ * layout, each does its one thing, the one for the page you are on is lit (coloured text, the width of a button), and a pane too narrow for them has none. Run with
+ * npx vitest run plugins/ruflo-console/tests/pane-icons.spec.ts
+ */
+import { afterEach, describe, expect, it } from 'vitest'
+
+import { Grid } from '../hooks/gfx/raster'
+import { newState, type ViewId } from '../hooks/state'
+import { setLook, type Ctx } from '../hooks/views/common'
+import { paneView } from '../hooks/views/pane'
+
+type El = { props: Record<string, unknown>; kind: string }
+
+const calls: string[] = []
+const recorder = (path: string): unknown =>
+ new Proxy(() => undefined, {
+ get: (_t, key) => (key === 'then' ? undefined : recorder(`${path}.${String(key)}`)),
+ apply: (_t, _this, args) => void calls.push(`${path.slice(1)}(${args.join(',')})`),
+ })
+const make = (kind: string) => (props: Record<string, unknown>): El => ({ kind, props })
+const kit = { Box: make('Box'), Text: make('Text'), Button: make('Button'), Input: make('Input'), Raster: make('Raster') }
+const flat = (el: unknown): El[] => {
+ const node = el as El
+
+ if (typeof node !== 'object' || node === null) return []
+
+ const kids = node.props.children
+
+ return [node, ...(Array.isArray(kids) ? kids.flatMap(flat) : typeof kids === 'object' ? flat(kids) : [])]
+}
+
+function draw(view: ViewId, columns: number, rows: number, mutate: (state: ReturnType<typeof newState>) => void = () => undefined): El {
+ const state = newState({})
+
+ state.options.look = 'bbs'
+ state.options.boot = false
+ state.view = view
+ state.pane.placement = 'inline'
+ state.pane.rows = rows
+ state.pane.columns = columns
+ state.snapshot = null
+ mutate(state)
+ setLook('bbs')
+
+ const pictures = new Map([['title', new Grid(40, 2)], ['header', new Grid(60, 2)]])
+
+ return paneView({ kit, state, nowMs: Date.now(), columns, pictures, act: recorder('') as never, cards: false } as unknown as Ctx) as unknown as El
+}
+
+const key = (tree: El, name: string): El | undefined => flat(tree).find(node => node.props.key === name)
+
+afterEach(() => setLook('plain'))
+
+describe('the icon row', () => {
+ it.each([
+ ['a wide page', 'swarm', 140, 0],
+ ['a short (compact) page', 'swarm', 90, 8],
+ ['the wide main menu', 'menu', 140, 0],
+ ['the compact main menu', 'menu', 70, 8],
+ ] as const)('is five icons in one row at the right of the first line, beside the header rows on %s', (_name, view, columns, rows) => {
+ const tree = draw(view, columns, rows)
+ const column = key(tree, 'pane-icons')
+ const top = key(tree, 'pane-top')
+
+ const parts = column?.props.children as El[]
+
+ expect(column?.props.flexDirection).toBe('row')
+ // Five icons, then two cells after the last so it does not touch the close mark.
+ expect(parts.length).toBe(6)
+ expect(parts.slice(0, 5).map(part => String(part.props.key))).toEqual(['pane-icon-menu', 'pane-icon-palette', 'pane-icon-help', 'pane-icon-settings', 'pane-icon-refresh'])
+ expect(parts[5]?.kind).toBe('Text')
+ expect(String(parts[5]?.props.children).length).toBe(2)
+ // The header's rows are in the same row as the column, to its left.
+ expect(flat((top?.props.children as unknown[])[0]).some(node => node.kind === 'Raster')).toBe(true)
+ expect((top?.props.children as unknown[])[1]).toBe(column)
+ })
+
+ const NAMES = ['pane-icon-menu', 'pane-icon-palette', 'pane-icon-help', 'pane-icon-settings', 'pane-icon-refresh'] as const
+ const WORDS = { 'pane-icon-menu': 'menu', 'pane-icon-palette': 'palette', 'pane-icon-refresh': 'refresh', 'pane-icon-help': 'help', 'pane-icon-settings': 'settings' } as const
+
+ it('keeps the horizontal padding modest: a glyph and one cell after it on a pane too narrow for words', () => {
+ const tree = draw('swarm', 90, 0)
+
+ for (const name of NAMES) expect(String(key(tree, name)?.props.label).length, name).toBe(2)
+ })
+
+ it('says its word beside each glyph from 110 columns, so help is obvious, and not below', () => {
+ const wide = draw('swarm', 140, 0)
+ const edge = draw('swarm', 110, 0)
+ const narrow = draw('swarm', 109, 0)
+
+ for (const name of NAMES) {
+ expect(String(key(wide, name)?.props.label), name).toMatch(new RegExp(`^. ${WORDS[name]} $`))
+ expect(String(key(edge, name)?.props.label), name).toMatch(new RegExp(`^. ${WORDS[name]} $`))
+ expect(String(key(narrow, name)?.props.label).length, name).toBe(2)
+ }
+ })
+
+ it('draws every glyph one cell wide, so the help icon is not the odd one out in size', () => {
+ const tree = draw('swarm', 140, 0)
+
+ for (const name of ['pane-icon-menu', 'pane-icon-palette', 'pane-icon-help', 'pane-icon-settings', 'pane-icon-refresh']) {
+ const glyph = [...String(key(tree, name)?.props.label)][0] as string
+
+ expect([...glyph].length, name).toBe(1)
+ expect(glyph, name).not.toBe('?')
+ // None may be an emoji, or have an emoji form: a terminal can draw those two cells wide, and the lit icon (bold) would then jump.
+ expect(glyph, name).not.toMatch(/\p{Extended_Pictographic}|\p{Emoji_Presentation}/u)
+ }
+ })
+
+ it('each icon does its one thing', () => {
+ calls.length = 0
+
+ const tree = draw('swarm', 140, 0)
+
+ for (const name of NAMES) (key(tree, name)?.props.onPress as () => void)()
+
+ expect(calls).toEqual(['view(menu)', 'palette(all)', 'help()', 'view(settings)', 'restart()'])
+ })
+
+ it.each([140, 90])('lights the icon of the page you are on in colour, in exactly the width of a button, at %i columns, so nothing jumps', columns => {
+ const onMenu = draw('menu', columns, 0)
+ const onSettings = draw('settings', columns, 0)
+ const onHelp = draw('swarm', columns, 0, state => (state.isHelp = true))
+ const onPalette = draw('swarm', columns, 0, state => (state.palette.isOpen = true))
+ // What an icon draws, in cells: a plain Button draws its label, the lit icon its text.
+ const cells = (el: El | undefined): number => (el?.kind === 'Button' ? String(el.props.label).length : String(flat(el)[1]?.props.children).length)
+ const lit = (tree: El, name: string): El | undefined => flat(key(tree, name)).find(node => node.kind === 'Text')
+
+ expect(lit(onMenu, 'pane-icon-menu')?.props).toMatchObject({ bold: true, color: expect.stringMatching(/^#|^[a-z]/) })
+ expect(key(onMenu, 'pane-icon-help')?.kind).toBe('Button')
+ expect(lit(onSettings, 'pane-icon-settings')).toBeDefined()
+ expect(lit(onHelp, 'pane-icon-help')).toBeDefined()
+ expect(lit(onPalette, 'pane-icon-palette')).toBeDefined()
+ // Refresh is an action, never the page you are on.
+ expect(key(onMenu, 'pane-icon-refresh')?.kind).toBe('Button')
+
+ const reference = Object.fromEntries(NAMES.map(name => [name, cells(key(draw('swarm', columns, 0), name))]))
+
+ for (const tree of [onMenu, onSettings, onHelp, onPalette]) for (const name of NAMES) expect(cells(key(tree, name)), name).toBe(reference[name])
+ })
+
+ it('puts refresh last, beside the close mark, and as a larger glyph than the others', () => {
+ const parts = key(draw('swarm', 140, 0), 'pane-icons')?.props.children as El[]
+
+ expect(String(parts[4]?.props.key)).toBe('pane-icon-refresh')
+ expect(String(parts[4]?.props.label)).toMatch(/^⟳ refresh $/)
+ })
+
+ it('is left out of a pane too narrow for it', () => {
+ expect(key(draw('swarm', 36, 0), 'pane-icons')).toBeUndefined()
+ })
+})
diff --git a/plugins/ruflo-console/tests/scroll-top.spec.ts b/plugins/ruflo-console/tests/scroll-top.spec.ts
index 2d3341414a..d069199922 100644
--- a/plugins/ruflo-console/tests/scroll-top.spec.ts
+++ b/plugins/ruflo-console/tests/scroll-top.spec.ts
@@ -72,3 +72,46 @@ describe('scroll to the top', () => {
expect(scrolls.count).toBe(1)
})
})
+
+describe('a group picked on the menu', () => {
+ it('does not stay picked after you leave the menu: it is idle again when you come back', () => {
+ const state = newState({})
+ const { host } = fakeHost()
+ const control = createController(state, host)
+
+ state.view = 'menu'
+ control.actions.navigator.group('SWARM')
+ expect(state.navPick).toEqual({ group: 'SWARM', view: 'menu' })
+
+ control.setView('swarm')
+ expect(state.navPick).toBeNull()
+
+ control.setView('menu')
+ expect(state.navPick).toBeNull()
+ })
+
+ it('picking the picked group again closes its row, and another group opens its own', () => {
+ const state = newState({})
+ const { host } = fakeHost()
+ const control = createController(state, host)
+
+ state.view = 'menu'
+ control.actions.navigator.group('SWARM')
+ control.actions.navigator.group('MIND')
+ expect(state.navPick?.group).toBe('MIND')
+
+ control.actions.navigator.group('MIND')
+ expect(state.navPick).toBeNull()
+ })
+
+ it('does not toggle off on another page, where the shown group is the page\'s own', () => {
+ const state = newState({})
+ const { host } = fakeHost()
+ const control = createController(state, host)
+
+ state.view = 'swarm'
+ control.actions.navigator.group('MIND')
+ control.actions.navigator.group('MIND')
+ expect(state.navPick?.group).toBe('MIND')
+ })
+})
diff --git a/v3/docs/adr/ADR-430-console-menu-design.md b/v3/docs/adr/ADR-430-console-menu-design.md
index 5cb64618df..2b8a2675e0 100644
--- a/v3/docs/adr/ADR-430-console-menu-design.md
+++ b/v3/docs/adr/ADR-430-console-menu-design.md
@@ -15,3 +15,13 @@
- **Balanced sections.** SWARM held nine pages over two rows while SAFETY and TOOLS held two each. Every page still exists, now spread: SWARM (Missions, Overview, Swarm, Hive-Mind, Claims, Approvals) Β· MIND (Learning, Neural, MetaHarness, Self-Evolution, Memory, Vector) Β· SAFETY (Security & Doctor, Cost, Performance, Timeline, Events) Β· NETWORK (Federation, x.ruv.io, Plugins, Skills, Plugin Catalog) Β· TOOLS (Terminal, Automation, Dev Tools, Settings). The menu's cards use the same assignment (a spec requires each page's menu colour to equal its nav colour). No group is more than one row, and a row too wide for its pane wraps onto the next instead of running through the card's border (the open page is counted at its full spelled name).
- **No repeated page row on the main menu.** The nav card at the top of the main menu is the groups and the search; the cards below already list every page. Picking a group chip shows that group's pages. Every page's key still works from the menu (the pages are hidden buttons).
- **The logo banner leads the menu in a small pane too** (it had been replaced by the big-letter page title in the compact layout), and its title keeps `AGENT SWARM CONSOLE` whole, dropping the version before it would cut the title.
+
+## Amendment (2026 10 03, later still): a picked group on the menu no longer sticks
+
+On the main menu the nav card shows only the groups until one is picked, and a pick was never cleared, so once a group chip was clicked its row of pages came back every time the menu was shown. Now: leaving a page resets the pick (the menu is idle each time you return); picking the picked group again closes its row, and a βœ• beside the chips does the same. On other pages a pick behaves as before (the shown group is the page's own). Specs: the pick is gone after leaving and returning; the second pick closes it and another group opens its own; no toggle off on another page; the βœ• is there only while a group is picked.
+
+## Amendment (2026 10 03, last): icons beside the host's close mark
+
+The βœ• in a pane's top right is Claude Code's own close mark: a mod cannot add to it (`$.ui.open` takes an id, title, focus, rows and columns; the `Pane` component's props are read-only). So the console draws a row of five small icons on the first line of its own body, at the right beside the βœ•, with two cells of space after the last so it does not touch the close mark, next to the page's header art and purpose line: **βŒ‚** the main menu, **⌘** the palette, **Κ”** help (the guide for the page; a small question-mark shape, since a plain `?` draws too large and β“˜ was not obvious), **β›­** settings, and **⟳** refresh last, beside the βœ• (the footer's Refresh: re-reads everything and replays the intro; a slightly larger glyph than ↻). From 110 columns each icon also spells its word (`βŒ‚ menu`, `Κ” help` …), since a bare glyph is not obvious, help least of all; narrower, a glyph and a cell.
+
+None of the glyphs is an emoji or has an emoji form (`?` drew visibly larger than the small symbols; `βš™` and `β„Ή` are also emoji, which a terminal can draw two cells wide, notably in the bold lit state, making the row jump). The icon for the page you are on (the menu, the palette or help while open, settings) is lit: bold coloured text of exactly the width of a button (a plain Button draws exactly its label and ignores the primary style), so nothing moves when the page changes; refresh is an action and is never lit. The row is left out of a pane under 40 columns. Specs: the one-line row with its trailing space beside the header rows in four layouts; the words from 110 columns and none below; every icon does its one thing; the lit icon is the width of the button at 140 and 90 columns; no emoji glyph; refresh last; removing the wrapper or a glyph rule fails them.
diff --git a/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md b/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md
index f1973769d0..bf07dd56e4 100644
--- a/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md
+++ b/v3/docs/adr/ADR-432-console-cyberpunk-boot-uplink-and-restart.md
@@ -34,3 +34,7 @@ Lines draw outward over 350 ms once both their stars are up; a lit star flashes
## 5. Amendment: no modem dial-up
The first two boot rows (`ATDT ruflo.local RING… RING…` and `CONNECT 115200 / ARQ / V.42bis`) are gone, along with the "CONNECT" in the no-picture fallback. The sign starts to strike at 400 ms instead of 900, since there is no line to wait for, and the boot log gains the two rows. A spec checks that no frame of the boot shows them.
+
+## 6. Amendment: a border round the whole animation area
+
+The boot's neon sign sits inside a double-line border (`╔═╗ β•‘ β•šβ•β•`) that encloses the whole animation area, the brick wall included: it runs along the edge of the picture, with a row above the sign and a row below it (the sign moves down one row; the boot's fixed rows are two more than before). It is dim until the sign switches on, then a run of light goes round it clockwise from the top left: a white leading cell, ten cells of blue behind it, then pink. Once the run has gone all the way round, the whole border is one pink and stays so. Specs: the four corners at the picture's edges at 90, 60 and 44 columns; dim before the sign; white, blue and pink mid-strike; exactly one colour (pink) when complete and later; removing the call or the single-colour rule fails them.