wangjia
4f9d2d2cf3
fix(client): 补提交 stats-overhaul 漏掉的 account_api/kernel_process WIP
...
同 device_usage:account_api.dart(deviceUsage/usage 方法)、kernel_process.dart
及对应测试一直未提交,本地有→analyze/test 过,但不在 git→Windows 构建报
「deviceUsage isn't defined」。补齐使提交树自洽可构建。
孤儿组件 device_stat_row/metric_card 已无人引用,不提交。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-28 17:53:56 +08:00
wangjia
a7c3795e5a
fix(client): 补提交漏掉的 device_usage 模型 + 测试(Windows 构建缺文件)
...
device_usage.dart 一直是 untracked(stats-overhaul WIP 漏提交),本地有所以
analyze/test 过,但不在 git → bundle → Windows 构建报「找不到 device_usage.dart /
DeviceUsage isn't a type」。account_providers/account_api/golden 测试都引用它,补提交。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-28 17:51:25 +08:00
wangjia
01ebafc05e
feat(client/stats): 统计页重设计 — 月/周/日周期卡 + 设备下拉 + 两周折线 + 修刷新
...
布局重做(对照确认稿):
- 3 张周期卡(本月/本周/今日),每张 = ↓下行 · ↑上行 · 使用时长(PeriodCard)
- 右上设备下拉(_DeviceDropdown,先只挂「全部」;每设备归因打通后填设备名,见 TODO #9/#10)
- 柱状图 → 折线图:最近两周(14 天)按天流量(UsageLineChart,CustomPainter 零依赖)
数据源统一 + 修刷新(根治「本月流量冻住」):
- 月/周/日 + 折线全从单一源 usageProvider(30) 聚合(取最后 N 天点求和,末点即今日,
避开 UTC/本地日期坑);不再 me.weekly + usage 两条管线
- usageProvider/deviceUsageProvider 改 autoDispose(进页重取)+ 下拉刷新(invalidate)
+ 刷新连带 meProvider.refresh。后端每 60s 更新,无需更勤
UI 全走 PangolinColors/Text/Spacing token 单源、零硬编码;中英 l10n key 补齐。
widget 数值断言测试(刀1)按新结构重写并通过;统计/连接页 golden 重生成
(非 CI 闸;components/auth 基线未动)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-28 17:43:14 +08:00
wangjia
855d9e0e30
feat(client): 连接页桌面节点胶囊(_NodePill)加地域国旗
...
桌面连接页「已连接」下的节点框是 _NodePill,此前只有文字「节点名·延时」+
智能选择 zap,无国旗。在地域前加 CountryCode(size 20)国旗(无效码回退码块),
智能选择时国旗 + zap 并存。手机/平板的 _CurrentNodeCard 本已有旗。
桌面连接页非 golden 覆盖(含旋转动画),无 golden 变更。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-28 16:32:24 +08:00
wangjia
8eb7d04fe1
feat(client): 节点地区图标改国旗(SVG 填满裁切),未知码回退码块
...
CountryCode 由 2 字母码块改为渲染真国旗:country_flags 包按 region 码出 SVG
旗(BoxFit.cover 填满裁切),全平台含 Windows 都显示(emoji 国旗在 Windows
不渲染,故走 SVG)。FlagCode 判定无效码(AUTO/占位/非地区码)时回退原码块;
选中态由 accent 底色改为 accent 边框环。
CountryCode 共享于节点列表/连接页/统计页,故三处节点图标统一变国旗,
对应 tablet_servers/connect/stats + desktop_stats golden 已 Mac 重生成
(这些页非 CI golden 闸;CI 闸的 components/auth 基线未动)。
依赖:country_flags ^3.1.0(解析 3.3.0)。analyze 干净,非 golden 测试全过。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-28 16:25:48 +08:00
wangjia
76dbdcfa83
test(client): L2 点连接能连上 流程 + ConnectApi 注入(支柱1)
...
- connection_provider:加 connectApiFactoryProvider(原内部 new ConnectApi 改成
可注入工厂,支柱1 接缝即接口)——默认行为不变
- test/unit/flow_connect_test.dart:真 toggle → fetchConfig(注入 MockClient 回占位
config)→ bridge.start → statusStream 确认 → on → 再 toggle → off;
验证「非乐观翻转」红线(on 必由 bridge 确认)
- 全量 unit/widget 47 全过(重构不破坏)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-25 12:13:40 +08:00
wangjia
cb6fc25bc9
test(client): L1 数值格式化纯函数单测 + 从 widget 抽出(支柱3)
...
- lib/util/format.dart:抽出 formatSpeed/formatDuration(原私有于 connect_page
_speed / connect_button _fmt,混在 widget 里没法单测)
- connect_page/connect_button 改用公共纯函数(渲染输出不变)
- test/unit/format_test.dart:10 用例覆盖速率 B/s→GB/s 各单位边界 +
时长 HH:MM:SS 补零/小时不封顶/取模 60
- 验证:format 10 + widget 8 全过、analyze 无 error/warning
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-25 12:06:34 +08:00
wangjia
64f96fe018
refactor(api): /v1/me 收敛 expire_at → 只发 expires_at(无 web 用户中心)
...
之前后端同时发 expire_at + expires_at(分别给 app + web 用户中心)。现已无 web 端,
双发是纯冗余,统一只用 expires_at:
- account.go:meResponse 删 ExpireAt 字段 + GetMe handler 不再赋值
- client me.dart:fromJson 删 (expires_at ?? expire_at) 别名回退
- 两端契约快照同步:Go meResponse 冻结集去 expire_at(12→11 key)、删 Dart 别名测试
- 验证:go test httpapi 绿、flutter test contract(14)绿、analyze EXIT 0、e2e 全链路绿
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-25 10:08:50 +08:00
wangjia
dbd183ee00
fix(ci): 修 flutter analyze 闸长期 exit 1(形同虚设)
...
发现:CI flutter analyze 退出码 1(1204 个 info,0 error/warning),其中 1191 来自
第三方 vendored 包 lucide_icons_patched —— 这道闸一直红/无效。
- analysis_options.yaml:exclude packages/lucide_icons_patched/**(去 1191 噪音)
- ci.yml:flutter analyze --no-fatal-infos(info 是建议级不该硬挡 merge;
error/warning 仍致命)→ analyze EXIT 0、闸真正可用
- 顺手清 11 个 clean 文件 info:auth_api 删 >>>AUTHLOG 调试 print 残留(+unused sw)、
account_page/plan_card withOpacity→withValues、vpn_bridge where(is Map)→whereType、
测试文件删多余 import + final→const
- 剩 2 个 info 在 stats-overhaul dirty 文件(stats_page/device_stat_row),留其合并清
- 验证:flutter analyze --no-fatal-infos EXIT 0(1204→2)、flutter test 48 全过
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-25 07:39:14 +08:00
wangjia
62925a6886
Merge worktree-windows-icon-tray-fix: Windows 桌面/托盘/任务栏图标 + 关窗不断连接
...
- 关窗(X/Alt+F4)隐藏到托盘并保持隧道,真退出只走托盘菜单(Platform.isWindows 隔离)
- 窗口标题设「穿山甲」(无 VPN 字眼)
- Windows 托盘改用 .ico(Win32 只认 ico,PNG 空白),mac/Linux 仍 PNG
- 更新 app_icon.ico / tray_icon.ico / Runner.rc / installer
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-23 10:54:23 +08:00
wangjia
e4db3beba6
Merge branch 'main' into feature/pangolin-ios
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
# Conflicts:
# client/lib/bridge/vpn_bridge_provider.dart
# docs/index.html
2026-06-23 10:05:20 +08:00
wangjia
e25649cd27
feat(client/ios): iPad tablet 正式适配——断点≥900 对齐设计源 + tablet golden 回归闸
...
- form_factor 触屏 tablet 阈值 600→900,对齐 design/ui_kits/tablet(1180×820 横屏
侧栏):iPad 横屏/12.9″竖屏走侧栏,标准/11″竖屏回落 mobile 底 Tab,避免双栏挤压
- form_factor_test 补全断点边界(900/899)与各 iPad 尺寸用例
- 新增 tablet_pages_golden_test:四视图×明暗×中英 12 张 golden,注入演示数据
(6 节点/周流量/30 天用量)让 2 列网格与周柱满渲染,作回归闸
- design/CONTRACT.md:tablet 像素契约(取自 tabapp.jsx)+ 逐屏验收清单
- 真机 iPad mini 6 视觉签核通过;141 测试全绿
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-23 10:00:14 +08:00
wangjia
bd984feff9
fix(client/ios): iOS 接通原生隧道——切真桥 + save-before-start + DNS matchDomains
...
根因:iOS 端 vpn_bridge_provider 把 iOS 归入'其他平台 → VpnBridgeMock',
整个 App 用假桥,伪造已连接状态与写死的 URLTest 延迟(18/32/54ms),从不调用
B1/C1 打通的原生 NEPacketTunnelProvider。表现为 UI 显示已连接但流量全直连
(apple 通/google 被墙、RTT 20ms),设备日志无任何隧道/sing-box/节点痕迹。
三处修复:
1. vpn_bridge_provider.dart: iOS → VpnNativeBridge(真原生 MethodChannel)。
2. VpnManager.start(): 先 saveToPreferences+重载(首启触发系统授权、持久化配置)
再 startVPNTunnel,否则对未持久化 manager 调用抛 NEVPNError。对齐 macOS。
3. PacketTunnelProvider.openTun: DNS 补 matchDomains=[""],强制所有 DNS 走隧道,
iOS 不设会把隧道 DNS 当补充解析器、查询仍走系统直连 DNS 致污染打不开站点。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-23 00:28:53 +08:00
wangjia
82741ce0c4
feat(android): Dart provider 接 Android→VpnNativeBridge(Task 4)
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 18:48:58 +08:00
wangjia
5ea4e1ae03
fix(client/windows): 任务栏图标 + 关闭窗口不再断连接
...
- 关闭窗口断连接:onExitRequested 原先无条件 _teardownVpn 再退出;Windows 点 X
会触发该回调拆隧道,而 window_manager 的 preventClose 又把窗口仅隐藏到托盘
→ 出现「一关就断网、进程还在」。改为 Windows 下点 X/Alt+F4 取消退出+隐藏,
保持隧道;真正退出只走托盘「退出」(onBeforeQuit 标记 _isQuitting 再拆隧道)。
macOS Cmd+Q 仍正常拆隧道退出。
- 任务栏图标没换:仅靠 WNDCLASS.hIcon(LoadIcon 单尺寸)任务栏可能拿不到正确
尺寸。窗口创建后用 LoadImage 按系统 SM_CXICON/SM_CXSMICON 各取一份,
WM_SETICON 显式设 ICON_BIG(任务栏/Alt-Tab)+ ICON_SMALL(标题栏)。
- 版本 1.0.1 → 1.0.2。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 17:53:34 +08:00
wangjia
94993b21b4
fix(client/windows): 修桌面/标题栏图标 + 标题文案 + 系统托盘空白
...
- app_icon.ico 重新由 assets/app-icon.svg 生成(穿山甲品牌图标,多尺寸),
替换残留的默认 Flutter logo —— 同时修好桌面图标与标题栏小图标。
- 窗口标题去掉 "VPN" 字眼:main.cpp 原生标题 pangolin_vpn → Pangolin;
main.dart 用 windowManager.setTitle('穿山甲') 显示中文品牌名;
Runner.rc 的 FileDescription/InternalName/ProductName → Pangolin。
- 系统托盘空白:Windows 走 Win32 Shell_NotifyIcon 只认 .ico(传 PNG 显示空白),
新增 BMP 编码的 assets/tray_icon.ico,system_tray.dart 按平台选 ico/png。
- 安装包版本 1.0.0 → 1.0.1(pubspec 1.0.1+2)便于区分测试构建。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 17:06:05 +08:00
wangjia
ac0fc774cb
Merge branch 'main' into feature/windows
2026-06-22 14:17:19 +08:00
wangjia
322d806876
fix+build(client/windows): 复查修缮——一键构建脚本 + 修 README dart-define 漏项 + 清 lint
...
- 新增 client/windows/build.ps1:拉内核→带 --dart-define 构建→出安装包一键串联,
规避 Release 漏 --dart-define 导致默认连 localhost、登录「网络请求失败」的坑。
- README:Release 命令补回 --dart-define 并加显式警告,指向一键脚本。
- 清 4 个 lint warning:desktop_vpn_bridge 多余 cast→pattern match、去多余非空断言;
nav_sidebar 删未用 import;vpn_bridge_mock 加 killSwitchEnabled getter。
- 同步 window_manager/tray_manager/screen_retriever 插件注册生成文件(win+macos)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 14:17:13 +08:00
wangjia
7e7854427c
docs(client): 修订 pangolin_theme 字体注释(改本地打包后过时描述)
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 07:51:58 +08:00
wangjia
6fc032bac8
feat(client): 字体改本地打包(拉丁全量 + Noto Sans SC GB2312 子集)
...
生产 PangolinFonts.useBundled=true,离线可用,不再运行时拉 google_fonts;
中文经 fontFamilyFallback=[Noto Sans SC] 兜底,子集外字符再兜系统 CJK 字体。
- 拉丁:Sora/Manrope/JetBrains Mono 静态权重(复用 test/fonts)。
- 中文:Noto Sans SC 变量字体 instance 到 Regular + subset 到 GB2312 6763 字
(单权重,粗体引擎合成),client/fonts 合计约 3.4MB。
- tools/fonts/make-cjk-subset.sh 可复现生成(GB2312 字表无需联网)。
- 新增 test/unit/fonts_test.dart 锁定接线;golden 因 notdef 占位字形微调已更新。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-22 07:48:21 +08:00
wangjia
14498a3ccd
feat(client/desktop): 设定窗口默认 920x640 / 最小宽 720
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-21 23:02:43 +08:00
wangjia
447f3f494e
feat(client/macos): P1 原生隧道——PacketTunnel 系统扩展可加载 + libbox 运行
...
经长链路排查(同机对照可工作的 Tailscale),修复 macOS 系统扩展 realize
失败(OSSystemExtensionErrorDomain code=4)与 libbox 运行时崩溃,使内嵌
sing-box 的系统扩展能在 macOS 15 上激活并启动隧道。
系统扩展 realize(三个叠加根因):
- 扩展自包含:PacketTunnel 加 OTHER_LDFLAGS="" 切断对项目级 CocoaPods 链接
标志的继承(原会把 flutter_secure_storage 链进扩展);Libbox.xcframework
改纯 Link(静态),从 Embed Frameworks 移除冗余内嵌
- bundle 名 = 标识符:PRODUCT_NAME 设为 com.pangolin.pangolin.PacketTunnel
- 扩展 Info.plist 补 NSSystemExtensionUsageDescription(网络扩展类别强制要求)
- App Group 改 macOS 原生格式 BYL4KQHMTN.com.pangolin.pangolin;NEMachServiceName
以其为前缀;扩展补 network.client/server;get-task-allow=false + 签名加 --timestamp
- CFBundleVersion 随构建递增(否则 sysextd 视为同版本不更新)
libbox 运行时:
- startOrReloadService(options:) 传 nil 致空指针 SIGSEGV → 传 LibboxOverrideOptions()
- 默认接口监控阻塞到首个 path 更新再返回,修 "no available network interface"
配套:
- scripts/local_test.sh:build/sign/notarize/copy/run 一条龙(Developer ID + 公证)
- client/macos/sign_libbox.sh:构建期以 Developer ID 重签内嵌 Libbox
- VpnChannel:401 自动刷新 token、详尽 os_log;auth/api 统一走 kApiBaseUrl
- docs/macos-sysext-realize-troubleshooting.html:完整踩坑复盘
WIP / 临时(后续清理):
- 隧道运行时仍在排查:剥离远程 rule-set 后 sing-box 启动卡点未定位
- 含临时诊断代码:main.swift stderr 重定向、box.log 输出、rule-set 剥离、debug 日志
- api_config 仍指向联调节点,发版前还原
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01JEHzjEcFzvGwgbxT6Wbt6c
2026-06-21 21:18:33 +08:00
wangjia
43b25c8aa0
feat: 国内流量直连分流(geoip-cn / geosite-cn)— #5
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
国内 IP/域名直连(不走隧道)→ 省流量 + 国内访问快;非国内走代理。
- clientconfig.go: BuildClientConfig 加 ClientConfigOpts{SplitCN,RulesBaseURL};
开启时 route 加 {rule_set:[geoip-cn,geosite-cn]→direct} + 定义 rule_set
(remote .srs,download_detour:direct 直连下载)
- rules.go: 控制面静态服务 /v1/rules/{name}.srs(白名单防穿越)——自托管避免
GitHub 在国内被墙的鸡生蛋;客户端反正连控制面,可达性有保证
- nodes.go ConnectNode: 读 ?split_cn → opts;NodeAPI 加 rulesBaseURL
(PANGOLIN_PUBLIC_URL);main.go 挂 /v1/rules 路由 + RulesHandler
- 客户端: connect_api splitCN→?split_cn=1;connection_provider 传 smartRoute 偏好
- deploy/single-node: 拉 geoip-cn/geosite-cn.srs 到 $DATA_DIR/rules +
设 PANGOLIN_PUBLIC_URL/PANGOLIN_RULES_DIR
验证:go test(splitCN 开/关渲染 + RulesHandler 白名单/404)+ flutter analyze +
shellcheck;不需要节点。订阅链接暂用默认 opts、DNS 分流为后续增强。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 20:34:00 +08:00
wangjia
b25c8bbc2c
feat(client/macos): P1 方案B 骨架 — System Extension + NETunnelProviderManager 接线
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
把 PoC 的 sudo sing-box 外部二进制换成自包含、免 root 的 NEPacketTunnelProvider
(System Extension)+ 嵌入 libbox 的生产架构铺好骨架(不破坏现有 PoC 构建)。
- PacketTunnel/:扩展 target 源 — PacketTunnelProvider(LibboxSetup→NewService→start,
openTun 建 NEPacketTunnelNetworkSettings)、Info.plist(NEProviderClasses)、
entitlements(packet-tunnel-provider-systemextension + App Group)
- Runner/VpnChannel.swift:主 app 经 NETunnelProviderManager 启停 + 状态/速率回传,
对齐 Dart 侧 VpnNativeBridge 的 pangolin/vpn channel 契约
- vpn_bridge_provider.dart:kUseNativeVpnMacOS 开关(默认 false,联调通过后置 true)
- docs/p1-macos-system-extension.md:文件清单 + Xcode/签名步骤 + 待办
(Team BYL4KQHMTN;Network Extensions 已确认自助开通、无需 Apple 审批)
非破坏:新源文件未入 build target、注册行/app-group entitlements 均注释、gate 默认 false。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 11:07:36 +08:00
wangjia
3f62d54d23
fix(client): 关窗口缩托盘不退出 + 单实例(一机一进程)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- 关窗口托盘也消失:根因是 AppDelegate.applicationShouldTerminateAfterLast
WindowClosed 返回 true → 关窗口即终止 app。改 false:关窗口只隐藏到托盘
(配合 window_manager preventClose+hide),app 留在托盘。
- 单实例:main 启动先 ensureSingleInstance()——loopback 47654 端口锁;已有实例
时连过去唤起其窗口显示,本进程 exit(0)。保证一机仅一个 pangolin 进程,
重复启动只会前置已有实例。
flutter analyze 0 error;测试通过。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 09:34:12 +08:00
wangjia
31443d0fe7
fix(client): 退出 Pangolin 时拆隧道(停内核),不再残留 sing-box/TUN
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
此前真退出(托盘退出 / Cmd+Q)走 windowManager.destroy(),从不先停内核,
而 sing-box 是 sudo root 子进程不随父进程退出 → 孤儿 + TUN 残留,得手动 pkill。
- system_tray:托盘「退出」前 await onBeforeQuit()(停内核)再 destroy。
- main:PangolinApp→ConsumerStatefulWidget,AppLifecycleListener.onExitRequested
在 Cmd+Q 时先停内核再退;_teardownVpn 调 vpnBridge.stop()(SIGTERM→sing-box,
拆 TUN),带 3s 超时兜底。
- 关窗口→隐藏托盘的路径不拆(保持连接,符合常驻语义)。
flutter analyze 0 error;116 tests passed。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 09:21:22 +08:00
wangjia
7827660a36
fix(client): 登录页 tab 滑块塌陷 + 滚动弹性(design-distill 校准)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- 胶囊 tab 活动滑块高度塌成 0(FractionallySizedBox 缺 heightFactor)→ 活动态
不可见、和背景糊一起。补 heightFactor:1.0,滑块正常填满。
- 列表无弹性回弹:SingleChildScrollView 改 ClampingScrollPhysics,大窗口放得下
就不滚(无上下拖动/滚动条),仅窗口过矮才滚。
- 加 auth_redesign golden(900x700 明/暗),按 design-distill 截图 diff 校准:
与原型 design/preview/auth_redesign.html 对比,结构/位置/尺寸零偏移
(残余差异为 headless 测试缺 CJK 字体的豆腐块,真 app 字体正常)。
flutter analyze 0 error;测试通过。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 08:25:56 +08:00
wangjia
9de3a6c743
feat(client): 登录/注册页重设计(居中卡片 + 暖光晕)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- auth_screen.dart 整体重排:暖色径向光晕背景 + 居中卡片;hero 用 clay 渐变
app-icon(带光晕)+ 品牌 + 标语;胶囊分段 tab(滑块)替下划线;输入框聚焦态
(accent 边 + ring 光环);主按钮微光;进入错落淡入动效。全部走 token。
- 注册第二步:已验证邮箱胶囊 + 「改邮箱」返回 + 设密码;验证码框无占位点。
- 逻辑零回归:登录/注册两段式、发码、邮箱预填、密码显隐、错误提示全保留。
- design/preview/auth_redesign.html:HTML 视觉原型(评审用,不进构建)。
flutter analyze 0 error;114 tests passed(auth 不在 golden 集,无 golden 变化)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 08:10:33 +08:00
wangjia
dfc2df90c7
fix(client): 连接后延迟未探测时回退节点 TCP 探针(尽量不显示 —)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
连上后 urltest 头几分钟还没探过会显示 —;现回退用节点页的 TCP 探针 ping
(连接前测得、~真实 RTT),urltest 出值后再切换。stats 页已有同款回退。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 07:33:08 +08:00
wangjia
03e268edc5
fix: /v1/usage 401(统计页全0真因) + 连接页速度改动态字节单位
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- /v1/usage 一直 401:usage 包自定义了 ctxKey("user_id") 读 user id,但
auth.RequireAuth 把 user id 存在 codes.CtxKeyUserID 下;Go context key 按
「类型+值」比较,命名类型不同 → 取到 nil → 401 → 统计页本月流量/时长恒 0
(而 /v1/me weekly 走 account.go 直查,有数,故只半边为 0)。改 usage 读
codes.CtxKeyUserID(与 auth.UserIDFromContext 同键,/v1/me 已验证可用)。
同时修好 /v1/ads/unlock(同一函数)。
- 连接页速度:Mb/s(兆比特,小流量显示 0.0)→ 动态字节单位 B/s·KB/s·MB/s·GB/s,
小数据也看得清。
go build/test 通过;flutter analyze 0 error;114 tests passed。server 已部署。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 07:17:58 +08:00
wangjia
e10f214dee
feat(client): 系统托盘常驻 + 关闭窗口隐藏到托盘(桌面端)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- system_tray.dart:TrayService 用 tray_manager + window_manager。setPreventClose
拦截关闭 → 隐藏到托盘(常驻保持隧道);托盘图标点击/「显示主界面」重新显示,
「退出」真正退出。
- main() 改 async:桌面端 runApp 前 init 托盘;移动端/web 跳过(isDesktop 守卫)。
- 托盘图标复用 app_icon_32.png → assets/tray_icon.png。
- 新依赖:tray_manager / window_manager。
flutter analyze 0 error;114 tests passed。托盘为运行时/原生功能,需 release .app 验证。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 06:31:40 +08:00
wangjia
aee9ba7b72
feat(client): 登录体验 — 记住邮箱 + 密码显隐 + 7天免登陆
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
1. 记住邮箱:登录页预填上次邮箱(TokenStore.saveLastEmail,登录/注册成功时存,
退出登录不清除)。
2. 密码显隐:登录/注册密码框加眼睛按钮切换明文(PangolinIcons.eye/eyeOff)。
3. 7天免登陆:RootFlow 改为响应 authProvider——启动时有有效会话直接进主界面;
AuthNotifier.refresh() 在服务端拒绝(refresh 过期/超 7 天)时 logout 回登录页,
网络错误则保留会话。会话恢复期间显示极简启动屏。
flutter analyze 0 error;114 tests passed。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 06:28:49 +08:00
wangjia
f35bbea0a0
fix(client): 连接后延迟用内核 urltest 实测 + 侧栏套餐到期日接真
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- 延迟:TCP 探针在隧道开启时会被路由进隧道而测不到(显示 —)。改为连接后
(phase==on)取内核 statsStream 的 urltest delayMs 最小正值(代理真实 RTT),
未连接时仍用节点 TCP 探针。连接页 _SpeedRow/_NodePill/_CurrentNodeCard
与统计页平均延迟统一此口径。
- plan_badge_card(侧栏)接 me.expiresAt 显示真实到期日(原只显示「有效期至」
无日期);account_page 之外漏改的最后一处。
flutter analyze 0 error;114 tests passed。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 00:44:46 +08:00
wangjia
93ec421c41
fix(plans): /v1/plans 500 修复 — plans 表无 name_zh/name_en 列
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
ListPlans 历来 SELECT name_zh/name_en,但 plans 表从未有这两列(各迁移/seed
均无)→ 该端点一直 500(无 live 测试故未暴露)。改为不查名称列(套餐名是 UI
文案,客户端 PlansScreen 按 code 取 l10n:free/pro/team)。价格等真实字段保留。
已在节点实测:/v1/plans 200,返回 free ¥0 / pro ¥25 / team ¥99。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 00:32:40 +08:00
wangjia
6ee7114ff8
feat(client): P6 设置项落地真实行为( #6 6F,本地部分)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- settings_provider:三开关 shared_preferences 持久化 + 副作用落地:
killSwitch→VpnBridge.setKillSwitch(on:);autostart→桌面原生登录项
(launch_at_startup);smartRoute 持久化为偏好(连接时作 split_cn,见 #5 )。
- settings_page → ConsumerWidget,开关接 settingsProvider;协议标签
WireGuard→REALITY/Hysteria2;版本号取 pubspec(package_info_plus)。
- 新依赖:shared_preferences / package_info_plus / launch_at_startup。
flutter analyze 0 error;114 tests passed;settings golden 重生成。
待办:#5 智能分流的 server 端 geoip-cn 下发 + autostart 真机验证(需 release .app)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 00:13:41 +08:00
wangjia
ce5155d4ca
feat(client): P5 连接页实时速度 + 连接错误冒泡 UI( #6 6E,并入 #4 )
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- vpnStatsProvider:暴露内核 statsStream(上/下行瞬时速率);连接页速度行
下/上行改用实时数据(B/s→Mb/s),不再硬编码 86.4/12.1;延迟用实测节点 ping。
- ConnectionState 加 error 字段;_connect 失败不再静默回 off,而是按语言
冒泡 ConnectApiException 文案;节点未就绪(无 uuid)给出提示并删除旧 1.2s
mock 连接路径。
- 连接页 caption 下/桌面 pill 上方显示错误文案(红)。
- 重写 connection_controller_test 适配(无网络:未就绪→off+error)。
flutter analyze 0 error;114 tests passed。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 00:09:31 +08:00
wangjia
f20eddad55
feat(client): P4 节点实测延迟/设备/套餐价/兑换/统计接真( #6 6D)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- latency_probe.dart:并行 TCP 握手实测各节点 per-client RTT(服务端无法代知)。
- nodes_provider:解析 /v1/nodes 的 host/port,后台测延迟回填 Node.ping;智能选择
按实测最小;去掉 8 个伪造演示节点(空列表用中性占位,不再伪造服务器)。
- Node:+host/port/copyWith/pingLabel(未测显示 —);各端 ping 显示改 pingLabel。
- account_screens:PlansScreen 接 /v1/plans(价格 priceLabel + me 标当前档);
DevicesScreen 接 /v1/me/devices + 移除 DELETE + last_seen;RedeemScreen 接
/v1/redeem(成功刷新 me,失败显示后端文案)。
- stats_page:周柱接 me.weekly_gb,本月流量/时长接 usage(30),延迟用生效节点实测。
- 顺带补登记早前 log_time.dart 的删除(log.dart 重构遗漏 stage)。
flutter analyze 0 error;115 tests passed;受影响 4 golden 重生成。
本机设备高亮 + 真实 device id 随 P6(device_info_plus)落地。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-19 00:04:25 +08:00
wangjia
bb39b36d84
feat(client): P3 账号/套餐视角/配额接真( #6 6C)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- account_providers:新增 meProvider(GET /v1/me,登录态变化自动重取)、
plansProvider、usageProvider(family by days)。
- isFreePlanProvider 改为派生自 meProvider.plan(去掉可写演示开关)。
- quotaProvider:总额取 plans free.daily_minutes,今日剩余取 me.quota_today_min
(后端已算好);adUnlocked 保留本地态(ad SDK 未接)。
- account_page:邮箱/套餐/到期接 me;删「演示:免费版视角」开关 + kDemoEmail;
协议标签 WireGuard→REALITY/Hysteria2。
- 重写 quota_controller_test 为 provider 驱动;account/quota golden 重生成。
flutter analyze 0 error;113 tests passed。统计页(weekly/月流量/延迟)随 P4
一并接(其均延迟依赖 P4 实测探针)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-18 23:51:28 +08:00
wangjia
ba53a0d478
feat(client): P1 真实数据接入地基( #6 6A)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- api_config.dart:API 基址单源(消除各处重复 _kApiUrl)
- api_client.dart:统一鉴权 HTTP 客户端,401→AuthNotifier.refresh→重试一次,
错误统一 AuthApiException;+ 单测覆盖 401 刷新重试
- 模型 me/device/plan/usage_point(对齐后端 snake_case 契约)
- account_api.dart:/v1/me、/v1/plans、/v1/me/devices(列表+删)、/v1/usage、
/v1/redeem、/v1/ads/unlock 封装
- auth_provider:注入 AuthApi + refresh();account_providers 装配 ApiClient/AccountApi
- 顺带修复 onboarding 提交遗留的测试 stub(_NullTokenStore 缺 isOnboarded/markOnboarded)
flutter analyze 0 error;114 tests passed。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-18 23:32:57 +08:00
wangjia
b9e5dbec9b
refactor(client): 抽统一日志函数 logLine + 去掉重复时间戳
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- log_time.dart → log.dart:提供 logLine(tag, msg),格式 `[时:分:秒.毫秒] [tag] msg`,
DesktopKernel / DesktopVpnBridge 散落的 print+拼接全部收敛到此。
- 下发配置 log.timestamp=false:sing-box 不再自带时间戳,避免一行打印两个时间
(之前 `[22:10:35.213] [stderr] +0800 2026-06-18 22:10:35 ...` 重复)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-18 22:17:09 +08:00
wangjia
df75d3a135
feat(client): 桌面端日志加本地时间戳前缀 [HH:MM:SS.mmm]
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
新增 log_time.dart(共享 logTime() helper),DesktopKernel / DesktopVpnBridge
所有日志行首打 [时:分:秒.毫秒],便于排查连接时序。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-18 21:56:38 +08:00
wangjia
df72ad60f4
fix: DNS 用 sing-box 1.12+ 新格式 + 引导仅首次显示
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- clientconfig/mockserver:客户端配置 DNS 从 legacy address 串格式改为
type+server 新格式(sing-box 1.13 对 legacy DNS 直接 FATAL,导致连不上)
- 引导页只首次:TokenStore 加 markOnboarded/isOnboarded;main.dart 登录后
若已引导过直接进主界面,不再每次都弹引导
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-18 21:20:11 +08:00
wangjia
25c7bd75aa
feat(client+scripts): release 本地真测 — local_test.sh + 内核查找加 /opt/homebrew
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
- scripts/local_test.sh:一键构建 release macOS 包 + 配 sing-box 免密 sudoers
(TUN 需 root)+ 前台运行真身(日志直出),让本地测试 = release 线上行为
- kernel_process 二进制查找兜底加 /opt/homebrew/bin/sing-box(Apple Silicon
brew),release 包从 Finder/直接启动也能找到内核,免设 PANGOLIN_SINGBOX_BIN
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-18 21:09:08 +08:00
wangjia
d341c1c6e5
fix(client/auth): 验证码字段去掉点状占位(hintText 改空)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
'······' 占位被误以为是已填/遮蔽;验证码本就明文输入,清空占位更清晰。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-18 09:23:12 +08:00
wangjia
caeef20df3
feat(client): 新增 Windows 桌面端(sing-box TUN 全局代理)
...
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / Unit Tests — nginx cfg + compose (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled
ci-pangolin / Image Build — pangolin-edge (push) Has been cancelled
Windows 与 macOS 桌面同路线:Flutter 应用 + sing-box.exe 子进程 + wintun TUN
接管整机流量。Dart/桥接层此前已 Windows-ready(kernel_process._buildCommand /
_resolveBinaryPath、desktop_vpn_bridge 配置路径、fetch-desktop-bin.sh),本次补
原生外壳 + 提权 + 打包:
- flutter create --platforms=windows 生成 windows/ runner(flutter_secure_storage
已注册 windows 插件,token 存储可用)。
- runner.exe.manifest 设 requestedExecutionLevel=requireAdministrator:启动 UAC
提权,sing-box 子进程继承管理员权以创建 wintun TUN(与 _buildCommand 既有设计一致)。
- windows/CMakeLists.txt 增 install 规则:打包时把 app/kernel/dist/desktop/windows-*/
{sing-box.exe,wintun.dll} 拷到 app exe 同级目录(存在才拷,缺失告警,类比 android
build.gradle 占位)。
- kernel_process.dart 启动时校验 wintun.dll 与 sing-box.exe 同目录,缺失早警。
- windows/README.md:拉内核二进制 / 管理员终端 flutter run / 打包 / 出网验证步骤。
提权用 requireAdministrator(每次 UAC),正式版可换特权 helper(BACKLOG,类比 SMJobBless)。
本机(macOS)验证:flutter analyze 无 error。Windows 真机 build/连通验证待后续
(无 Windows 机器,状态同 Android/iOS:代码就绪、未真机验证)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-17 07:49:26 +08:00
wangjia
bcee7f92ed
merge: maestro/tsk__bm21nctbhWF into main (bulk integration)
...
# Conflicts:
# client/lib/widgets/auth_screen.dart
2026-06-17 00:47:54 +08:00
wangjia
9f2f96d722
merge: maestro/tsk_xAQhC1xuCd8x into main (bulk integration)
2026-06-17 00:41:30 +08:00
wangjia
6979411c1d
feat: 档2 接真后端 — mac app 真注册/登录/拉节点
...
dev 本机置备(新增 dev/):
- docker-compose.yml: MySQL :13306 + Redis :16379(避让本机已占的 3306/6379)
- run-local.sh 一键: 起容器→openssl 生成密钥(dev/.local gitignore)→migrate→
seed→启动 server :18080(避让 8080);LogMailer 把验证码打日志
- seed.sql(1 provider + 1 HK 节点)、run-local.md 手册、.gitignore
后端两处修复(本地无 gRPC 场景,注释意图与代码不符的 bug):
- main.go: 无 gRPC 时真正构造 Hub-only nodeSvc(原只建 hub 没赋值),/v1/nodes 才能挂
- main.go: /me 改 Route 子路由根 Get,修 Get("/me")+Route("/me") 冲突致 404
客户端接真后端:
- token_store: MacOsOptions(useDataProtectionKeyChain:false) 修 keychain -34018
- auth_screen: 删 dev 旁路(test 账户内存登录),所有登录走真 API
验收: 后端 curl 端到端全通(验证码→注册→登录→/nodes→/me);
server go build/vet/test 通过, client analyze 0 + test 84
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-16 13:27:58 +08:00
wangjia
f3cc2dfc2d
fix(client): 去 dev 旁路 + 修 macOS keychain -34018 [tsk__bm21nctbhWF]
...
1. 去 dev 旁路:删除 auth_screen.dart 中 test@pangolin.dev 预填 + devLogin
跳过后端分支,以及 auth_provider.dart 的 devLogin() 方法。
2. 修 keychain -34018(errSecMissingEntitlement):
在 DebugProfile.entitlements / Release.entitlements 中添加
keychain-access-groups($(AppIdentifierPrefix)com.pangolin.pangolinVpn),
使 flutter_secure_storage 的 Data Protection Keychain API 获得正确 entitlement。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-16 13:21:38 +08:00
wangjia
fe16f89bc3
feat(client): 账户子页 desktop 内容区下钻(档1)
...
- desktop 上套餐选择/兑换购买/设备管理改为内容区下钻(侧栏保留、shell 顶栏带
返回箭头),不再全屏 push 盖住侧栏;mobile/tablet 仍全屏 push
- _SubScaffold 加 embedded 参数(true 只返回内容),PlansScreen/DevicesScreen/
RedeemScreen 透传;NavView 加 devices + kAccountSubViews 集合
- desktop_shell 渲染子页(embedded) + 顶栏 onBack→account;account_page 按
formFactor 选下钻(切 navView)或 push
- desktop 整页 golden 补 套餐/兑换/设备 三子页(共 8 页)
测试: flutter test 84 通过(+3 子页 golden), analyze 0 error
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-16 12:36:14 +08:00