Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Show the start window once its page is on screen, and let the data stage be seen

AdamPlatin123cb7b8d8472f5
diff --git a/app/src/start-window.mjs b/app/src/start-window.mjs
index c92abce9..fec64184 100644
--- a/app/src/start-window.mjs
+++ b/app/src/start-window.mjs
@@ -36,7 +36,12 @@ export const SAVED_LINES = 5000
// own background and caption symbols, which show before the page paints and where Mica is not.
const COLORS = { light: { main: '#fcfcfc', ink: '#141414' }, dark: { main: '#141414', ink: '#f2f2f2' } }
const CAPTION_HEIGHT = 40
-const PAINT_WAIT_MS = 3000
+export const PAINT_WAIT_MS = 3000
+// A window that Windows has just shown is drawn a few frames before its page is (and its own
+// opening transition runs over them): the start window shows see-through and turns opaque
+// this long after.
+export const OPEN_MS = 200
+const sinceLaunch = () => String(Math.round(process.uptime() * 1000))
// What the page may ask, and in which views (null: in any). The cards of later pull requests
// send other names, which are refused.
@@ -60,6 +65,8 @@ const ACT_VIEWS = {
manualDownload: ['failed'],
copyDetails: null,
saveLog: null,
+ // The page has drawn its first frame: the window shows.
+ painted: null,
}
export const START_ACTS = Object.freeze(Object.keys(ACT_VIEWS))
@@ -246,6 +253,8 @@ export function startSnapshot(state, now) {
clock: { ms: Math.round(clockMs(state.clock, now)), at: now, running: state.clock.running, rate: 1 },
explain: { ...state.explain },
celebrate: state.celebrate,
+ // The window is on screen: the page's entrance starts (start.js).
+ shown: state.shown === true,
}
if (state.hint !== undefined) snapshot.hint = { ...state.hint }
if (state.place !== undefined) snapshot.place = { ...state.place }
@@ -341,7 +350,7 @@ export class StartWindow {
const win = new BrowserWindow({
...rect,
useContentSize: true, resizable: false, maximizable: false, fullscreenable: false, minimizable: true,
- show: true, title: 'DeepSeek Bot', icon: this.#o.icon,
+ show: false, title: 'DeepSeek Bot', icon: this.#o.icon,
backgroundColor: mica ? '#00000000' : colors.main,
// Frameless with the system minimize and close buttons over the page's empty 40 px band.
...(win32 ? {
@@ -363,10 +372,10 @@ export class StartWindow {
this.#window = win
this.#url = startUrl(this.#o.page, start)
const contents = win.webContents
- // The window shows at once; its page paints a little later (onboarding §3: within about 1 s).
- const sinceLaunch = () => String(Math.round(process.uptime() * 1000))
- note(`${start} start window shown ${sinceLaunch()} ms after launch`)
+ // The window shows once its page says it has drawn its first frame (the 'painted' act), so it
+ // never opens on an empty panel: the page's whale and ring come about 1 s after the window.
win.once('ready-to-show', () => { note(`the start page painted ${sinceLaunch()} ms after launch`) })
+ this.#later('show', PAINT_WAIT_MS, () => { this.#showStart('the page did not say it painted', { now: true }) })
this.#painted = new Promise((resolve) => {
win.once('ready-to-show', resolve)
contents.once('did-finish-load', resolve)
@@ -404,13 +413,40 @@ export class StartWindow {
void win.loadURL(this.#url).catch((error) => { note(`the start page did not load: ${error instanceof Error ? error.message : String(error)}`) })
}
- /** The window that dialogs belong to, while it is the one showing. */
- owner() { return this.#open() && !this.#revealed ? this.#window : undefined }
+ /** The window that dialogs belong to, while it is the one showing; a dialog never opens over nothing. */
+ owner() {
+ if (!this.#open() || this.#revealed) return undefined
+ this.#showStart('a dialog', { now: true })
+ return this.#window
+ }
+
+ // Shown see-through, then opaque after OPEN_MS; `now` (a dialog, a page that never painted)
+ // does not wait. The page starts the whale's entrance once the snapshot says `shown`.
+ #showStart(why, { now = false } = {}) {
+ this.#clear('show')
+ const win = this.#window
+ if (!this.#open()) return
+ if (!win.isVisible()) {
+ if (!now) win.setOpacity(0)
+ win.show()
+ note(`${this.#state.start} start window shown (${why}) ${sinceLaunch()} ms after launch`)
+ if (!now) { this.#later('opaque', OPEN_MS, () => { this.#opaque() }); return }
+ }
+ if (now) this.#opaque()
+ }
+
+ #opaque() {
+ this.#clear('opaque')
+ if (!this.#open() || this.#state.shown) return
+ this.#window.setOpacity(1)
+ this.#update({ shown: true })
+ }
/** Brings the start window back while it is the one showing. */
focus() {
- const win = this.owner()
- if (win === undefined) return false
+ if (!this.#open() || this.#revealed) return false
+ this.#showStart('focus', { now: true })
+ const win = this.#window
if (win.isMinimized()) win.restore()
win.show()
win.focus()
@@ -672,7 +708,7 @@ export class StartWindow {
this.#state = {
lang: this.#o.lang(), start, motion: this.#o.motion, frame: process.platform === 'win32' ? 'band' : 'system',
view: start === 'moving' ? 'moving' : 'boot',
- done: [], explain: this.#explain, celebrate: start === 'first',
+ done: [], explain: this.#explain, celebrate: start === 'first', shown: false,
clock: { base: 0, from: now, running: true },
hint: undefined, place: undefined, card: undefined, failure: undefined, update: undefined,
}
@@ -724,6 +760,7 @@ export class StartWindow {
else if (name === 'reloadView') this.#reload()
else if (name === 'copyDetails') this.#copyDetails()
else if (name === 'saveLog') void this.#saveLog()
+ else if (name === 'painted') this.#showStart('painted')
else if (name === 'pick') this.#o.onPick?.(valueOf(payload))
else if (name === 'answer') this.#o.onAnswer?.(valueOf(payload))
else if (name === 'installUpdate' || name === 'manualDownload') this.#o.onUpdate?.(name)
diff --git a/app/src/start/start.css b/app/src/start/start.css
index d1f091fd..929aea41 100644
--- a/app/src/start/start.css
+++ b/app/src/start/start.css
@@ -258,6 +258,8 @@ html[data-start=moving] .footrow{display:none}
@media (max-height:520px){.stage{top:-8px}html[data-frame=system] .stage{top:-32px}.sheet{height:calc(100% - 296px)}}
/* entrance, keyed on data-start (no JS timing); the ring draws itself in as the whale surfaces */
+/* held at its first frame until the window is on screen (start.js data-held) */
+html[data-held] *{animation-play-state:paused!important}
@keyframes bt-veil{from{opacity:0;filter:blur(6px)}}
@keyframes bt-enter-first{from{transform:translateY(96px) rotate(-12deg)}}
@keyframes bt-enter-later{from{transform:translateY(84px)}}
diff --git a/app/src/start/start.js b/app/src/start/start.js
index 7a7b3e78..04189d12 100644
--- a/app/src/start/start.js
+++ b/app/src/start/start.js
@@ -10,12 +10,28 @@ const root = document.documentElement
const asked = new URLSearchParams(location.search).get('start')
const START = ['first', 'later', 'moving'].includes(asked) ? asked : 'first'
const resume = performance.getEntriesByType('navigation')[0]?.type === 'reload'
+// The main process shows the window by itself after PAINT_WAIT_MS (3 s) and OPEN_MS.
+const HELD_MAX_MS = 3500
const bridge = window.dsBotStart
if (resume) root.dataset.resume = ''
// The page shows nothing but the empty band (html:not([data-start])) without the preload's bridge.
if (bridge) root.dataset.start = START
const first = START === 'first'
root.dataset.sheet = 'none'
+// The window shows see-through once this page has painted and turns opaque a moment later
+// (start-window.mjs OPEN_MS); the snapshot then says `shown`. Until then the whale's entrance
+// waits: its CSS animations hold their first frame (start.css html[data-held]) and the
+// director's clock has not started.
+let onScreen = () => {}
+const begin = bridge && !resume ? new Promise((resolve) => { onScreen = resolve }) : Promise.resolve()
+if (bridge && !resume) {
+ root.dataset.held = ''
+ setTimeout(release, HELD_MAX_MS)
+}
+function release() {
+ delete root.dataset.held
+ onScreen()
+}
const $ = selector => document.querySelector(selector)
const sheet = $('.sheet'), edge = $('.sheet-edge'), fill = $('.sheet-fill'), stage = $('.stage'), pond = $('.pond'), live = $('.live')
@@ -438,7 +454,7 @@ matchMedia('(prefers-reduced-motion: reduce)').addEventListener('change', () =>
new MutationObserver(() => director.refresh()).observe(root, { attributes: true, attributeFilter: ['data-motion'] })
// ---- snapshots ----
-const director = createDirector({ start: START, resume, act: (name, detail) => bridge?.act(name, detail), label: say, announce })
+const director = createDirector({ start: START, resume, begin, act: (name, detail) => bridge?.act(name, detail), label: say, announce })
let applied = false
function apply(next) {
const jump = !applied && resume
@@ -457,6 +473,9 @@ function apply(next) {
else { fillBlock(name); resize() }
timeUI()
director.update(next)
+ if (next.shown) release()
+ // The window shows once this first state is on screen (start-window.mjs 'painted').
+ if (!applied) requestAnimationFrame(() => requestAnimationFrame(() => { bridge?.act('painted') }))
applied = true
}
renderStatic()
diff --git a/app/src/start/whale.js b/app/src/start/whale.js
index 573392e2..b13fd1cd 100644
--- a/app/src/start/whale.js
+++ b/app/src/start/whale.js
@@ -27,9 +27,6 @@ const PHASES = ['data', 'engine', 'team']
// An active station and a state loop each hold at least 400 ms; the margin covers the frame
// on which the change is painted.
const HOLD = 420
-// The first arc fills this long after the whale has surfaced, so that it is seen to fill: the
-// data stage is usually done before the page has painted.
-const FIRST_ARC_MS = 260
// The whale is 112 px on every kind of start (start.css --u). Starting over in a new folder, it
// sinks this far: under the waterline.
const u = 1.12
@@ -94,7 +91,7 @@ function to(el, props, opts) {
const kf = (frames, easing) => frames.map(frame => ({ easing, ...frame }))
export const clamped = easing => easing.replace(/\d+\.\d+/gu, value => String(Math.min(1, Number(value))))
-export function createDirector({ start, resume, act, label, announce, onCheck, onActive }) {
+export function createDirector({ start, resume, act, label, announce, onCheck, onActive, begin = Promise.resolve() }) {
const $ = selector => document.querySelector(selector)
const x = $('.whale-x'), gazeLayer = $('.whale-gaze'), body = $('.whale'), move = $('.whale-move'), loop = $('.whale-loop')
const tail = $('#tail'), pair = $('#eye-pair'), lane = $('.lane'), ripple = $('.ripple'), hit = $('.whale-hit')
@@ -102,7 +99,8 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
const stations = [...document.querySelectorAll('.station')]
const arcs = [...document.querySelectorAll('.arc')]
const first = start === 'first'
- const t0 = performance.now()
+ // The entrance's clock starts once the window is on screen (`begin`, start.js).
+ let t0 = performance.now()
const entranceMs = resume ? 0 : first ? 560 : 290
const D = { at: 0, checks: 0, pose: 'enter', loop: '', card: '', slow: 0, bx: 0, by: 0, since: [t0], activeAt: [], loopAt: 0, hop: null, pet: null, handed: false, workReady: first, missed: false, sinking: false,
// Rest on a card: its clock, the lean, the breath, the lively hops; the last glance and press.
@@ -132,11 +130,12 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
const tier = tierNow
const playful = () => tier() !== 'quiet' && !reduced()
const failure = () => want.view === 'failed' || want.view === 'viewFailed' || want.card === 'importFailed'
- const entered = sleep(entranceMs).then(() => { root.dataset.entered = '' })
+ const begun = begin.then(() => { t0 = performance.now(); D.since[0] = t0 })
+ const entered = begun.then(() => sleep(entranceMs)).then(() => { root.dataset.entered = '' })
// Finished entrance veils are dropped, so later fades of the same blocks stay composited.
- sleep(resume ? 0 : 700).then(() => { root.dataset.settled = '' })
+ begun.then(() => sleep(resume ? 0 : 700)).then(() => { root.dataset.settled = '' })
if (resume) instant = true
- if (!first) setTimeout(() => { D.workReady = true; if (D.started) kick() }, resume ? 0 : 1000)
+ if (!first) begun.then(() => { setTimeout(() => { D.workReady = true; if (D.started) kick() }, resume ? 0 : 1000) })
// ---- stages: the ring's arcs and the hidden list ----
// Each arc carries its stage's state: pending (faint), active (tinted, a light running along
@@ -167,12 +166,15 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
const delay = Math.max(0, (D.since[i] ?? now) + 250 - now, t0 + entranceMs - now)
activeTimer = setTimeout(() => {
if (D.at !== i || stations[i].dataset.state !== 'pending' || failure() || (i < 2 && want.done.includes(PHASES[i]))) return
- setStation(i, 'active')
- D.activeAt[i] = performance.now()
- announce(label('status.sr.active', { phase: label(`status.phase.${PHASES[i]}`) }))
- onActive?.(i)
+ showActive(i)
}, instant ? 0 : delay)
}
+ function showActive(i) {
+ setStation(i, 'active')
+ D.activeAt[i] = performance.now()
+ announce(label('status.sr.active', { phase: label(`status.phase.${PHASES[i]}`) }))
+ onActive?.(i)
+ }
// ---- loops ----
const capture = () => ({ loop: cs(loop).transform, tail: cs(tail).transform, pair: cs(pair).transform, eyes: eyes.map(eye => cs(eye).transform) })
@@ -526,10 +528,14 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
while (D.at < want.station && want.view !== 'handoff') {
const i = D.at
if (!ran) {
- // The first arc waits for the whale to surface (FIRST_ARC_MS). No loop starts for that
- // short wait: a loop's own hold would delay the arc by another 400 ms.
- const seen = i === 0 && !resume && ['boot', 'moving'].includes(want.view) ? t0 + entranceMs + FIRST_ARC_MS : 0
- await hold(Math.max(D.activeAt[i] ? D.activeAt[i] + HOLD : 0, D.loopAt ? D.loopAt + HOLD : 0, seen))
+ // The data stage is usually done before the page has painted: its arc still turns
+ // active once the whale has surfaced and holds there, the folder in view, before it
+ // fills. No loop starts for that short wait: a loop's own hold would add another 400 ms.
+ if (i === 0 && !resume && ['boot', 'moving'].includes(want.view) && stations[0].dataset.state === 'pending') {
+ clearTimeout(activeTimer)
+ showActive(0)
+ }
+ await hold(Math.max(D.activeAt[i] ? D.activeAt[i] + HOLD : 0, D.loopAt ? D.loopAt + HOLD : 0))
if (want.view === 'handoff') break
}
await leg(i, ran > 0)
diff --git a/app/test/helpers/fake-electron.mjs b/app/test/helpers/fake-electron.mjs
index d41772bf..7c4f4a97 100644
--- a/app/test/helpers/fake-electron.mjs
+++ b/app/test/helpers/fake-electron.mjs
@@ -65,6 +65,7 @@ export class FakeWindow extends EventEmitter {
setFullScreen(value) { this.fullScreen = value; if (!value) this.emit('leave-full-screen') }
show() { this.visible = true; this.shown += 1; this.emit('show') }
hide() { this.visible = false; this.emit('hide') }
+ setOpacity(value) { this.opacity = value }
focus() { this.focused += 1 }
restore() { this.minimized = false; this.visible = true; this.emit('restore') }
minimize() { this.minimized = true }
diff --git a/app/test/start-page.test.mjs b/app/test/start-page.test.mjs
index 75393ad7..4ad06c26 100644
--- a/app/test/start-page.test.mjs
+++ b/app/test/start-page.test.mjs
@@ -62,7 +62,7 @@ test('the page sends only the acts of the start window', () => {
...[...code['start.js'].matchAll(/\bact: '(\w+)'|\bact\('(\w+)'/gu)].map(match => match[1] ?? match[2]),
...[...code['whale.js'].matchAll(/\bact\('(\w+)'\)/gu)].map(match => match[1]),
].filter(name => !local.has(name)))
- assert.deepEqual([...sent].sort(), ['answer', 'copyDetails', 'freshStart', 'handoffDone', 'handoffShow', 'importModel', 'importOption', 'installUpdate', 'keepCopying', 'manualDownload', 'pick', 'reloadView', 'retry', 'saveLog', 'stopCopy', 'wait'])
+ assert.deepEqual([...sent].sort(), ['answer', 'copyDetails', 'freshStart', 'handoffDone', 'handoffShow', 'importModel', 'importOption', 'installUpdate', 'keepCopying', 'manualDownload', 'painted', 'pick', 'reloadView', 'retry', 'saveLog', 'stopCopy', 'wait'])
// Every act the main process takes is one that the page sends, under the same name.
for (const name of START_ACTS) assert.ok(sent.has(name), `the main process takes ${name}, which the page never sends`)
})
@@ -135,6 +135,31 @@ test('an empty or hidden arc leaves no dot: no dash touches its path', () => {
assert.equal(touches(dashes(base), offsetOf(base)), true)
})
+// The data stage is usually done before the page has painted; its arc (and the folder) still turns
+// active once the whale has surfaced and holds for HOLD before it fills.
+test('the first stage is seen active before it fills, even when it was done before the page painted', () => {
+ const whale = code['whale.js']
+ const legs = whale.slice(whale.indexOf('async function runLegs()'), whale.indexOf('function failStation()'))
+ assert.match(legs, /if \(i === 0 && !resume && \['boot', 'moving'\]\.includes\(want\.view\) && stations\[0\]\.dataset\.state === 'pending'\) \{\s*clearTimeout\(activeTimer\)\s*showActive\(0\)/u)
+ assert.match(legs, /await hold\(Math\.max\(D\.activeAt\[i\] \? D\.activeAt\[i\] \+ HOLD : 0/u)
+ assert.match(whale, /const HOLD = 420\b/u)
+ // The reconcile waits for the entrance first, so the arc turns active on a whale that has surfaced.
+ assert.match(whale, /async function step\(\) \{\s*await entered/u)
+})
+
+// The window turns opaque OPEN_MS after it shows (start-window.mjs); the entrance waits for the
+// snapshot's `shown`, so that it is seen from its first frame.
+test('the whale\'s entrance waits until the window is on screen', () => {
+ const page = code['start.js']
+ assert.match(page, /if \(bridge && !resume\) \{\s*root\.dataset\.held = ''/u)
+ assert.match(page, /if \(next\.shown\) release\(\)/u)
+ assert.match(page, /createDirector\(\{ start: START, resume, begin,/u)
+ assert.match(read('start.css'), /html\[data-held\] \*\{animation-play-state:paused!important\}/u)
+ const whale = code['whale.js']
+ assert.match(whale, /const entered = begun\.then\(\(\) => sleep\(entranceMs\)\)/u)
+ assert.match(whale, /begun\.then\(\(\) => sleep\(resume \? 0 : 700\)\)/u)
+})
+
test('the footer is the place line alone, centred with a grey button, on first and later starts', () => {
assert.match(html, /<footer class="footrow"><p class="place" hidden><span class="place-text"><\/span><button class="btn" data-look="small" data-act="pick" data-detail="changePlace" data-t="btn.changePlace"><\/button><\/p><\/footer>/u)
assert.ok(!('foot.community' in TEXT.zh), 'the community note is back')
diff --git a/app/test/start-window.test.mjs b/app/test/start-window.test.mjs
index 083a07d4..0c72959b 100644
--- a/app/test/start-window.test.mjs
+++ b/app/test/start-window.test.mjs
@@ -7,7 +7,7 @@ import { test } from 'node:test'
import { readStartFrame, writeStartFrame } from '../src/start-frame.mjs'
import {
acceptsAct, centred, clampInto, clockMs, cubicBezier, detailsText, explainOf, failureReason, fallbackMs, CROSSFADE, handoffBox, HOLD_MS, TEAM_HANDOFF, TEAM_WAIT_MS,
- isStartPage, landingOf, MAIN_SIZE, mainRect, START_ACT, START_ACTS, START_STATE, startSize, startSnapshot, startUrl, StartWindow,
+ isStartPage, landingOf, MAIN_SIZE, mainRect, OPEN_MS, PAINT_WAIT_MS, START_ACT, START_ACTS, START_STATE, startSize, startSnapshot, startUrl, StartWindow,
TEAM_VIEW_MS, WATCHDOG_MS,
} from '../src/start-window.mjs'
@@ -83,7 +83,7 @@ test('only a missing file of the app\'s own says that the install is incomplete'
})
test('the main process takes only its own acts, each in its own views', () => {
- assert.deepEqual([...START_ACTS].sort(), ['answer', 'copyDetails', 'handoffDone', 'handoffShow', 'importModel', 'importOption', 'installUpdate', 'keepCopying', 'manualDownload', 'pick', 'reloadView', 'retry', 'saveLog', 'stopCopy', 'wait'])
+ assert.deepEqual([...START_ACTS].sort(), ['answer', 'copyDetails', 'handoffDone', 'handoffShow', 'importModel', 'importOption', 'installUpdate', 'keepCopying', 'manualDownload', 'painted', 'pick', 'reloadView', 'retry', 'saveLog', 'stopCopy', 'wait'])
// The import card's model and options and the copying card's stop, on a card only.
for (const name of ['importModel', 'importOption', 'stopCopy', 'keepCopying']) {
assert.equal(acceptsAct(name, 'card'), true, name)
@@ -151,7 +151,7 @@ test('the snapshot carries the phase, the stages done and the clock', () => {
assert.deepEqual(booting, {
v: 1, lang: 'zh', start: 'first', motion: 'normal', frame: 'band', view: 'boot', phase: 'data', done: [],
clock: { ms: 6400, at: now, running: true, rate: 1 },
- explain: { mode: 'new', nextStep: true, previewNotice: true }, celebrate: true,
+ explain: { mode: 'new', nextStep: true, previewNotice: true }, celebrate: true, shown: false,
})
assert.equal(startSnapshot(state({ done: ['data'] }), now).phase, 'engine')
const ready = startSnapshot(state({ view: 'handoff', done: ['team', 'data', 'engine'] }), now)
@@ -258,6 +258,7 @@ function fakeElectron() {
getContentBounds() { return { ...this.bounds } }
getNormalBounds() { return { ...this.bounds } }
isDestroyed() { return this.destroyed }
+ isVisible() { return this.visible }
destroy() { if (!this.destroyed) { this.destroyed = true; this.emit('closed') } }
isMinimized() { return this.minimized }
isFocused() { return this.focused }
@@ -332,6 +333,48 @@ test('the start window takes acts only from its own page, each in its own view',
assert.equal(s.calls.retry, 0)
})
+// The page's whale and ring come about 1 s after the window: shown at once, it was an empty panel.
+// Windows draws a window it has just shown a few frames before its page, under its own opening
+// transition: the window shows see-through and turns opaque OPEN_MS later, and only then does the
+// snapshot say `shown`, which starts the whale's entrance (start.js).
+test('the start window shows once its page says it has painted, see-through until OPEN_MS', (t) => {
+ const s = startWindow(t)
+ s.start.open('first')
+ assert.equal(s.win().visible, false)
+ s.tick(PAINT_WAIT_MS - 1)
+ assert.equal(s.win().visible, false)
+ assert.equal(s.act('painted'), true)
+ assert.equal(s.win().visible, true)
+ assert.deepEqual(s.win().calls.filter(call => call === 'show' || call.startsWith('opacity')), ['opacity 0', 'show'])
+ s.tick(OPEN_MS - 1)
+ assert.notEqual(s.state()?.shown, true)
+ assert.equal(s.win().opacity, 0)
+ s.tick(1)
+ assert.equal(s.win().opacity, 1)
+ assert.equal(s.state().shown, true)
+ // The page's fallback and a second 'painted' change nothing.
+ s.tick(PAINT_WAIT_MS)
+ s.act('painted')
+ assert.deepEqual(s.win().calls.filter(call => call === 'show' || call.startsWith('opacity')), ['opacity 0', 'show', 'opacity 1'])
+})
+
+test('a start page that never says it painted is shown anyway, opaque at once', (t) => {
+ const s = startWindow(t)
+ s.start.open('first')
+ s.tick(PAINT_WAIT_MS)
+ assert.equal(s.win().visible, true)
+ assert.equal(s.state().shown, true)
+ assert.equal(s.win().calls.includes('opacity 0'), false)
+})
+
+test('a dialog of the start window shows it at once: it never opens over nothing', (t) => {
+ const s = startWindow(t)
+ s.start.open('first')
+ assert.equal(s.start.owner(), s.win())
+ assert.equal(s.win().visible, true)
+ assert.equal(s.state().shown, true)
+})
+
// 〔保存日志…〕 asks the app's own picker (main.mjs saveAs) where, never a system box.
test('〔保存日志…〕 writes the log where the app\'s picker says, and nothing when it is cancelled', async (t) => {
const s = startWindow(t)
@@ -350,6 +393,15 @@ test('〔保存日志…〕 writes the log where the app\'s picker says, and not
assert.match(saved(), /^DeepSeek Bot 0\.0\.0 \([\s\S]*a log line/u)
})
+test('a dialog of the start window turns it opaque while it waits see-through', (t) => {
+ const s = startWindow(t)
+ s.start.open('first')
+ s.act('painted')
+ assert.equal(s.start.owner(), s.win())
+ assert.equal(s.win().opacity, 1)
+ assert.equal(s.state().shown, true)
+})
+
test('the 180 s question comes on the start\'s clock while the engine is not up', async (t) => {
const s = startWindow(t)
s.start.open('first')