Skip to content

fix(panel): 引导任务态搬进模块级 store——tab 关闭不再吞掉在飞请求与结果(#558) - #632

Open
modusensus wants to merge 1 commit into
mainfrom
feat/558-bootstrap-inflight-survives-tab-close
Open

modusensus wants to merge 1 commit into
mainfrom
feat/558-bootstrap-inflight-survives-tab-close

Conversation

@modusensus

Copy link
Copy Markdown
Member

做什么

#558(从 PR #556 评审分出的已知缺口):面板「⋯ → 从目录引导」的请求在飞时关掉整个 better-sidebar 标签页,MemoryExplorer 与引导弹层随标签页体一起卸载——keepMounted 覆盖隐藏与切视图、不含关闭(它自己的设计文档写明「记录的寿命只由原生 tab 关闭与会话消失回收」)。请求照样跑完、行照样落库(三元组去重 + _overwrite 刷新,重复执行不写坏数据),但成功/失败提示没地方显示、忙碌态也丢了,重开还能再提交一次。

按 issue 指的方向修:把 in-flight 状态与结果搬到标签页体之外(模块级 pub/sub),标签页重开时恢复。不改 better-sidebar 行为、不碰 #556。

实现

  • 模块级 store(lib/client.js):bootstrapJob(phase: idle/running/done/failed + dir/result/error)+ setBootstrapJob / useBootstrapJob / resetBootstrapJob——就是 overlayListeners/setOverlayOpen 的现成形状。
  • prop 钻孔链整条拆掉:busy/msg/err 全部从 store 派生,弹层只是任务态的视图;onBusyChange 三段转发(弹层 → explorer → overlay)删除。MemoryOverlay 的 Esc/背板/✕ 三条关闭守卫改为直接订阅——顺带修掉 tab 注册路径守卫为空的老缺口(那条路径没有 onBusyChange,busy 从来报不上去)。
  • 存活规则一条:「只存活用户没来得及看的那一份」。卸载发生在 running 时(tab 关闭),结果还没人看过——terminal 化发生在卸载之后,这份留给重开回放;卸载时已是 done/failed(用户见过),explorer 卸载兜底把它回 idle,保持「重开是干净弹层」的既有行为。人看得见的关闭(取消 / 自动收口 / ⋯ 菜单收起)都显式回 idle 并保留目录(重试同目录是最常见的下一步)。
  • 弹层两处跟随调整:① terminal 化只写 store(tab 关闭后结果落地时组件已卸载,写 store 才有人接——这正是要修的路径);② fresh done 的 900ms 阅读窗锁提交钮但不锁取消——旧实现靠本地 busy 连 cancel 一起锁,现在 done 是 store 态、可能被重开回放,取消若也锁死,旧结果会把弹层永久焊住。
  • 同步性顺带变强:旧链的「同步报 busy」靠回调追渲染提交前的那一拍(#4452539705);现在 setBootstrapJob(running) 一落,三处订阅者同步被唤醒。
  • 输入框播种、错误分码、刷新同步调、定时器清理由——既有行为逐条保留(测试锁全部续上)。

验证

Closes #558

Copilot AI lite review requested due to automatic review settings November 9, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 514d238 and ce43f78.

Files selected for processing: 3

  • dsh-mneme/CHANGELOG.md
  • dsh-mneme/lib/client.js
  • dsh-mneme/test/client.test.js
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

面板:引导请求在飞时关掉侧边栏标签页,结果与忙碌状态无处显示

2 participants