🐛 脚本同步设置改为即时保存#1615
Merged
Merged
Conversation
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.
Checklist / 检查清单
Description / 描述
背景
Script Sync 的 Sync Delete、Sync Status、文件系统类型和连接参数此前只更新页面草稿,离开页面前还必须点击位置不明显的 Save;这会让用户误以为勾选已经生效。启用同步也缺少明确的控件级校验状态与完整的异步竞态保护。
本次改动
cloud_sync配置作为界面唯一真相;Sync Delete、Sync Status、filesystem 类型和参数变更立即持久化。aria-busy/ spinner 校验状态,通过现有FileSystemFactory.create生产路径验证当前 provider 与参数。enable=true;失败时显示具体错误并保持enable=false。enable=false,不执行连接校验。实现考虑
useSystemConfig("cloud_sync")外部存储适配器,确保当前页面写入和其他上下文的 systemConfig 更新都会刷新 UI,不再维护未保存 draft。FileSystemFactory.create/FileSystemParams流程负责,没有新增或伪造 OAuth 路径。已知限制
建议审查重点
关联
Fixes #1614
验证
pnpm exec vitest run --no-coverage --reporter=verbose src/pages/options/routes/Setting/sections/SyncSection.test.tsx— 1 file / 18 tests passed。pnpm run test:ci— 306 files / 3374 tests passed。pnpm run lint— Prettier、TypeScript 和全仓 ESLint passed。pnpm run build— production build passed;保留现有的 4 组 Rspack 性能/Monaco dynamic require warnings,无构建错误。CI=1 pnpm exec playwright test --config playwright.scratch.config.ts -g "Script Sync settings auto-save"— 真实 production build 加载验证 1 test passed;覆盖普通配置落库、Save 移除、loading/失败回滚、关闭不校验和“立即同步”门控。Screenshots / 截图
未附远端截图。一次性真实扩展验证按仓库规范将截图与报告保存在 git-ignored 的
test-results/verify/script-sync-auto-save/,未提交验证产物。