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

fix(ruflo-console): the boot screen animates on an unfocused pane, and its bar fills before it ends

ruv09c9cc4a4ac7
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.json
index 34aadf80ca..c0c59d8baa 100644
--- a/plugins/ruflo-console/.claude-plugin/plugin.json
+++ b/plugins/ruflo-console/.claude-plugin/plugin.json
@@ -89,7 +89,7 @@
"boot": {
"type": "boolean",
"title": "Boot screen",
- "description": "With the bbs look, play a short dial-up boot screen (modem connect, the RUFLO logo drawing in, a loading bar for the first ruflo reads) when the cockpit opens. At least 2.6 s, at most 6 s.",
+ "description": "With the bbs look, play a short dial-up boot screen (modem connect, the RUFLO logo drawing in, a loading bar for the first ruflo reads) when the cockpit opens. At least 3.2 s, at most 6 s.",
"default": true
}
}
diff --git a/plugins/ruflo-console/hooks/controller.ts b/plugins/ruflo-console/hooks/controller.ts
index 9a099919bf..c60989a3b6 100644
--- a/plugins/ruflo-console/hooks/controller.ts
+++ b/plugins/ruflo-console/hooks/controller.ts
@@ -13,7 +13,7 @@ import { markPicture } from './gfx/pictures'
import type { Host } from './host'
import { agentLogs } from './ops'
import { createRunner, type Runner } from './runner'
-import { CLI_PREFIXES, PANE_ID, push, rowsOf, storeKeyOf, type State } from './state'
+import { CLI_PREFIXES, isBooting, PANE_ID, push, rowsOf, storeKeyOf, type State } from './state'
import type { Actions } from './views/common'
import { picturesOf } from './views/frames'
@@ -242,8 +242,23 @@ export function createController(state: State, host: Host): Controller {
}
/** One frame of every picture of the view in front, each blitted only at the size it was mounted. */
+ // Whether the last frame drew the boot screen: when it ends the whole pane redraws once, and an unfocused pane's
+ // loop stops again (the boot screen animates whether or not the pane holds the keys).
+ let wasBooting = false
+
function frame(): void {
const started = Date.now()
+ const booting = isBooting(state, started)
+
+ if (wasBooting && !booting) {
+ wasBooting = false
+ host.invalidate()
+ animate()
+
+ return
+ }
+
+ wasBooting = booting
for (const [key, grid] of picturesOf(state, state.pane.columns, Date.now(), Date.now())) {
const mounted = state.mounted.get(key)
@@ -256,9 +271,9 @@ export function createController(state: State, host: Host): Controller {
push(state.stats.frames, Date.now() - started, 200)
}
- /** Runs the frame loop while the pane is shown and holds the keys, at `fps`; stops it otherwise. */
+ /** Runs the frame loop while the pane is shown and holds the keys (or plays the boot screen), at `fps`; stops it otherwise. */
function animate(): void {
- if (!(state.options.fps > 0 && isVisible() && state.pane.isFocused && state.mounted.size > 0)) {
+ if (!(state.options.fps > 0 && isVisible() && (state.pane.isFocused || isBooting(state, Date.now())) && state.mounted.size > 0)) {
cancel('frames')
return
diff --git a/plugins/ruflo-console/hooks/gfx/pictures.ts b/plugins/ruflo-console/hooks/gfx/pictures.ts
index 890456aef4..7a7e98f87e 100644
--- a/plugins/ruflo-console/hooks/gfx/pictures.ts
+++ b/plugins/ruflo-console/hooks/gfx/pictures.ts
@@ -311,8 +311,9 @@ export function bootPicture(project: string, columns: number, age: number, done:
type(7, 1900, `> handshake ok Β· node ${project}`, NEON_CYAN, 14)
// LOADING [β–“β–“β–“β–“β–‘β–‘β–‘β–‘] 58% reads 6/10, with a blinking cursor while it runs.
- if (age >= 2000) {
- const pct = Math.min(1, 0.55 * Math.min(1, (age - 2000) / 1400) + 0.45 * (total > 0 ? done / total : 1))
+ if (age >= 1900) {
+ // Full by ~2.9 s once the reads have answered, so 100% shows before the boot ends at BOOT_MIN_MS (3.2 s).
+ const pct = Math.min(1, 0.55 * Math.min(1, (age - 1900) / 1000) + 0.45 * (total > 0 ? done / total : 1))
const barWidth = Math.max(6, Math.min(24, columns - 30))
const filled = Math.round(pct * barWidth)
const line = `LOADING [${'β–“'.repeat(filled)}${'β–‘'.repeat(barWidth - filled)}] ${String(Math.round(pct * 100)).padStart(3)}% reads ${done}/${total}`
diff --git a/plugins/ruflo-console/hooks/state.ts b/plugins/ruflo-console/hooks/state.ts
index 4ded6d200b..56ecb3f51e 100644
--- a/plugins/ruflo-console/hooks/state.ts
+++ b/plugins/ruflo-console/hooks/state.ts
@@ -235,7 +235,7 @@ export function restore(state: State, value: unknown): void {
}
/** The BBS boot screen's span: at least BOOT_MIN_MS, longer while the first read is still out, never past BOOT_MAX_MS. */
-export const BOOT_MIN_MS = 2_600
+export const BOOT_MIN_MS = 3_200
export const BOOT_MAX_MS = 6_000
export function isBooting(state: State, nowMs: number): boolean {
diff --git a/plugins/ruflo-console/tests/diagrams.spec.ts b/plugins/ruflo-console/tests/diagrams.spec.ts
index 7cb6d4f494..7ad93d31ea 100644
--- a/plugins/ruflo-console/tests/diagrams.spec.ts
+++ b/plugins/ruflo-console/tests/diagrams.spec.ts
@@ -160,14 +160,14 @@ describe('BBS boot screen', () => {
expect(done).toContain('100% reads 10/10')
})
- it('plays at least 2.6 s, longer while the first read is out, never past 6 s; only with the bbs look and boot on', () => {
+ it('plays at least 3.2 s, longer while the first read is out, never past 6 s; only with the bbs look and boot on', () => {
const state = newState({})
state.pane.bootAtMs = 1_000
expect(isBooting(state, 1_100)).toBe(true)
- expect(isBooting(state, 4_000)).toBe(true) // no snapshot yet
+ expect(isBooting(state, 5_000)).toBe(true) // past the 3.2 s minimum, but no snapshot yet
state.snapshot = {} as never
- expect(isBooting(state, 4_000)).toBe(false)
+ expect(isBooting(state, 5_000)).toBe(false)
expect(isBooting(state, 2_000)).toBe(true)
state.snapshot = null
expect(isBooting(state, 7_500)).toBe(false)