Commit Graph
40 Commits
Author SHA1 Message Date
Qiu Yuzhou dbb14dcb88 refactor(ui): 服务器分区活动目标标记收为平值入参
ServersView 不再观察 ProxyRuntimeController,与 SidebarRow/
ServerDetailView 的传参先例同法收 activeTargetID: NodeID?;外壳暂仍从
controller 取值,事实源切换随后一提交完成。
2026-10-03 11:44:28 +08:00
Qiu Yuzhou 619121a36c fix(route): decouple sidebar selection write-back from route publish
The same-value guard only stopped same-value selection re-syncs.
After an external navigation (add menu, rule editor dismissal,
manage-servers/show-runtime actions) the sidebar List still held
its stale cached selection and wrote it back into the custom
selection binding during a view update; the resulting publish
warned and would bounce the navigation back. Route the sidebar
selection through a SwiftUI-managed @State with onChange hops in
both directions (selection -> navigate, route -> backfill), anchor
the seed on WorkspaceRoute.initialDestination, and pin the
alignment with a regression test.
2026-10-03 03:38:07 +08:00
Qiu Yuzhou 60cdfc0198 ui: app名称标题使用纸飞机图标 2026-10-03 01:13:53 +08:00
Qiu Yuzhou 17672ff655 feat(rules): add custom rule editor (#79)
Add versioned sheet-local drafts, normalized previews, custom identity validation,
and explicit saves through the existing rule-document transaction. Preserve UUIDs,
builtin memberships, disabled identities, and deployment recovery outcomes.

Include approved Chinese and English editor copy. Verify public Workflow commands,
the production Controller adapter with hostless tests, and compiled bilingual
resources. Visual acceptance remains manual.
2026-10-03 00:47:06 +08:00
Qiu Yuzhou e5de11a5fe perf(rules): share snapshots and reuse commit results 2026-10-02 23:50:59 +08:00
Qiu Yuzhou 63cb42da2a fix(rules): keep enablement feedback stable and accurate (#78)
Reserve one toolbar status area through saving, deployment, and collection
refresh. Show counted transient success and persistent actionable failures,
with distinct applied, unchanged-runtime, and deferred-save results.

Keep cached rows when collection reload fails. Require explicit refresh
and fresh selection after a version conflict.

Validation: 774 hostless tests passed with local ad-hoc signing. Format,
lint, two-axis review, and isolated Chinese/English view rendering checked.
2026-10-02 22:37:02 +08:00
Qiu Yuzhou cb5a535297 feat(rules): simplify details and open conversion reports in a window 2026-10-02 20:38:23 +08:00
Qiu Yuzhou 3db66f5fff feat(rules): add read-only rule browsing (#76) 2026-10-02 17:18:08 +08:00
Qiu Yuzhou 4a0a72c6cf feat: observe and repair system proxy configuration (#73) 2026-10-01 23:29:56 +08:00
Qiu Yuzhou 1c706aa65f feat: redesign home server activation tree
Preserve catalog hierarchy and order, separate selection from activation, and mark active targets and ancestors. Persist independent home expansion preferences and support explicit locate and keyboard navigation.

Show server names only and surface activation eligibility, skipped members, and failures. Refine row status visibility and use semantic selection colors for outlined activation buttons, including hover, pressed, disabled, contrast, and inactive-window states.

Validation: 695 hostless macOS arm64 tests passed for the tree implementation; 7 focused tests and ad-hoc app compilation passed after the semantic button refinement. Format and lint checks passed. Native UI interactions and theme changes remain unverified.
2026-10-01 19:03:48 +08:00
Qiu Yuzhou 2f8c4dbc2a fix(app): keep server tree collapse state across destinations
Both server trees held collapse state inside the destination
subtree — ServersView relied on OutlineGroup's built-in expansion
state and the home target tree kept a local @State set — so every
destination switch destroyed it. Hoist a shared
CatalogExpansionState to the composition root; the servers sidebar
and the home target tree now read and write one collapse set.

ServersView replaces OutlineGroup with a manual collapse tree
(flattened visible rows, .tag keeps List selection), trading away
OutlineGroup's arrow-key expand/collapse. MainApp extracts
makeRuntimeController to stay within the function-body lint budget.
2026-09-30 21:50:09 +08:00
Qiu Yuzhou 5aad79e41f feat(ui): simplify sidebar proxy status card 2026-09-29 21:13:34 +08:00
Qiu Yuzhou 9284b1c9a1 feat: export configuration groups as SIP-008 JSON 2026-09-29 20:16:05 +08:00
Qiu Yuzhou 8b698a0bf1 feat(app): adaptive app form with window-following activation policy
- switch to regular while the workspace window is open (Dock icon,
  app switcher, default menu bar) and back to accessory when it closes;
  driven by NSWindow didBecomeKey/willClose with an anchor-view identity
  filter (scenePhase follows the app rather than windows on macOS, so it
  fires no event on close)
- add silent launch preference (settings-general, off by default,
  persisted in its own silent-launch.json since settings.json is rewritten
  whole from the controller's in-memory snapshot): suppressed launches
  keep the menu-bar baseline and proxy runtime restoration is unaffected
- docs: CONTEXT.md adaptive app form / silent launch terms and invariants;
  ADR 0017 superseding 0016 (scene-based model and reopening carry over)
2026-09-29 15:13:30 +08:00
Qiu Yuzhou a668340a97 fix(ui): adjust safe area inset spacing for header and status card 2026-09-28 20:52:27 +08:00
Qiu Yuzhou 005f4db63b fix(ui): adjust sidebar column width for better layout 2026-09-28 20:48:47 +08:00
Qiu Yuzhou 3108b3ad5a fix(ui): place add menu in sidebar toolbar 2026-09-28 19:36:53 +08:00
Qiu Yuzhou 0d0e74d59c feat(ui): menu-bar-only form with scene-based main window
Replace the hybrid form (LSUIElement + runtime activation-policy
switching + AppKit-owned NSWindow) with a plain SwiftUI Window scene:
the app stays accessory at all times, launch presents the workspace
window via defaultLaunchBehavior(.presented), and the status menu
reopens it after close via openWindow. Drop AppDelegate and the
window-opening adapter and intents; WorkspaceRoute keeps navigation
state only, with the scene id defined there. Documented in ADR 0016
and CONTEXT.md.
2026-09-28 19:18:27 +08:00
Qiu Yuzhou 4f67c4a73c fix(ui): align add menu with sidebar toggle 2026-09-28 12:44:56 +08:00
Qiu Yuzhou 63e33724f7 feat(ui): consolidate workspace add actions 2026-09-28 11:45:58 +08:00
Qiu Yuzhou 67ced2674a fix(ng2): use canonical app name 2026-09-28 10:24:06 +08:00
Qiu Yuzhou 398e8d84b6 feat(ng2): split agent and system proxy switches
实现 #60(ACL 1/8):agent 意图与系统代理意图拆为两个独立开关,
首次运行默认 agent 开、系统代理关;显式关闭 agent 持久化并在 GUI
重启后生效;关闭系统代理只恢复 NG2 持有的系统设置,本地 SOCKS/HTTP
继续监听;关闭 agent 先恢复系统设置再停止监听。无活动目标时 agent
以空服务器列表契约提供本地监听(isWellFormed 放行空 servers,上游
sslocal v1.25.0 接受);需要代理出口的模式在活动目标缺失或端点不健
康时系统代理保持待应用,条件恢复后随下次收敛自动应用。首页、状态菜
单与侧栏状态卡经同一代理控制快照展示/操作 agent 意图/运行状态与系
统代理意图/实际应用及 typed 错误。测试覆盖启动顺序、持久化、健康门
禁、ownership 冲突、无效活动目标与 GUI 重同步(含真实 sslocal 空监
听回环证据);替身测试不表述为真实系统写入验证。
2026-09-26 00:38:28 +08:00
Qiu Yuzhou 2400c7c81d feat(ng2): window title follows active destination
- window.title tracks the destination via composition-root wiring
  into WorkspaceWindowOpeningAdapter.bindTitle; drop the static
  "ShadowsocksX-NG 2.0" title
- delete the 28pt shell destinationHeader; subscription and
  diagnostics actions move into the unified toolbar
- settings save/reset stay with the form as a top action row in
  SettingsView; form-level commit actions read wrong in a toolbar
2026-09-25 03:18:59 +08:00
Qiu Yuzhou f7edceee30 feat(ng2): restyle diagnostics and move export to header (#58)
摘要卡(代理状态/活动目标,来自 DiagnosticsWorkflow.summary 安全投影)+
日志卡(来源 segmented + 复制 + 等宽日志区与空态)+ 脱敏说明行;状态摘要
侧栏删除;导出诊断迁分区头(DiagnosticReportExportAction 入口不变,「诊断
已导出」alert 移至壳层);分区包装视图归位 WorkspaceDestinations.swift。

地图 #52 · 票 #58;五分区 hermetic 冒烟验收通过,task build + test 全绿。
2026-09-24 19:37:16 +08:00
Qiu Yuzhou 1d34c0b3b3 feat(ng2): regroup settings into card sections with header actions (#57)
常规/代理端点/高级三张分组卡,行式「主文案 + 次说明 + 行尾控件」;监听范围
改 segmented + 「不会自动换端口」徽标,LAN 警告与防火墙指引保留;端口行
issues/占用/建议空闲端口不变;保存/恢复默认迁入分区头(确认弹窗仍由本视图
alert 呈现);保存失败横幅置代理端点卡顶,dirty/占用提示置高级卡尾。

地图 #52 · 票 #57;task build + test 全绿,hermetic 冒烟通过。
2026-09-24 19:35:40 +08:00
Qiu Yuzhou f556c5fdb6 feat(ng2): rework subscriptions into cards with header actions (#56)
每订阅一卡片:图标 + 名称 + 地址隐藏副题 + 状态徽标三态(已同步/刷新失败/
尚未刷新)+ 更新/重试 + 「…」菜单(编辑 URL/删除);三列元数据(固定分组/
服务器/上次成功刷新)+ 失败详情行 + 脱敏说明行;失败卡警告色描边。底部操作
栏移除,添加订阅/更新全部迁入分区头动作槽位(sheet 与错误呈现由壳持有)。

地图 #52 · 票 #56;task build + test 全绿。
2026-09-24 19:34:03 +08:00
Qiu Yuzhou 75de3fbac9 feat(ng2): add home view with mode, target tree and quick actions (#54)
代理模式卡(PAC/全局 segmented + 说明 + 当前徽标,走 snapshot 可用模式)、
当前服务器卡(只含有服务器的分组,双击激活,活动目标勾选与无效警示)、
快速操作卡(更新全部订阅、复制终端 HTTP 导出行);Legacy 首启询问保留。

地图 #52 · 票 #54;task build + test 全绿,hermetic 冒烟通过。
2026-09-24 19:30:49 +08:00
Qiu Yuzhou 678bea6d3b feat(ng2): rebuild main window shell with sidebar navigation (#53)
NavigationSplitView 侧栏:五项导航与 WorkspaceRoute 双向绑定 + 服务器/订阅
行尾数量角标;底部常驻代理状态卡与状态菜单同口径(ProxyControlWorkflow
snapshot 经 StatusMenuModel.summary);分区大标题外壳与动作槽位。
ServersView 内层 NavigationSplitView 换扁平双栏(#55 再重排)。

地图 #52 · 票 #53;task build + test 全绿,hermetic 冒烟通过。
2026-09-24 19:29:08 +08:00
Qiu Yuzhou a70165f5fb feat(ng2): isolate clipboard and diagnostic export effects (#51) 2026-09-24 13:32:15 +08:00
Qiu Yuzhou 0a1aa9a725 feat(ng2): add workspace route module 2026-09-24 09:45:08 +08:00
Qiu Yuzhou cdf1c8ab8f refactor(ng2): deepen catalog policy into workflow seam
New UI must bind projections and send typed commands only.
Views were re-deriving delete confirm, move destinations,
activation eligibility, and drag payload from domain state.

Empty manual-group delete is no longer instant — always one confirmation.
2026-09-22 20:41:18 +08:00
Qiu Yuzhou fd9be86149 refactor(ng2): add diagnostics workflow module as single UI-facing seam
诊断区收敛为 DiagnosticsWorkflow 深 module(Candidate 03,issue #43):事实
采样、轮询代际、raw 日志投影、报告准备与导出完成登记集中一个 seam,视图只
负责生命周期触发、呈现、剪贴板、保存面板与报告文件写入。侧栏与详情共享同
一份安全摘要;收集只读,不触碰目录、凭据、runtime 与系统代理设置。

目录不再把原始 ConfigurationCatalog 写入诊断快照:CatalogWorkflow 只输出
domain-neutral 聚合事实(计数 + 已知无效数),报告 builder 只接受已裁剪的
report facts。事件导出改为显式白名单派生(diagnosticReportLine):自由
detail、主机公布地址与 runtime 错误原文一律清洗,数量/端口/领域点名原因
保留;新增事件漏 case 无法编译。raw GUI 事件行与 wrapper agent.log 尾部仅
经显式查看/复制提供,永不进入报告(ADR-0006)。导出完成事件只在用户选择的
文件实际写入成功后登记。

RuntimeEventStore 事件改为携带封闭枚举原值,渲染发生在呈现边缘(白名单清
洗只可能作用于原值)。测试:新增 workflow interface 覆盖投毒导出、白名单、
raw/报告分离、缺失标注、只读、代际覆盖与取消;ADR-0006 与 CONTEXT.md 术语
同步入库。
2026-09-22 19:22:31 +08:00
Qiu Yuzhou 46ebe1d835 feat(ng2): simplify Legacy import and isolate default ports (#42) 2026-09-22 14:26:58 +08:00
Qiu Yuzhou 2fe401cd50 feat(ng2): add catalog workflow module as single UI-facing seam (#41)
建立目录工作流深 module(App/CatalogWorkflow/),收窄主窗口与配置 UI 对
配置目录、凭据存储、订阅快照、Legacy 导入与运行时收敛的访问:

- UI-facing interface:非敏感树/编辑面/订阅 projection、opaque NodeID 查询、
  typed command(ServerEditDraft 等)、typed error 与 structured outcome
  (BatchImportOutcome 逐行点名、RemovalOutcome selection invalidation);
  秘密值只在显式编辑/分享/订阅 URL 命令中出现。
- 服务器编辑:配置与凭据作为一个逻辑变更,CredentialWriteJournal 保证目录
  持久化失败时旧配置与旧凭据都保持有效(story 12/13,含测试)。
- 提交与收敛分离:目录提交成功与 runtimeSync 收敛阶段是独立观察面,运行时
  失败不回滚已提交目录(story 38/39,含测试)。
- 订阅:创建/刷新/换址/删除沿用原子快照、last-good 保留与凭据回滚;卡片
  projection 只含 host,结构化刷新状态由呈现层本地化。
- Legacy 导入端到端编排:不驱动运行时收敛、不自动重复、显式再导入创建独立
  分组;handoff 仍经组合根注入的独立边界。
- Deletion test:删除 CatalogViewModel/Types/+Subscriptions 旧 facade,全部
  视图与状态菜单迁移到新 seam;选择、pane、sheet、alert 状态收归 UI 持有
  (ErrorAlertPresenter)。导入失败行以行号点名,不再回显 ss:// 行内容。

测试经 module interface 观察(395 项全部通过):持久化失败凭据回滚、提交/
收敛阶段分离、收敛失败不回滚、导入不触发运行时等新增场景;既有 Domain、
协调器与运行时测试保持不变。

Out of scope(spec #41):设置编辑、ProxyRuntimeController、Legacy handoff、
新视觉设计、独立编译 target。
2026-09-22 11:39:07 +08:00
Qiu Yuzhou ea801d5f38 feat(catalog): remove node enable state
Migrate legacy enabled fields to v3 without preserving their semantics.
Keep recoverable invalid imports visible and filter them during activation.
2026-09-22 08:40:13 +08:00
Qiu Yuzhou 8d1cdf27d1 feat(ng2): Legacy 交接第二阶段(#37)
与导入分离的「切换到 2.0」确认流程(spec #21 D12):

- Domain/LegacyHandoff:硬编码白名单三个 Legacy label(.local/.http/.kcptun),
  bootout 按 service target(覆盖 plist 缺失错位形态),print 退出码验证
  (0/113),`launchctl kill SIGTERM` 有文档后备,绝不泛匹配、不 pkill;
  残留 plist(含 KeepAlive 形态)读内容判活跃性后 disable,阻止下次登录复活;
  系统代理按特征值判定归属(Legacy 自身 off 模式的判定镜像:本地 PAC URL
  http://localhost:<port>/proxy.pac、SOCKS/HTTP 地址端口),仅清理归属为
  Legacy 的服务,未知所有者点名保留;端口释放门禁用无复用选项的 bind 探测
  (Legacy ss-local 带 --reuse-port),未释放不启动 2.0;Legacy 数据零删除。
- App 层:SystemConfigurationLegacyProxyCleaner(授权在最前、失败零影响、
  事务回滚);WorkspaceLegacyAppController(共享 bundle id 需排除自身进程);
  LegacyHandoffSheet 确认/进度/报告呈现,含旧登录项人工指引与残留提示;
  主窗口工具栏入口 + 导入完成后「切换到 2.0」入口;交接成功经正常启停入口
  启动 2.0(健康门禁走 #29 路径)。
- bootout 实弹验证(Further Notes #5)闭环:docs/research/
  legacy-handoff-bootout-live-fire.md——bootout 未加载 label 退出码为 3
  (非 print 的 113),KeepAlive 残留 kill 后复活、bootout 后不再加载,
  结论已回写产品代码与测试。
2026-09-21 12:49:49 +08:00
Qiu Yuzhou 8ec4a57deb feat(ng2): import Legacy configuration (#36) 2026-09-21 11:27:05 +08:00
Qiu Yuzhou 0ecca53a20 feat(ng2): subscription fetch, snapshot semantics and UI (#35)
SIP-008 v1 + x_shadowsocksx_ng extension parsing with flat fallback;
HTTPS/Content-Type gated fetch seam; atomic snapshot commits carrying
only the local enabled overlay; URL edit keeps identity; recursive
delete clears source, fixed group, members and credentials; subscription
cards pane and menu-bar update-all wiring.
2026-09-21 06:15:52 +08:00
Qiu Yuzhou a6825aaafa feat(ng2): diagnostics log viewer and redacted export (#34)
主窗口诊断区(spec #21 D5/D11):

- RuntimeLog 增加事件接收缝,GUI 侧接入 RuntimeEventStore 内存环形缓冲
  (容量 500),wrapper 侧不变(stderr → agent.log 收敛)
- 主窗口侧栏新增「服务器/诊断」分区切换;诊断区日志查看器双源:GUI 事件
  实时呈现 + agent.log 尾部(1s 轮询),均可复制
- DiagnosticReportBuilder 显式触发的脱敏诊断导出:只含状态、存在性、权限、
  大小/时间、数量与脱敏元数据;不读 Keychain 与契约/目录内容;原始错误
  detail 不入导出,家目录前缀改写为「~」;服务器地址与备注不进入任何输出
- 投毒夹具测试验证导出不含任何敏感类目(密码/插件参数/地址/备注/token/JSON)

Closes #34
2026-09-20 22:41:28 +08:00
Qiu Yuzhou 60a31b5df3 feat(ng2): main window server tree, ss:// codec and QR share/import (#32)
主窗口服务器分区(D11,issue #32):NavigationSplitView 分组树(订阅子树
只读、仅启用开关;行内 checkbox;右键激活/启停/重命名/新建分组/移动/删除,
非空手动组二次确认;拖拽移动,跨来源拒绝;空组保留可编辑)、服务器详情
表单(插件区只读展示「本版本未提供」状态)、分组详情。添加三入口(剪贴板
ss://、导入 URL、二维码图片识别:文件选择 + 拖图入窗)共用批量导入落点,
每次新建身份不去重;分享区二维码弹窗 + 复制 ss://。SsUri 按 SIP002 编解码
(含 legacy base64 兼容、SIP022 明文 userinfo、IPv6、插件 name;opts 逐字节
同构),二维码走 CoreImage 生成 + Vision 识别。目录提交后接 postCommit 钩
子,代理运行时立即重展开(#27 catalogDidCommit)。
2026-09-20 21:37:38 +08:00