Commit Graph
6 Commits
Author SHA1 Message Date
Qiu Yuzhou 5abb6c6033 build: migrate NG2 to Swift 6 and clear warnings 2026-09-28 08:44:53 +08:00
Qiu Yuzhou cf1834a775 feat(ng2): add four-way listener mode 2026-09-27 20:58:54 +08:00
Qiu Yuzhou effae048b8 feat(settings): remove holistic preferences reset
Not every preference warrants a reset; future resets are per
configuration item, added only where a field truly needs one (tracked
in #69). The whole chain goes: the 恢复默认 button and its confirmation
alert in SettingsView, the SettingsWorkflow reset/confirm/cancel
commands and the confirmation machinery they existed for (the
SettingsConfirmation enum had a single case), the
SettingsCommitting.resetPreferences seam entry, the runtime
resetPreferences() and ProxySettingsFileStore.reset() with its
file-rollback helpers and the rollbackFailed store error.

CONTEXT.md drops the three stale reset phrases and now records the
domain decision: no restore-all-factory-defaults action for
preferences; a reset, where it exists, is scoped to one configuration
item. ADR-0004/0005/0011 carry amendment notes since their reset
sentences describe a removed capability (0004's also predate the
PAC removal).
2026-09-27 13:29:32 +08:00
Qiu Yuzhou a8cd6262c2 feat(proxy): remove PAC and accept ACL system proxy path
Remove the PAC product feature entirely: PAC HTTP service, port, health
probe, runtime extension, PAC URL system proxy projection, PAC rule
editing, and GFWList URL settings. The product now exposes rule / global /
direct modes only, all projected as a local SOCKS system-proxy target.

First-run defaults are rule + proxyWhenUnmatched, agent on, system proxy
off. Homepage and status menu share one ProxyControlSnapshot showing the
three modes and rule sub-options. Manual servers, subscriptions, Legacy
import, and independent SOCKS/HTTP inbounds are retained.

Fix: include verbose in SslocalListenFingerprint so a verbose-only
contract change restarts sslocal instead of leaving RUST_LOG stale.

Revise CONTEXT.md vocabulary, ADR-0007, and ADR-0009. Record GFWList
exception shadowing, IPv6 system-exception, DNS, and traffic-coverage
boundaries. Add host acceptance evidence document.

Closes #67
2026-09-26 21:58:12 +08:00
Qiu Yuzhou c76ba93221 feat(ng2): finalize settings workflow persistence boundary 2026-09-24 00:20:42 +08:00
Qiu Yuzhou 713c627deb refactor(ng2): deepen settings draft projection for new settings UI (#44)
加深 SettingsWorkflow,让平坦 UI 形状草稿成为编辑态唯一 source of truth,把
字段问题、端口占用事实、保存门禁、脏态、PAC 失效确认与重置确认收进 seam,
为重写设置 UI 提供稳定访问面。

- UI-facing interface 只含 UI 形状投影与 typed command:平坦 SettingsDraft
  (监听范围 = 布尔开关 + 公布地址文本,端口/超时为整数,不含持久化的当前
  模式)、按字段归位的 SettingsFieldIssue(端口问题用端口标识变体,每条载带
  点名文案)、按 SettingsPortID 索引的端口 field state(草稿值/类型化占用
  事实/字段问题/运行中端口例外/可否建议空闲端口)、保存门禁·脏态·提交中·
  失败点名文案投影、统一确认事实 SettingsConfirmation;离散动作走具名 typed
  command(save、reset、suggestFreePort(for:)、confirmPACNotice、
  cancelPACNotice、confirmReset、cancelReset、reloadFromCommitted)。
  module 不依赖 SwiftUI。
- 写入侧收窄为窄 seam SettingsCommitting(已提交快照、代理是否在跑、两个
  提交入口),ProxyRuntimeController 薄扩展即生产实现,测试注入 fake。
- 平坦草稿与 ProxySettings 互转集中在 SettingsDraftAdapter,校验错误归位与
  端口标识映射同属字段清单并收在同文件;Domain 快照类型只出现在后端缝与
  adapter。Domain 点名校验、端口互异/建议算法、PAC 失效判定与占用探测缝
  原样复用,行为不改写。
- 设置视图只绑投影与 typed command:删除 ListenScope 枚举拆装、探测层占用
  翻译、门禁推导与确认文案。重置确认摘要来自 seam 的范围裁定,并补齐重置
  事务的实际范围(全部偏好回出厂值、运行中代理停止);端口互异问题归位到
  冲突双方端口;隐藏的地址残留不再误报未保存修改。

用户可见变化:校验红字改为按字段归位显示;重置确认摘要由 seam 裁定。其余
行为与现状一致。

测试:新增 SettingsWorkflowInterfaceTests(30 项,fake 写入缝 + fake 探测)
覆盖校验归位、端口 field state、运行中端口例外、建议端口、保存门禁、脏态、
PAC/重置确认裁决、提交中与失败点名、占用探测代际;SettingsWorkflowTests
收敛为真实 ProxyRuntimeController 提交路径集成(5 项)。全量 427 项通过。
2026-09-22 22:28:39 +08:00