mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-03 22:12:01 +09:00
fix(console): auto nav spells every page's full name, wrapping instead of shortening (#5074)
Below ~90 columns the auto nav style fell back to three-letter codes (Msn, Ovr, Wfl) and below ~70 to bare icons, so the nav was hard to read at the widths a dock usually has. auto now always uses the full form; a group row that does not fit wraps, shared evenly over its lines. brief and icons remain selectable in Settings. Console 0.50.3. Co-authored-by: r <r@x>
This commit is contained in:
1 parent
cff5bce451
commit
fcdb85c26a
6 files changed
+46
-15
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ruflo-console",
|
||||
"description": "ruflo's cockpit inside Claude Code and the one /ruflo command for every ruflo mod (function hooks, early access). Views: overview with health alerts, swarm topology graph, claims flow with TTL rings, federation map, plugin health matrix, learning curve and pipeline, MetaHarness radar and audit trend, memory, cost gauge, agent timeline, approvals queue, event stream, a main menu, an x.ruv.io federation board, an AI terminal (codex, claude or both in remembered sessions, streamed), Skills (npx skills), a Hive-Mind view, a MetaHarness lab, agent drill-down; a command palette for confirm-gated actions through the ruflo CLI; a band above the prompt. Reads ruflo's files and the CLI's local JSON; anything not measured reads n/a. The one network call it makes by itself is a daily read of the published plugin.json at github.com/ruvnet/ruflo to offer an update (Settings \u2192 Updates: ask, auto, or off); it installs only through Claude Code's own claude plugin update, and never a new major version without asking.",
|
||||
"version": "0.50.2",
|
||||
"version": "0.50.3",
|
||||
"repository": "https://github.com/ruvnet/ruflo",
|
||||
"author": {
|
||||
"name": "ruvnet",
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
Newest first. One `## <version> — <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-console`.
|
||||
|
||||
## 0.50.3 — 2026-11-22
|
||||
- fix: the nav's `auto` style always spells every page's whole name (Missions, MetaHarness, Learning Lab). Before, it fell back to three-letter codes (Msn, Ovr, Wfl) below about 90 columns and to bare icons below about 70, which left the nav unreadable at the widths a dock usually has. A row that does not fit now wraps instead, shared out evenly over its lines so one page is not left alone on the last. The `brief` and `icons` styles are unchanged and still chosen in Settings.
|
||||
|
||||
## 0.50.2 — 2026-11-17
|
||||
- fix: the POSIX append script (`dd … >> "$1"`) now passes `conv=notrunc`. uutils dd, the default coreutils on Ubuntu 26.04, truncates its stdout to its own offset after writing (`lseek` then `ftruncate`), so concurrent appenders lost whole batches; with the flag, eight writers keep all 2400 lines. Linux still runs the GNU argv; this script is the macOS/BSD path, and `conv=notrunc` is POSIX dd (#4978)
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
* The console's version, shown on the header so a person can tell which build is running. Kept equal to the plugin's manifest
|
||||
* (`.claude-plugin/plugin.json`); tests/version.spec.ts fails if the two drift.
|
||||
*/
|
||||
export const CONSOLE_VERSION = '0.50.2'
|
||||
export const CONSOLE_VERSION = '0.50.3'
|
||||
@@ -46,22 +46,31 @@ export function groupedTabs(ctx: Ctx, hasHotkey: (view: View) => boolean): Rende
|
||||
const cells = (view: View, form: string) => (view.id === open ? openName(view).length + 1 : (hasHotkey(view) && view.key !== '' ? 3 : 0) + spell(view, form).length + badgeText(view).length + 3)
|
||||
// A row's width: its pages, plus the gap and bar between each two (2 columns).
|
||||
const widest = (form: string) => Math.max(0, ...pages.map(ids => ids.reduce((sum, id) => sum + (find(id) === undefined ? 0 : cells(find(id) as View, form)), 0) + 2 * Math.max(0, ids.length - 1)))
|
||||
// auto: the richest form whose widest row fits the page; the others are the person's choice (Settings).
|
||||
const form = state.nav === 'auto' ? (['full', 'brief'].find(candidate => widest(candidate) <= inner) ?? 'icons') : state.nav
|
||||
// auto: every page spells its whole name, at any width. Shortening to fit one line (the three-letter brief codes, or icons alone) left
|
||||
// the nav unreadable at the widths a dock usually has; a row that does not fit wraps instead. brief and icons stay the person's choice (Settings).
|
||||
const form = state.nav === 'auto' ? 'full' : state.nav
|
||||
|
||||
// A row of pages too wide even in the narrowest form wraps onto further rows, greedily, rather than running off the edge.
|
||||
// A row of pages too wide for the card wraps onto further rows, greedily, rather than running off the edge. Each of the group's own rows
|
||||
// wraps by itself, so its pages keep the grouping NAV_GROUPS gives them (SWARM's second row still starts at Hive-Mind).
|
||||
const width = (ids: readonly ViewId[]) => ids.reduce((sum, each) => sum + (find(each) === undefined ? 0 : cells(find(each) as View, form)), 0) + 2 * Math.max(0, ids.length - 1)
|
||||
const laid: ViewId[][] =
|
||||
widest(form) <= inner
|
||||
? pages
|
||||
: pages.flat().reduce<ViewId[][]>((rows, id) => {
|
||||
const last = rows.at(-1)
|
||||
const width = (ids: readonly ViewId[]) => ids.reduce((sum, each) => sum + (find(each) === undefined ? 0 : cells(find(each) as View, form)), 0) + 2 * Math.max(0, ids.length - 1)
|
||||
: pages.flatMap(ids => {
|
||||
const greedy = ids.reduce<ViewId[][]>((rows, id) => {
|
||||
const last = rows.at(-1)
|
||||
|
||||
if (last !== undefined && width([...last, id]) <= inner) last.push(id)
|
||||
else rows.push([id])
|
||||
if (last !== undefined && width([...last, id]) <= inner) last.push(id)
|
||||
else rows.push([id])
|
||||
|
||||
return rows
|
||||
}, [])
|
||||
return rows
|
||||
}, [])
|
||||
// The same number of lines, shared out evenly where it fits, so a wrap does not leave one page alone on the last line.
|
||||
const per = Math.ceil(ids.length / greedy.length)
|
||||
const even = Array.from({ length: Math.ceil(ids.length / per) }, (_, i) => ids.slice(i * per, (i + 1) * per))
|
||||
|
||||
return even.length === greedy.length && even.every(line => width(line) <= inner) ? even : greedy
|
||||
})
|
||||
|
||||
const tab = (view: View): RenderElement => {
|
||||
const words = spell(view, form)
|
||||
|
||||
@@ -11,9 +11,9 @@ step() { printf "→ %s ... " "$1"; }
|
||||
ok() { printf "PASS\n"; PASS=$((PASS+1)); }
|
||||
bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
|
||||
|
||||
step "1. plugin.json declares ruflo-console 0.50.2"
|
||||
step "1. plugin.json declares ruflo-console 0.50.3"
|
||||
grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \
|
||||
&& grep -q '"version": "0.50.2"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
|
||||
&& grep -q '"version": "0.50.3"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"
|
||||
|
||||
step "2. hooks.json names exactly one module and no classic hook commands"
|
||||
grep -q '"modules": \["./register.ts"\]' "$HOOKS/hooks.json" && ! grep -q '"command"' "$HOOKS/hooks.json" \
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
|
||||
import { COST_CHIP, NAV_ACCENT } from '../hooks/menu-colors'
|
||||
import { newState, type State, type ViewId } from '../hooks/state'
|
||||
import { newState, VIEWS, type State, type ViewId } from '../hooks/state'
|
||||
import { CARD_COLUMNS } from '../hooks/views/card'
|
||||
import { setLook, tagChip, THEME, type Actions, type Ctx } from '../hooks/views/common'
|
||||
import { menuView } from '../hooks/views/menu'
|
||||
@@ -129,6 +129,25 @@ describe('the nav card', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('the auto nav names every page in full', () => {
|
||||
it('spells each page\'s whole name at every width the nav draws, wrapping instead of shortening to codes or icons', () => {
|
||||
for (const view of ['learning', 'secure', 'swarm', 'settings', 'federation'] as const) for (let columns = 44; columns <= 200; columns++) {
|
||||
const state = newState({})
|
||||
|
||||
state.view = view
|
||||
const card = groupedTabs(ctxOf(state, columns), () => true) as unknown as El
|
||||
const shown = flat(card).filter(node => String(node.props.key).startsWith('tabs-row-')).flatMap(row => flat(row)).filter(node => node.kind === 'Button')
|
||||
|
||||
expect(shown.length, `${view} at ${columns}`).toBeGreaterThan(0)
|
||||
for (const node of shown) {
|
||||
const page = VIEWS.find(entry => `tab-${entry.id}` === node.props.key)
|
||||
|
||||
expect(String(node.props.label), `${view} at ${columns}`).toContain(page?.label ?? '?')
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe('a chip cannot vanish', () => {
|
||||
it('is drawn inverse, never in a fixed colour on an explicit background, so it stays there if the host does not draw that background', () => {
|
||||
setLook('bbs')
|
||||
|
||||
Reference in new issue
Block a user