mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 06:36:49 +09:00
feat(ruflo-console): remove the modem dial-up lines from the boot (ADR-432)
Co-Authored-By: RuFlo <ruv@ruv.net>
This commit is contained in:
1 parent
2ed937ac16
commit
808ed0b3af
4 files changed
+20
-17
No files matched your search
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* The BBS boot screen, played for the first seconds after the pane opens: a modem dials and connects, then the RuFlo
|
||||
* neon sign strikes up tube by tube on its brick wall (gfx/neon.ts), then a handshake line and a bar that fills with
|
||||
* The BBS boot screen, played for the first seconds after the pane opens: the RuFlo neon sign strikes up tube by tube on its
|
||||
* brick wall (gfx/neon.ts), then a handshake line and a bar that fills with
|
||||
* the first ruflo reads, and under them a boot log that brings every area of the console online, one line at a time,
|
||||
* for as many rows as the pane has (it scrolls when the pane is short). The sign and the modem are decoration and end by
|
||||
* themselves; the log is not, when the self-check's results are passed: an area shows [ OK ] only if its check passed, and
|
||||
* for as many rows as the pane has (it scrolls when the pane is short). The sign is decoration and ends by
|
||||
* itself; the log is not, when the self-check's results are passed: an area shows [ OK ] only if its check passed, and
|
||||
* [FAIL] with the first problem if not, so what the screen claims is what was verified.
|
||||
*/
|
||||
import type { BootCheck } from '../boot-checks'
|
||||
@@ -12,15 +12,15 @@ import { drawCyber } from './boot-cyber'
|
||||
import { neonPicture, NEON_ROWS } from './neon'
|
||||
import { Grid } from './raster'
|
||||
|
||||
const SIGN_TOP = 2
|
||||
const SIGN_TOP = 0
|
||||
export const BOOT_ROWS = SIGN_TOP + NEON_ROWS + 3
|
||||
|
||||
const GREEN = 0x39ff14
|
||||
const CYAN = 0x05d9e8
|
||||
const PINK = 0xff2a6d
|
||||
const DIM = 0x6b7280
|
||||
/** The sign is switched on once the line connects. */
|
||||
const SIGN_ON_MS = 900
|
||||
/** The sign begins to strike almost at once: there is nothing to dial first. */
|
||||
const SIGN_ON_MS = 400
|
||||
/** The boot log starts once the handshake is typed, and brings one area online every LOG_MS_PER. */
|
||||
const LOG_FROM_MS = 1500
|
||||
const LOG_MS_PER = 120
|
||||
@@ -70,9 +70,6 @@ export function bootPicture(project: string, columns: number, age: number, done:
|
||||
grid.text(0, y, text.slice(0, Math.min(text.length, Math.floor((age - from) / msPerChar), columns)), color)
|
||||
}
|
||||
|
||||
type(0, 0, `ATDT ruflo.local${age >= 450 ? ' RING… RING…' : ''}`, DIM, 18)
|
||||
type(1, 600, 'CONNECT 115200 / ARQ / V.42bis', GREEN, 12)
|
||||
|
||||
// The sign's wall shows from the start, unlit; the tubes strike from SIGN_ON_MS.
|
||||
const sign = neonPicture(columns, age - SIGN_ON_MS, true)
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ export function paneView(base: Ctx): RenderElement {
|
||||
|
||||
return boot !== undefined && ctx.kit.Raster !== undefined
|
||||
? col(ctx, [ctx.kit.Raster(boot.toRaster('boot'))], 'boot')
|
||||
: col(ctx, [text(ctx, 'CONNECT 115200 · RUFLO AGENT SWARM CONSOLE · loading…', { bold: true, color: THEME.head })], 'boot')
|
||||
: col(ctx, [text(ctx, 'RUFLO AGENT SWARM CONSOLE · loading…', { bold: true, color: THEME.head })], 'boot')
|
||||
}
|
||||
// A section of a page is a bordered card (views/card.ts): the body is drawn narrower by the border and padding, through a kit that groups its rows.
|
||||
const cardsOn = hasCards(base.columns, isCompactPane(base.state))
|
||||
|
||||
@@ -149,18 +149,20 @@ describe('BBS look', () => {
|
||||
describe('BBS boot screen', () => {
|
||||
const text = (grid: ReturnType<typeof bootPicture>, width: number) => Array.from({ length: grid.rows }, (_, y) => String.fromCodePoint(...Array.from({ length: width }, (_, x) => grid.glyph(x, y) || 32))).join('\n')
|
||||
|
||||
it('dials, connects, draws the logo and fills a bar from elapsed time and answered reads', () => {
|
||||
expect(text(bootPicture('demo', 60, 100, 0, 10), 60)).toContain('ATDT')
|
||||
expect(text(bootPicture('demo', 60, 100, 0, 10), 60)).not.toContain('CONNECT')
|
||||
it('draws the logo and fills a bar from elapsed time and answered reads, with no modem dial-up', () => {
|
||||
for (const age of [100, 700, 2_000, 5_400]) {
|
||||
const shown = text(bootPicture('demo', 60, age, 5, 10), 60)
|
||||
|
||||
expect(shown, `${age} ms`).not.toMatch(/ATDT|RING|CONNECT 115200/)
|
||||
}
|
||||
|
||||
const done = text(bootPicture('demo', 60, 5_400, 10, 10), 60)
|
||||
|
||||
expect(done).toContain('CONNECT 115200 / ARQ / V.42bis')
|
||||
expect(done).toContain('│ ~~~~~ │')
|
||||
expect(done).toContain('▐▌')
|
||||
// The tubes are dark before the line connects, lit once it has: the same cell, two colours.
|
||||
// The tubes are dark before the sign switches on, lit once it has: the same cell, two colours.
|
||||
const fgAt = (age: number) => { const g = bootPicture('demo', 60, age, 3, 10); for (let i = 0; i < g.columns * g.rows; i++) if (g.cells[i * 3] === 0x256d) return g.cells[i * 3 + 1]; return -1 }
|
||||
expect(fgAt(500)).not.toBe(fgAt(3_800))
|
||||
expect(fgAt(300)).not.toBe(fgAt(3_800))
|
||||
expect(done).toContain('> handshake ok · node demo')
|
||||
expect(done).toContain('100% reads 10/10')
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user