caaed88298
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 20s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 17s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 16s
ci-pangolin / Lint — shellcheck (pull_request) Failing after 7s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 12m2s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 4m19s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 11m12s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 11m22s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 11m32s
ci-pangolin / Go — build + test (pull_request) Failing after 11m42s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Failing after 11m51s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Failing after 11m59s
#215 android 跑到 flutter build apk 的 Gradle 阶段挂了 ~17min: "Gradle threw an error while downloading artifacts from the network" "java.io.EOFException: SSL peer shut down incorrectly"(org.gradle.wrapper.Download) ——这是 sing-box 之外的第二个 GFW 网络坑:Gradle 要下载发行版和 maven 依赖, 走了被墙的 services.gradle.org / dl.google.com / maven central,SSL 被重置。 env 里配了 GOPROXY/PUB/FLUTTER 镜像,唯独 Gradle+Maven 没配。改: - gradle-wrapper.properties: distributionUrl → 腾讯云 gradle 镜像(同一份 zip)。 - settings.gradle / build.gradle: repositories 前置阿里云 google/public/gradle-plugin 镜像,原 google()/mavenCentral()/gradlePluginPortal() 保留作 fallback。 镜像已逐个验证:腾讯 gradle-8.7-bin.zip(206)、阿里云 AGP 8.6.0 pom(200)、 kotlin.android 2.2.0(200)均可取。全球通用,墙内不再依赖被墙源。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A79VtQA1BwTuQN1ThpvYpo
穿山甲 · Pangolin — Flutter 客户端
跨平台网络加速客户端。UI 以 design/ui_kits/(mobile + tablet)React 原型为像素基准,
令牌同源自 design/colors_and_type.css(Dart 镜像见 lib/pangolin_theme.dart)。
运行
flutter pub get
flutter run
# main.dart 已串好:登录 → 引导 → 主框架(连接/节点/统计/账户)
工程结构
lib/
pangolin_theme.dart 语义 token + 明/暗 ThemeData(零硬编码十六进制,改令牌与 css 两处同改)
l10n/ 文案资源(单显:任一时刻只渲染中文或英文)
app_text.dart 抽象契约 + AppLang 枚举
strings_zh.dart 中文资源 ← CI 红线词扫描目标
strings_en.dart 英文资源 ← CI 红线词扫描目标
models/node.dart 节点模型(2 字母码块,无 emoji 国旗)
state/ Riverpod 状态层(UI 与数据解耦,mock 数据,接 API 不动 UI)
app_providers.dart 语言 / 主题 / 套餐视角
connection_provider.dart 连接状态机(严格三态,禁止乐观显示)
quota_provider.dart 免费额度状态机(剩余分钟 + 看广告解锁)
nodes_provider.dart 节点清单 + 智能选择(AUTO 取最低延迟)
widgets/ 原子组件(连接键三态 / 推荐卡 / 额度卡 / 国家码块 / Tab 滑动仲裁 …)
screens/ 4 个主页面(同一份代码按断点自适应)
关键实现要点
- 连接键三态:
off暖灰底+虚线轨道环 /connectingclay 实底+旋转弧 /on绿底满环+圆内计时+光晕。 过渡只走box-shadow/背景色,不做全属性动画。状态严格来自connectionProvider,点击只派发事件——禁止乐观显示。 - 智能选择推荐卡:节点页置顶常驻,accent-subtle 底 + clay 渐变 zap 图标 + 「推荐」胶囊,默认选中。
- 免费额度卡:剩余分钟 + 进度条(≤3 分钟切 warning 色)+「看广告开始使用」→ 解锁后变绿。
- Tab 滑动切换:
HorizontalSwipeArea仅接横向拖拽;纵向滚动由列表的纵向识别器在手势竞技场胜出, 子页滚动区域不会误触发(DirectionalTabSwitcher做 200ms 方向感知滑入)。 - iPad/宽屏断点:
LayoutBuilder在宽度 ≥900 时切左侧栏分栏(导航行高 ≥48), 连接页双栏、节点页双列网格——复用同一批原子组件,仅布局开关,不 fork 页面。 - 文案全部走 l10n,界面无红线词(铁律 13),由
ci/scan-redline.sh在 CI 防回归。
测试
flutter analyze # 期望零警告
flutter test test/unit test/widget # 状态机单测 + 组件行为测试
flutter test --update-goldens test/golden # 首次生成 golden 基准图
flutter test test/golden # 之后做 golden 回归(连接键三态/推荐卡/额度卡 × 明暗)
golden 基准图依赖本机字体渲染,首次须用
--update-goldens生成并提交;CI 默认只跑 unit + widget。