Skip to content

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

Crossfade the start window into the team window once the whale has landed

AdamPlatin1239cf5f3af7b58
diff --git a/app/src/start-window.mjs b/app/src/start-window.mjs
index 8b955750..c0e7d7e1 100644
--- a/app/src/start-window.mjs
+++ b/app/src/start-window.mjs
@@ -19,10 +19,14 @@ export const PHASES = ['data', 'engine', 'team']
export const START_KINDS = ['first', 'later', 'moving']
export const WATCHDOG_MS = 180_000
export const TEAM_VIEW_MS = 20_000
-// handoffShow + 160 ms: the growth, 300 ms in steps of about 14 ms; the start window goes
-// 300 ms after the team window shows (§8).
-export const GROWTH = { delay: 160, duration: 300, step: 14 }
+// handoffShow + 40 ms: the growth, 260 ms in steps of about 14 ms (§8). The page's content has
+// faded by handoffShow, so the growth starts at once. The whale lands after the window has grown
+// (whale.js GROWN_AFTER, LAND_AFTER); the reveal waits for that, LANDING_WAIT at most.
+export const GROWTH = { delay: 40, duration: 260, step: 14 }
+export const LANDING_WAIT = 300
export const DESTROY_AFTER_MS = 300
+// At the end of a growth the start window fades out over the team window under it.
+export const FADE = { duration: 180, step: 16 }
export const FAILURE_LINES = 200
// 〔保存日志…〕 saves this many of the latest log lines, after the same header as the copied details.
export const SAVED_LINES = 5000
@@ -131,7 +135,9 @@ export function cubicBezier(x1, y1, x2, y2) {
return y((low + high) / 2)
}
}
-export const GROWTH_EASING = cubicBezier(0.2, 0.7, 0.2, 1)
+// Ease in and out over the whole growth: a quick start with a long tail looks done early and
+// leaves the whale waiting in an empty window.
+export const GROWTH_EASING = cubicBezier(0.45, 0, 0.25, 1)
export function rectAt(from, to, progress) {
const at = key => Math.round(from[key] + (to[key] - from[key]) * progress)
@@ -274,6 +280,9 @@ export class StartWindow {
#showAt = 0
#from
#handing = false
+ #under = false
+ #grown = false
+ #landed = false
#revealed = false
// Whether the engine of this attempt is up; the stages done say where the whale is, which a
// retry never moves back.
@@ -564,6 +573,8 @@ export class StartWindow {
// A team view that loads after its 20 s goes in without a celebration (§7).
const celebrate = this.#state.celebrate && this.#state.view !== 'viewFailed'
this.#update({ view: 'handoff', done: [...PHASES], celebrate, failure: undefined, landing: this.#landing(report) })
+ const main = this.#o.mainWindow()
+ if (main !== undefined && !main.isDestroyed() && !this.#window.isMinimized()) this.#underlay(main)
this.#later('fallback', fallbackMs(this.#state), () => {
note('the page did not send handoffShow')
this.#handoffShow({ grow: false })
@@ -655,6 +666,7 @@ export class StartWindow {
#reset(start) {
this.#clearTimers()
this.#handing = false
+ this.#under = false
this.#revealed = false
this.#engineUp = false
this.#holdsOff()
@@ -710,7 +722,7 @@ export class StartWindow {
return false
}
if (name === 'handoffShow') this.#handoffShow(payload)
- else if (name === 'handoffDone') note(`handoffDone at handoffShow + ${String(Date.now() - this.#showAt)} ms`)
+ else if (name === 'handoffDone') this.#handoffDone()
else if (name === 'retry') this.#retry()
else if (name === 'wait') this.#wait()
else if (name === 'reloadView') this.#reload()
@@ -787,9 +799,36 @@ export class StartWindow {
const target = this.placeMain(main)
const grow = !(payload !== null && typeof payload === 'object' && payload.grow === false) && !win.isMinimized() && !this.#reducedMotion()
if (!grow) { this.#reveal(); return }
+ this.#grown = false
+ this.#landed = false
this.#later('grow', GROWTH.delay, () => { this.#grow(this.#from, target) })
}
+ // At ready() the team window shows, see-through, out of the taskbar and under the start window,
+ // so that Windows' own opening transition has run by the reveal (shown at the reveal, it dims
+ // the page and doubles the whale over the start window for a few frames), and so that showing
+ // a window this large does not hold up the growth's first step.
+ #underlay(main) {
+ try {
+ main.setSkipTaskbar(true)
+ main.setOpacity(0)
+ main.showInactive()
+ this.#window.moveTop()
+ this.#under = true
+ } catch (error) {
+ note(`the team window did not go under the start window: ${error instanceof Error ? error.message : String(error)}`)
+ this.#unlay(main)
+ }
+ }
+
+ #unlay(main) {
+ this.#under = false
+ if (main.isDestroyed()) return
+ main.hide()
+ main.setOpacity(1)
+ main.setSkipTaskbar(false)
+ }
+
// Electron ignores setBounds' animate flag on Windows, so the growth is stepped here; each step
// eases from the time it really runs at, so a busy machine skips steps rather than stretching.
#grow(from, to) {
@@ -799,12 +838,21 @@ export class StartWindow {
if (!this.#open()) return
const time = Math.min(1, (Date.now() - began) / GROWTH.duration)
this.#window.setBounds(rectAt(from, to, GROWTH_EASING(time)))
- if (time < 1) this.#later('grow', GROWTH.step, step)
- else this.#reveal()
+ if (time < 1) { this.#later('grow', GROWTH.step, step); return }
+ this.#grown = true
+ if (this.#landed) this.#reveal()
+ else this.#later('land', LANDING_WAIT, () => { note('the whale did not land in time'); this.#reveal() })
}
this.#later('grow', GROWTH.step, step)
}
+ // The whale has landed on the avatar (or dived): the team window shows once the growth is done.
+ #handoffDone() {
+ note(`handoffDone at handoffShow + ${String(Date.now() - this.#showAt)} ms`)
+ this.#landed = true
+ if (this.#handing && this.#grown) this.#reveal()
+ }
+
// The team window shows on its rect: with the focus when the start window had it; otherwise
// behind nothing new, flashing its taskbar button; minimized when the start window was.
#reveal() {
@@ -815,8 +863,11 @@ export class StartWindow {
this.#showTeam()
this.#clear('fallback')
this.#clear('grow')
+ this.#clear('land')
const win = this.#window
const how = win.isMinimized() ? 'minimized' : win.isFocused() ? 'focused' : 'behind'
+ if (this.#under && how !== 'minimized') { this.#crossfade(main, win, how); return }
+ if (this.#under) this.#unlay(main)
if (how === 'focused') {
main.show()
main.focus()
@@ -836,9 +887,37 @@ export class StartWindow {
this.#later('destroy', DESTROY_AFTER_MS, () => { this.#destroy() })
}
+ // The team window, already drawn and the size of the start window, turns opaque under it, and
+ // the start window fades out over it: the whale on the start page dissolves into the avatar
+ // it landed on. Layered opacity is the compositor's, so the fade costs no layout.
+ #crossfade(main, win, how) {
+ main.setOpacity(1)
+ main.setSkipTaskbar(false)
+ win.setSkipTaskbar(true)
+ note(`team window under the start window at ready + ${String(Date.now() - this.#readyAt)} ms`)
+ const began = Date.now()
+ const step = () => {
+ if (!this.#open()) return
+ const time = Math.min(1, (Date.now() - began) / FADE.duration)
+ win.setOpacity(1 - time * time * (3 - 2 * time))
+ if (time < 1) { this.#later('fade', FADE.step, step); return }
+ if (how === 'focused') main.focus()
+ else {
+ main.flashFrame(true)
+ main.once('focus', () => { main.flashFrame(false) })
+ }
+ note(`team window shown (${how}) at ready + ${String(Date.now() - this.#readyAt)} ms`)
+ this.#destroy()
+ }
+ this.#later('fade', FADE.step, step)
+ }
+
#cancelHandoff() {
+ const main = this.#o.mainWindow()
+ if (this.#under && !this.#revealed && main !== undefined) this.#unlay(main)
if (!this.#handing || this.#revealed) return
this.#clear('grow')
+ this.#clear('land')
this.#handing = false
if (this.#from !== undefined && this.#open()) this.#window.setBounds(this.#from)
}
diff --git a/app/src/start/whale.js b/app/src/start/whale.js
index b395ee2e..e6da942e 100644
--- a/app/src/start/whale.js
+++ b/app/src/start/whale.js
@@ -712,7 +712,7 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
// A beat for the ring to close, then the dive or the jump: handoffShow at 220 ms.
await at(100)
root.dataset.exit = 'caption all'
- const flight = want.landing ? leap(want.landing, 220 + SHOWN_AFTER - LAND_EARLY - 100) : 0
+ const flight = want.landing ? leap(want.landing, 220 + GROWN_AFTER + LAND_AFTER - 100) : 0
if (!flight) dive(12, DEEP(), 18, spring('tap'))
await at(220)
act('handoffShow')
@@ -730,7 +730,7 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
root.dataset.exit = 'caption'
await at(560)
root.dataset.exit = 'caption all'
- const flight = want.landing ? leap(want.landing, 720 + SHOWN_AFTER - LAND_EARLY - 560) : 0
+ const flight = want.landing ? leap(want.landing, 720 + GROWN_AFTER + LAND_AFTER - 560) : 0
if (!flight) dive(18, DEEP(), 24, spring('shape'))
await at(660)
if (!flight) sendRipple()
@@ -754,9 +754,10 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
// drawn, and the main process turned that into this page's coordinates once the window has
// grown onto the team window's rect. The whale leaves the lane (its clip would cut it at the
// waterline) for the window-wide .flight layer, rises out of the water and glides down onto the
- // avatar, shrinking to its size, so that it lands as the team window shows: the window grows
- // from handoffShow + 160 ms for 300 ms (GROWTH in start-window.mjs), and the team window shows
- // when it is done. Returns how long the flight takes.
+ // avatar, shrinking to its size. The window grows from handoffShow + 40 ms for 260 ms (GROWTH in
+ // start-window.mjs) while the whale rises and starts over, and the whale lands LAND_AFTER later,
+ // in a window that no longer moves; handoffDone then lets the team window show under it, and
+ // the start window fades out over it. Returns how long the flight takes.
function leap(landing, ms) {
// It arrives as the avatar sits: upright, unstretched (the celebration's squash, a failure's
// pose before a late or held hand-off) and looking ahead.
@@ -791,10 +792,10 @@ export function createDirector({ start, resume, act, label, announce, onCheck, o
if (want.celebrate && playful()) setTimeout(() => happyEyes(false), Math.round(ms * 0.7))
return ms
}
- // From handoffShow to the team window showing (GROWTH.delay + GROWTH.duration), and how much
- // sooner the flight ends, so a step the main process runs late never shows it mid-air.
- const SHOWN_AFTER = 460
- const LAND_EARLY = 30
+ // From handoffShow to the end of the growth (GROWTH.delay + GROWTH.duration), and how long after
+ // it the whale lands: the end of the glide is seen in a still window.
+ const GROWN_AFTER = 300
+ const LAND_AFTER = 60
// 1.25 x the whale's height: fully under the waterline within about 200 ms, so the window
// can grow around an empty sheet.
const DEEP = () => Math.round(125 * u)
diff --git a/app/test/start-page.test.mjs b/app/test/start-page.test.mjs
index 3da579da..fa8bb1ae 100644
--- a/app/test/start-page.test.mjs
+++ b/app/test/start-page.test.mjs
@@ -94,9 +94,9 @@ test('the start page draws the progress as a ring of three arcs and a closing ci
assert.match(html, /<div class="pond">\r?\n<svg class="ring"[\s\S]*?<div class="water"[\s\S]*?<div class="lane">[\s\S]*?<span class="spout"><svg class="plume"[^>]*\shidden>[\s\S]*?<div class="whale-hit"[\s\S]*?<div class="fx" aria-hidden="true"><span class="ripple"><\/span><\/div>\r?\n<\/div>/u)
assert.doesNotMatch(html, /class="(?:trace|elapsed)"/u)
// The layer the whale flies in to the Main Bot's avatar at the hand-off (whale.js leap), and
- // the flight's end tied to when the main process shows the team window.
+ // the flight tied to the end of the main process's growth.
assert.match(html, /<\/main>\r?\n<div class="flight" aria-hidden="true"><\/div>/u)
- assert.match(code['whale.js'], new RegExp(`const SHOWN_AFTER = ${String(GROWTH.delay + GROWTH.duration)}\\b`, 'u'))
+ assert.match(code['whale.js'], new RegExp(`const GROWN_AFTER = ${String(GROWTH.delay + GROWTH.duration)}\\b`, 'u'))
assert.doesNotMatch(read('start.css'), /\.(?:trace|elapsed)\b/u)
})
diff --git a/app/test/start-window.test.mjs b/app/test/start-window.test.mjs
index 6c07c96a..9e3cb68b 100644
--- a/app/test/start-window.test.mjs
+++ b/app/test/start-window.test.mjs
@@ -6,7 +6,7 @@ import { join } from 'node:path'
import { test } from 'node:test'
import { readStartFrame, writeStartFrame } from '../src/start-frame.mjs'
import {
- acceptsAct, centred, clampInto, clockMs, cubicBezier, detailsText, explainOf, failureReason, fallbackMs, GROWTH, GROWTH_EASING,
+ acceptsAct, centred, clampInto, clockMs, cubicBezier, detailsText, explainOf, failureReason, fallbackMs, FADE, GROWTH, GROWTH_EASING, LANDING_WAIT,
growthSteps, isStartPage, landingOf, MAIN_SIZE, mainRect, START_ACT, START_ACTS, START_STATE, startSize, startSnapshot, startUrl, StartWindow,
TEAM_VIEW_MS, WATCHDOG_MS,
} from '../src/start-window.mjs'
@@ -47,18 +47,20 @@ test('the easing is CSS cubic-bezier()', () => {
assert.ok(value >= previous && value <= 1, `at ${String(step)}%`)
previous = value
}
- // cubic-bezier(.2, .7, .2, 1) is quick at first: most of the way in the first half.
- assert.ok(GROWTH_EASING(0.5) > 0.9)
+ // cubic-bezier(.45, 0, .25, 1) eases in and out: slow at both ends, not done early.
+ assert.ok(GROWTH_EASING(0.2) < 0.15)
+ assert.ok(GROWTH_EASING(0.5) > 0.6 && GROWTH_EASING(0.5) < 0.8)
+ assert.ok(GROWTH_EASING(0.8) > 0.95)
})
-test('the start window grows into the team window in about 14 ms steps over 300 ms', () => {
+test('the start window grows into the team window in about 14 ms steps over 260 ms', () => {
const from = centred(startSize(AREA), AREA)
const to = mainRect(from, AREA)
const steps = growthSteps(from, to)
- assert.equal(GROWTH.duration, 300)
- assert.equal(GROWTH.delay, 160)
- assert.equal(steps.length, 22)
- assert.deepEqual(steps.at(-1), { at: 300, rect: to })
+ assert.equal(GROWTH.duration, 260)
+ assert.equal(GROWTH.delay, 40)
+ assert.equal(steps.length, 19)
+ assert.deepEqual(steps.at(-1), { at: 260, rect: to })
assert.ok(steps.every((step, index) => index === 0 || step.at > steps[index - 1].at))
assert.ok(steps.slice(0, -1).every(step => step.at % 14 === 0))
for (const key of ['x', 'y', 'width', 'height']) {
@@ -305,6 +307,8 @@ function fakeElectron() {
setBackgroundColor() {}
getMediaSourceId() { return 'window:1:0' }
moveAbove() {}
+ moveTop() { this.calls.push('moveTop') }
+ setOpacity(value) { this.opacity = value; if (value === 0 || value === 1) this.calls.push(`opacity ${String(value)}`) }
}
const display = { workArea: AREA }
const electron = {
@@ -470,14 +474,16 @@ for (const [kind, wait] of [['first', 2500], ['later', 800]]) {
s.start.done('engine')
s.start.ready()
s.tick(wait - 1)
- assert.equal(s.main.visible, false)
+ assert.equal(s.main.calls.includes('opacity 1'), false)
s.tick(1)
- assert.equal(s.main.visible, true)
- assert.deepEqual(s.main.calls.slice(-2), ['show', 'focus'])
+ // It waited see-through under the start window, which fades out over it without growing.
+ assert.deepEqual(s.main.calls.slice(-2), ['opacity 1', 'skipTaskbar false'])
assert.ok(s.win().calls.includes('skipTaskbar true'))
await s.start.teamShown
- s.tick(300)
- assert.equal(s.win().destroyed, true)
+ const start = s.win()
+ for (let ms = 0; ms <= FADE.duration; ms += FADE.step) s.tick(FADE.step)
+ assert.equal(start.destroyed, true)
+ assert.equal(s.main.calls.at(-1), 'focus')
// Gone after the hand-off, the start window does not quit the app.
assert.equal(s.calls.close, 0)
})
@@ -497,7 +503,7 @@ test('after handoffShow the start window grows into the team window\'s rect, and
assert.deepEqual(s.win().bounds, from)
s.tick(1)
const widths = []
- for (let step = 0; step < 40 && !s.main.visible; step += 1) {
+ for (let step = 0; step < 40 && !s.main.calls.includes('opacity 1'); step += 1) {
s.tick(GROWTH.step)
widths.push(s.win().bounds.width)
}
@@ -506,7 +512,54 @@ test('after handoffShow the start window grows into the team window\'s rect, and
assert.ok(widths.some(width => width > from.width && width < target.width), 'the start window jumps instead of growing')
// A second handoffShow does nothing.
assert.equal(s.act('handoffShow'), true)
- assert.equal(s.main.calls.filter(call => call === 'show').length, 1)
+ assert.equal(s.main.calls.filter(call => call === 'showInactive').length, 1)
+})
+
+test('the team window shows once the whale has landed and the window has grown, or a while after', (t) => {
+ for (const landed of [true, false]) {
+ const s = startWindow(t)
+ s.start.open('later')
+ s.start.done('data')
+ s.start.done('engine')
+ s.start.ready()
+ s.act('handoffShow')
+ for (let ms = 0; ms <= GROWTH.delay + GROWTH.duration + GROWTH.step; ms += GROWTH.step) s.tick(GROWTH.step)
+ assert.deepEqual(s.win().bounds, s.main.bounds)
+ assert.equal(s.main.calls.includes('opacity 1'), false, 'it shows before the whale has landed')
+ if (landed) {
+ assert.equal(s.act('handoffDone'), true)
+ assert.equal(s.main.calls.includes('opacity 1'), true)
+ } else {
+ for (let ms = 0; ms < LANDING_WAIT; ms += GROWTH.step) s.tick(GROWTH.step)
+ assert.equal(s.main.calls.includes('opacity 1'), true)
+ }
+ t.mock.timers.reset()
+ }
+})
+
+test('the team window waits see-through under the growing start window, which then fades out over it', (t) => {
+ const s = startWindow(t)
+ s.start.open('later')
+ s.win().focused = true
+ s.start.done('data')
+ s.start.done('engine')
+ s.start.ready()
+ // Shown at ready(), so that Windows' opening transition runs before the reveal, but not seen.
+ assert.deepEqual(s.main.calls.slice(-3), ['skipTaskbar true', 'opacity 0', 'showInactive'])
+ assert.equal(s.win().calls.at(-1), 'moveTop')
+ s.act('handoffShow')
+ for (let step = 0; step < 60 && !s.main.calls.includes('opacity 1'); step += 1) s.tick(GROWTH.step)
+ assert.deepEqual(s.main.calls.slice(-2), ['opacity 1', 'skipTaskbar false'])
+ assert.deepEqual(s.win().bounds, s.main.bounds)
+ const start = s.win()
+ s.tick(FADE.duration / 2)
+ assert.ok(start.opacity > 0 && start.opacity < 1, 'the start window does not fade')
+ assert.equal(s.main.calls.includes('focus'), false)
+ s.tick(FADE.duration)
+ assert.equal(start.opacity, 0)
+ assert.equal(start.destroyed, true)
+ assert.equal(s.main.calls.at(-1), 'focus')
+ assert.equal(s.calls.close, 0)
})
for (const how of ['behind', 'minimized']) {
@@ -520,7 +573,8 @@ for (const how of ['behind', 'minimized']) {
s.start.ready()
s.act('handoffShow')
for (let step = 0; step < 60 && !s.main.calls.includes('flash true'); step += 1) s.tick(GROWTH.step)
- assert.deepEqual(s.main.calls.slice(-2), [how === 'behind' ? 'showInactive' : 'minimize', 'flash true'])
+ // Behind: it waited under the start window and is uncovered by the fade; minimized: no growth.
+ assert.deepEqual(s.main.calls.slice(-2), how === 'behind' ? ['skipTaskbar false', 'flash true'] : ['minimize', 'flash true'])
assert.equal(s.main.calls.includes('focus'), false)
})
}
diff --git a/docs/plans/2026-10-26-start-window.md b/docs/plans/2026-10-26-start-window.md
index b9976a15..41e49040 100644
--- a/docs/plans/2026-10-26-start-window.md
+++ b/docs/plans/2026-10-26-start-window.md
@@ -252,19 +252,19 @@
| 时间 | 启动窗口 | 主进程 |
|---|---|---|
-| `t0` | 圆环合上;鲸鱼压扁再拉长(460 ms),「^ ^」眼,尾巴甩一下,喷一次水(第 3 节) | |
+| `t0` | 圆环合上;鲸鱼压扁再拉长(460 ms),「^ ^」眼,尾巴甩一下,喷一次水(第 3 节) | 主窗口在最后的矩形上显示出来,但不透明度 0、不在任务栏上、压在启动窗口下面:Windows 自己的打开过渡在看不见时走完,显示这么大的窗口也不再卡住后面长大的第一步 |
| `t0` + 160 ms | 提示行淡出 | |
| `t0` + 560 ms | 拉到最长时跳出水面,飞向 Main Bot 的头像会在的位置(590 ms,见下面「跳到 Main Bot 的头像上」);没有地方落时潜下去,深到身高的 1.25 倍;鲸鱼的话、水线、圆环、还在落的水、纸面和位置行淡出 .16 s | |
| `t0` + 660 ms | 只在潜下去时:涟漪,160 ms 淡完(交接时喷的水不另起一圈) | |
| `t0` + 720 ms | 发 `handoffShow` | 主窗口已经隐藏着放在最后的矩形上(以启动窗口的中心居中,不超出工作区);任务栏上仍是启动窗口的按钮 |
-| `handoffShow` + 160 ms | 字、水线、圆环和纸面都已淡完,只剩 Mica 和飞着的鲸鱼(潜下去时鲸鱼在水线下,只剩 Mica) | 把启动窗口从 720 × 540 长到主窗口的矩形,300 ms,逐步 `setBounds`,约 14 ms 一步 |
-| `t0` + 1150 ms(潜下去时 980 ms) | 落在头像上,发 `handoffDone`(潜下去时是潜完) | |
-| `handoffShow` + 460 ms | | 长到位;主窗口在同一个矩形上、在启动窗口上面露面,用系统自己的打开过渡;启动窗口同时离开任务栏,应用的任务栏按钮一直在 |
-| `handoffShow` + 760 ms | | 主窗口露面 300 ms 后销毁启动窗口 |
-
-- 庆祝的交接里主窗口在就绪后约 1.2 秒露面。
-- 长大由主进程做:Electron 44 在 Windows 上不理 `setBounds` 的 `animate` 参数,只能一步一步改大小。每一步页面都重新排版,但只重画其中一部分(探针里 23 步重画了 8 次),所以长大时页面上只有飞着的鲸鱼:字、水线、圆环和纸面都在长大之前淡完。鲸鱼的动画走合成线程,但页面只在其中几步重画,这 300 ms 里鲸鱼可能一顿一顿地动,机器忙时更明显(已知限制)。
-- 不庆祝的交接(以后的启动):圆环合上;100 ms 时页面上的字、水线、圆环和纸面淡出 .16 s,鲸鱼跳向 Main Bot 的头像(550 ms),650 ms 时落下、发 `handoffDone`;没有地方落时鲸鱼 290 ms 潜下去(`SPRING_TAP`),深到身高的 1.25 倍,390 ms 时发 `handoffDone`;两种都在 220 ms 时发 `handoffShow`。长大和露面和首次启动一样从 `handoffShow` 算起,主窗口在就绪后约 0.7 秒露面。
+| `handoffShow` + 40 ms | 字、水线、圆环和纸面都已淡完,只剩 Mica 和飞着的鲸鱼(潜下去时鲸鱼在水线下,只剩 Mica) | 把启动窗口从 720 × 540 长到主窗口的矩形,260 ms,缓入缓出,逐步 `setBounds`,约 14 ms 一步 |
+| `handoffShow` + 300 ms | | 长到位 |
+| `t0` + 1080 ms(潜下去时 980 ms) | 长到位 60 ms 后落在头像上(这最后一小段在不再动的窗口里),发 `handoffDone`(潜下去时是潜完) | |
+| `handoffDone`,最早长到位时 | | 主窗口在启动窗口下面变成不透明、回到任务栏;启动窗口离开任务栏,180 ms 淡出(`setOpacity`,系统合成,不重排),鲸鱼化进它脚下真的头像;淡完给主窗口焦点,销毁启动窗口。长到位 300 ms 后还没有 `handoffDone`,也照样开始 |
+
+- 庆祝的交接里主窗口在就绪后约 1.1 秒开始露出来,1.3 秒完全露出。
+- 长大由主进程做:Electron 44 在 Windows 上不理 `setBounds` 的 `animate` 参数,只能一步一步改大小。每一步页面都重新排版,但只重画其中一部分(探针里 23 步重画了 8 次),所以长大时页面上只有飞着的鲸鱼:字、水线、圆环和纸面都在长大之前淡完。鲸鱼的动画走合成线程,但页面只在其中几步重画,这 260 ms 里鲸鱼可能一顿一顿地动,机器忙时更明显(已知限制)。
+- 不庆祝的交接(以后的启动):圆环合上;100 ms 时页面上的字、水线、圆环和纸面淡出 .16 s,鲸鱼跳向 Main Bot 的头像(480 ms),580 ms 时(长到位 60 ms 后)落下、发 `handoffDone`;没有地方落时鲸鱼 290 ms 潜下去(`SPRING_TAP`),深到身高的 1.25 倍,390 ms 时发 `handoffDone`;两种都在 220 ms 时发 `handoffShow`。长大和露面和首次启动一样从 `handoffShow` 算起,主窗口在就绪后约 0.6 秒开始露出来,0.8 秒完全露出。
- 页面没发 `handoffShow` 时,主进程自己显示主窗口:首次启动和庆祝的交接在 2.5 秒后,其余以后的启动在 0.8 秒后。页面发得早得多:庆祝的 0.72 秒,不庆祝的 0.22 秒;入场还没到位时,再晚最多一个入场(560 ms、290 ms)。
- 减少动态效果:不长大,鲸鱼也不跳。剩下的弧画满、圆环合上都只用 .12 s,庆祝时换成「^ ^」眼(安静档不换);300 ms 时内容淡出 .12 s,420 ms 时发 `handoffShow`,440 ms 时发 `handoffDone`,主窗口直接出现在它最后的矩形上(第 9 节)。
- 启动窗口有焦点时,主窗口直接显示并拿到焦点。
@@ -274,7 +274,7 @@
- 头像在哪里由插件说:侧栏调 `dsBotApp.ready()` 时带上 Main Bot 的头像在团队页面里画在哪里(团队列里的 `.bt-side [data-bot-id] .bt-mark`,宽的团队列的磁贴上 60 px,窄栏里 44 px):`{ x, y, width, height, viewportWidth, viewportHeight }`,团队页面的 CSS px。只在 Main Bot 是默认的样子(鲸鱼、`deepseek` 色、没有照片)、头像在团队列里看得见时才带。预载只传有限的数字。
- 主进程(`start-window.mjs` 的 `landingOf`)按团队页面的缩放(团队内容区的宽 ÷ `viewportWidth`)换成 DIP,再换成启动窗口长到主窗口的矩形以后启动页自己的坐标(启动窗口的边框偏移照样带过去),放进交接的快照:`landing: { x, y, size }`。不像页面里的一个框(不是数字、小于 16 px、出了页面)就不放。`main.log` 记鲸鱼落在哪里,或者没有地方落、鲸鱼潜下去。交接等用户回答时(第 6 节),这个位置留着,答完照样用。
- 启动页(`whale.js` 的 `leap`):鲸鱼离开水道(水道在水线处裁掉它),进到整个窗口大的 `.flight` 层,按页面自己的坐标先向上跃出水面(飞到 40% 时最高,高过起点和终点),再滑向头像,同时缩到头像的大小;后 300 ms 窗口在往左上长,所以在屏幕上看,它是一路往左上飞进头像。起跳时身体回正:庆祝时的拉长、迟到或挂起的交接之前失败的姿势和低头的视线都在飞行的前 40% 里收回,落下时和头像一样正着。尾巴划两下(安静档没有);庆祝的交接里「^ ^」眼在 70% 时睁开,落下时和头像一样睁着眼。卡片刚收回、水塘还缩着时,从它看得见的大小起飞。
- - 落下比主窗口露面早 30 ms(`handoffShow` + 160 ms 开始长大,长 300 ms,`handoffShow` + 460 ms 露面):庆祝的交接 `t0` + 560 ms 起跳,飞 590 ms,1150 ms 落下;不庆祝的 100 ms 起跳,飞 550 ms,650 ms 落下。主进程哪一步晚了一点,主窗口露面时鲸鱼也已经落下,不会停在半空。
+ - 主窗口等鲸鱼落下才露出来(`handoffShow` + 40 ms 开始长大,长 260 ms,再过 60 ms 落下):庆祝的交接 `t0` + 560 ms 起跳,飞 520 ms,1080 ms 落下;不庆祝的 100 ms 起跳,飞 480 ms,580 ms 落下。主进程晚了,就等到长到位;页面没说落下,长到位 300 ms 后照样露出来。露出来是启动窗口在主窗口上面淡出,所以鲸鱼和头像在这 180 ms 里叠在同一处,不会一下跳成两个。
- 没有地方落时照旧潜下去:Main Bot 换了别的样子或照片、团队列完全收起(窄栏和打开的抽屉里头像看得见,照样落)、经典 Agent 模式、启动窗口最小化着。DSH Desktop 和 DSH Web 没有 `dsBotApp`,侧栏不报位置,也没有启动窗口。减少动态效果时不跳,照旧淡出(第 9 节)。
- 团队界面里的头像不另做动画:鲸鱼落下的地方就是它。
- 首次启动时 DSH 先显示「预览版说明」,它的遮罩盖着侧栏:鲸鱼照样落在头像的位置上,主窗口露面时头像在遮罩下面。
@@ -405,6 +405,7 @@
- 2026-10-31 位置行:维护者「替换之前的3点式,移除左下角的社区非官方声明,右下角的换个位置」。追问以后:「3点式」就是原来的三站,圆环已经代替了它,这次不改;维护者问「要不要显示圆环显示对应3个正在启动的阶段?」:三段弧本来就各是一个阶段(第 2 节),不加字(2026-10-30「文案保持取消状态」)。底注去掉;位置行挪到底部正中,〔换个位置…〕改成灰色的小按钮(28 px,`small`),整行在纸面下面 4 px(第 2 节);首次启动照旧有,以后的启动只在数据所在的盘剩下的不到开始时的 20% 时有:开始时的剩余空间在数据放进一个文件夹时记进 `locations.json`(`freeAtStart`;盘满时记不到,下一次再记),以前存下的位置下一次启动补记;以后的启动点〔换个位置…〕当场搬数据(第 5 节)。试的时候搬数据被拒绝弹了系统对话框,维护者:「让我们尽可能避免系统中出现任何这样的默认弹窗」。所以以后的启动搬数据时,除了系统选择框都在卡片上问:「这里放不了」用第 6 节被拒绝的那张卡(原因多「整块磁盘」和「和总工作区互相包含」两句,读不了的文件夹按没有权限),确认是新的一张「搬到这个文件夹?」〔移动并重启〕〔重新选…〕〔取消〕;确认以后启动窗口当场变成搬数据的页面,这次启动让位,等着的交接作废。还剩下的系统对话框记进「已知限制」。第 2、3、4、6、8 节和「改动的已定设计」跟着改。依据:应用的测试(`place.test.mjs`:20% 的界线;`start-window.test.mjs`:变成搬数据的页面并丢掉等着的交接;`main-low-space.test.mjs`:盘快满时以后的启动有位置行,选进数据文件夹里出「这里放不了」,读不了的 `C:\System Volume Information` 按没有权限,取消以后引擎照常起来、团队界面照常加载,〔移动并重启〕以后页面载入 `?start=moving`、引擎在复制之前停下、数据复制到新文件夹、`locations.json` 换成新文件夹和它自己的剩余空间、应用重新启动,一路没有系统对话框;`main-room-left.test.mjs`:剩余空间还多时没有位置行,换总工作区不动记下的剩余空间,设置里搬数据照旧;`main.test.mjs`:没有记过的位置这次补记;`start-page.test.mjs`:页脚只有位置行和灰色按钮、搬数据的卡);故意改坏 20% 的判断、复制前停引擎、取消时丢掉启动这三处,测试都会失败。离屏渲染的检查 17 项都过(位置行居中、指针点得到、离底边 12 px、有卡片时在纸面下面 4 px、以后的启动和失败页、英文长路径省略、深色、两张卡)。一次独立评审(四个方面,每条意见一个复核)确认 7 条,都已改正:读不了的文件夹不再把正常的启动变成失败页,盘满时记下的 0 不算数,start-copy 第 3 节、本节第 5 节、「改动的已定设计」和上手流程的说法。真机上的以后的启动(这条分支的一次性副本,G 盘剩 4.0 GB,记下的开始空间 10^15 字节):位置行「数据放在 G 盘(剩 4.0 GB)」,指针点得到;先取消选择框,启动照常走;再点、选了文件夹,团队界面在卡片开着时就绪,交接等着;卡片「搬到这个文件夹?」写着真实的路径,没有系统对话框;点〔移动并重启〕后启动窗口变成搬数据的页面,等着的交接作废(等了 13 秒),6 秒后应用在新文件夹上重新启动并交接,`locations.json` 是新文件夹和 3.99 GB。
- 2026-11-01 不写字,加道具:用户要求「启动窗口轻易不写文字,除非出现空间不足或者报错,后者并提供一键复制/下载日志的选项」,并且「加载的时候应当有相关组件,例如放在鲸鱼面前一个正在翻动的文件夹,脉冲转动的两个齿轮」。所以去掉 45 秒的两句(「有点久,可能是杀毒软件在查新文件」「比平时慢,请再等一会儿」)、搬数据时的「正在搬 DeepSeek Bot 的数据…」和 45 秒的〔打开日志文件夹〕,慢只靠鲸鱼的姿势;位置行在首次启动也只在盘不够时有(推翻 2026-10-31「首次启动照旧显示」那一条,首次启动在盘够时就没有选位置的入口了);出错的每一页都有〔复制详细信息〕和新的〔保存日志…〕(`saveLog`,系统保存框,最后 5000 行),代替〔打开日志文件夹〕(`openLogs` 不再是启动页的动作);鲸鱼面前加每个阶段的道具:翻纸的文件夹、咬合的齿轮、跳的小成员(第 2、3、4、5、6、7、9、11 节)。另外加了开发用的三种进度画法(`DS_BOT_START_PROGRESS`,第 11 节),只为比较,不给用户。依据:启动页和启动窗口的单元测试;无头 Chrome 加替身桥录的整次启动(浅色、深色)和各阶段、失败页、180 秒、盘不够的截图;减少动态效果时道具和三种画法都没有循环动画。还没有在桌面应用里真机跑,〔保存日志…〕也还没有真点过。这次改的是已定的设计,要维护者确认。
- 2026-11-01(待维护者确认):动画只有一个来源。启动窗口的卡片和团队窗口里代替系统对话框的卡片(`app/src/page-card.css`)用同一组颜色和弹簧,都由 `scripts/start-assets.mjs` 从插件的 `themes.js` 和 `motion.js` 生成:卡片出现走 `SPRING_SHAPE`,收起用启动窗口卡片的退场(下沉 6 px、缩到 .975、模糊 3px,.16 s),减少动态效果时只淡入 .12 s、淡出 .16 s(第 9 节)。导入的几张卡(第 6 节)由主进程的 `import-flow.mjs` 发快照,页面照旧只按快照画。
+- 2026-11-01 交接的露面:在桌面应用里录了交接(真的 Electron 44、真的 `StartWindow`、替身团队页、ffmpeg 60 帧录屏),看到三个问题:长大用 `cubic-bezier(.2,.7,.2,1)`,前 40% 就走完了大半,窗口很早看着就长完了,鲸鱼落下后在一大块空的深色窗口里等 200 多毫秒;主窗口用 `show()` 露面时 Windows 自己的打开过渡压在启动窗口上,有一两帧整窗发灰、鲸鱼和头像错开成两个,然后深色一下跳成浅色;长大前 160 ms 的等待让鲸鱼停在跳的最高点。改成:主窗口在 `ready()` 时就以不透明度 0 显示在启动窗口下面(打开过渡看不见地走完,也不卡长大的第一步);长大 `handoffShow` + 40 ms 开始,260 ms,缓入缓出;鲸鱼长到位 60 ms 后落下,主进程等 `handoffDone` 才让主窗口变成不透明,再把启动窗口 180 ms 淡出,鲸鱼化进头像。减少动态效果和页面没发 `handoffShow` 时不长大,同样淡出。依据:录屏前后对比(首次启动就绪到主窗口露出 1.24 秒带一帧发灰,变成 1.09 秒开始淡、1.29 秒淡完;以后的启动 0.58 秒开始);启动窗口的单元测试(主窗口在 `ready()` 时透明地显示在下面、等落下或 300 ms、淡出后才给焦点、失败时收回)。Mica 窗口用 `setOpacity` 淡出在 Windows 11 上正常。
## 待定