Skip to content

fix(overview): make selecting queue + slot fly-in visible again - #448

Merged
caigee-cmd merged 7 commits into
mainfrom
fix/inflight-queue-visible
Oct 29, 2026
Merged

caigee-cmd merged 7 commits into
mainfrom
fix/inflight-queue-visible

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

用户反馈 Overview「实时进行中」看不到选号/排队,进入槽位飞入也没有。

根因(有文件证据):

  1. 轮询错过 dwell:useLive 默认每 2.5s 拉 /api/live,而 selectingMinDwell 只有 500ms(internal/logs/recorder.go)。选号 Bind 通常亚毫秒完成 → 绝大多数请求在两次 poll 之间就离开投影,queue 经常为空。
  2. 飞入 ID 对不上:排队项 id = requestId,槽位 running job id = live-${accountId}(applyLiveProjection)。InflightLiveCard 的 queue→slot 动画要求 同一 id 从 queued→running,live 路径永远对不上,所以看不到飞入。
  3. dwell 投影还曾 清空 AccountID,前端无法把离开队列的项落到具体账号槽。

忙槽本身仍靠 InFlight 投影;本次主要修「选号可见 + 飞入槽位」。面板需 展开 才会消费 live(折叠时不拉详情)。

Fix

  • dwell 内保留 account_id 并写入 LiveJob
  • 展示 dwell 500ms → 1.6s(仍不拖延 Acquire)
  • InflightLiveCard 展开时 /api/live 轮询 400ms
  • 排队项离开时按 account_id(或唯一新忙槽)飞入槽位

Test plan

  • 部署本分支后展开「实时进行中」
  • 打几条 chat:等待轨应短暂出现选号 pill,再飞入账号槽
  • 槽位 busy 段有占用;折叠时仍只显示并发条,展开才加速 poll
  • go test ./internal/logs/ ./internal/console/ 与 npx tsx scripts/mockInflight.test.ts 已通过

Do not merge from this agent — user deploys prod themselves.

Root causes: 2.5s /api/live poll missed the 500ms selecting dwell, and
live queue jobs (request id) never matched slot jobs (live-${account}),
so queue→slot fly never fired.

- Keep account_id on dwell SelectingRequests; expose on LiveJob
- Bump display dwell to 1.6s (Acquire still immediate)
- Poll /api/live at 400ms while InflightLiveCard is expanded
- Fly wait-rail departures to bind account (or single newly busy slot)
Queue→slot fly uses GSAP MotionPath arc into data-cell-id (滑过去槽里).
/api/live occupancy from BoundRequests maps each in-flight request to a
concurrency cell with RequestedModel and Bind started_at — SlotBar shows
model + seconds per cell, not one account timer.
Finish one concurrency cell at a time (request_id completions), keep
sibling cells occupied, and GSAP FLIP the worker rail on busy↔available
reorder. Changelog + mockInflight tests; sync embedded webui.
Drive Done/Failed exits from each concurrency cell (stagger same-tick
multi-cell finishes) and give the worker rail a drag-up / 避让上顶 FLIP
when busy rises and idle drops. Changelog ZH+EN; synced static.
Keep concurrency-cell model/elapsed hidden until the queue→slot fly
lands (pendingInbound during dwell; React land-gate survives clock
re-renders). When a selecting pill leaves, remaining wait pills FLIP up
interrupt-safely so another mid-FLIP selecting can still fly out.
CI frontend job fails when npm run sync drifts internal/webui/static.
Also polish unreleased notes into a concise numbered bilingual list.
Resolve OverviewPage (keep expanded live poll + cooling chip),
re-sync embedded static, number pool-cooldown note as item 4.
@caigee-cmd
caigee-cmd merged commit e5ee467 into main Oct 29, 2026
6 checks passed
@caigee-cmd
caigee-cmd deleted the fix/inflight-queue-visible branch October 29, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant