fix(recovery): restore Reset Harness Data action on plugin recovery view - #135
Closed
yaojin3616 wants to merge 1 commit into
Closed
fix(recovery): restore Reset Harness Data action on plugin recovery view#135yaojin3616 wants to merge 1 commit into
yaojin3616 wants to merge 1 commit into
Conversation
The 'Reset Data' option originally added in #81 was lost when the plugin-recovery view replaced the simple dialog in #94. When a third-party plugin cannot be identified as the cause of a startup failure (e.g. a built-in core plugin reports 'failed to import loader entry ...'), the user is left without a self-service recovery path and must manually delete the harness directory. This change re-exposes 'Reset Harness data' as the primary action when no removable plugin is identified. It backs up the current harness directory, recreates a clean working folder, and retries startup automatically. The action is hidden when a removable third-party plugin is offered instead. Closes #69
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
在 #81 中为 Harness 启动失败对话框添加了「重置数据」按钮,后来 #94 引入更完善的 plugin-recovery.html 恢复页面时该选项被遗漏。当 startup failure 命中的是内置/无法识别的插件(例如
failed to import loader entry 48a498a7 (@deepseek-ai/dsh-cordis-client-runner): client-modules: bundle script ... failed to load)时,resolveProfileRecoveryPlugins返回空数组,恢复页面只剩下「打开 Harness 日志」和「退出」,用户只能手动删除 harness 目录才能恢复 — 与 #69 截图里显示的状态一致。主要改动
src/main/plugin-recovery-view.ts:当canUninstall === false时,把主操作从「打开 Harness 日志」改为「重置 Harness 数据」,新增canResetData/resetLabel/resetBusyLabel/resetDetail/resetSafetyNote字段src/main/index.ts:新增reset-data动作,调用resetHarnessData()(重命名 harness 目录到带时间戳的备份,再创建新目录),并重新启动 Harness;新增resetHarnessData()复用 fix: add Reset Harness Data recovery option for startup failures #81 中的实现build/plugin-recovery.html:主按钮在没有可卸载插件时导航到dsh-recovery://reset-datatest/plugin-recovery-view.test.ts:更新原有断言,新增中文/英文场景覆盖canResetData切换与按钮文案验证
npm test:plugin-recovery / plugin-recovery-view / plugin-recovery-html / plugin-recovery-detection 共 35 个用例通过npm run typecheck:通过npm run build:通过git diff --check:无空白问题Closes #69