diff --git a/src/i18n_pack.rs b/src/i18n_pack.rs index 1400022..983ebe5 100644 --- a/src/i18n_pack.rs +++ b/src/i18n_pack.rs @@ -99,12 +99,12 @@ const EN_END: &str = "\n };"; /// /// ⚠️ `T_LITERAL_COUNT` 是 `T("…")` **调用点**总数,不是键数,也不是去重后的键数 —— /// 三个集合各不相同(坑 99);说「这个数不该变」之前先确认它在数哪个集合。 -const ZH_KEY_COUNT: usize = 788; -const EN_KEY_COUNT: usize = 788; -const STATIC_ATTR_COUNT: usize = 332; -const STATIC_ATTR_DISTINCT: usize = 307; -const T_LITERAL_COUNT: usize = 537; -const T_LITERAL_DISTINCT: usize = 429; +const ZH_KEY_COUNT: usize = 792; +const EN_KEY_COUNT: usize = 792; +const STATIC_ATTR_COUNT: usize = 335; +const STATIC_ATTR_DISTINCT: usize = 309; +const T_LITERAL_COUNT: usize = 545; +const T_LITERAL_DISTINCT: usize = 434; /// 切出语言包区段(起点标记 → 终点标记,含起点)。 fn pack_region<'a>(src: &'a str, start_mark: &str, end_mark: &str) -> &'a str { diff --git a/ui/README.md b/ui/README.md index 9ce9953..f69f91e 100644 --- a/ui/README.md +++ b/ui/README.md @@ -188,6 +188,10 @@ ui/ - 工具栏右侧 `#tx-count` 同步显示 `tx.pager.count`(共 N 条),与汇总卡的记录数同源; - 图表:`#tx-trend` 改用原型 `.trend` 双色柱状(消费 / 收益两柱 + `.legend`),数据源仍是 `/api/transactions/trend`;**x 轴按请求窗口补零,保证左→右时间递增且柱距恒定**(后端 GROUP BY 只返回有交易的桶,缺行会导致柱子左移——原型同款 bug 的根因); - 窄屏(≤560px)`.stat-grid` 两列、`.trend` 高度收紧。 +- **趋势卡四档**(rant 2026-09-23T21:03:32):`#tx-trend-modes`(`.tabs > .tab`,形状复用 `#tx-tabs`)提供 **总点数(默认)/ 消费 / 收益 / 消费+收益** 四档,四档**共用同一份载荷**(`/api/transactions/trend` 已同时返回 `net`/`income`/`expense`)⇒ 切档只重绘本卡,**档位不进 `txQuerySig()`、不接 `reloadTransactions()`**(否则每次点档多发一次请求、且四档不再同源)。 + - `net` 档=**窗口内累计净变化**(自最早桶起逐桶累加 `net`,窗口起点为 0,可为负),故卡片标题/副标题换 `tx.trend.card.net` / `tx.trend.net.sub` **如实写明口径**——加了列筛选后绝对余额不可定义,不得暗示为余额水位;形态用 `sparkline()` **折线**、y 轴按 `|值|` 定标且**包含零基线**; + - 其余三档保持柱状;归一化的 `max` **只按当前显示的系列**取(`txTrendValues()`),`title` tooltip 与 `#tx-trend-legend` **只陈述显示的系列**; + - 档位**每次进入交易页复位为默认**,复位点写在 `switchView()` 的**视图入口**(不是 `renderView()`/`renderTxTrend()`——那两个还会被 `atp:langchange` 调用,挂上去切一次语言就静默重置用户档位,#660);**不做跨会话持久化**。 ## select 美化约定(v1.19,rant 2026-08-17T20:39:30 C) diff --git a/ui/css/style.css b/ui/css/style.css index 0759456..0043af4 100644 --- a/ui/css/style.css +++ b/ui/css/style.css @@ -1185,6 +1185,14 @@ textarea.input:focus { border-color: var(--accent); } .legend i.consume { background: var(--accent); } .legend i.earn { background: color-mix(in oklch, var(--ok) 80%, var(--muted)); } +/* 折线档(rant 2026-09-23T21:03:32「总点数」= 窗口内累计净变化):整条曲线一个 svg, + x 槽位与柱状档逐列对齐(同一组标签、同一套 flex:1 槽) */ +.trend-line { flex: 1; width: 100%; } +.trend-line .sparkline { height: 118px; margin: 0; } +.trend-axis { display: flex; gap: 10px; margin-top: 6px; } +.trend-axis .trend-x { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; } +.legend i.net { background: var(--fg); } + /* .bar-track / .bar-fill:原型横向条(.bar > i 的结构化别名,供新视图使用) */ .bar-track { height: 8px; border-radius: 999px; background: var(--fg-soft); overflow: hidden; } .bar-fill { height: 100%; border-radius: 999px; background: var(--accent); } diff --git a/ui/index.html b/ui/index.html index 380888c..7ee3919 100644 --- a/ui/index.html +++ b/ui/index.html @@ -5,7 +5,7 @@
单位:点数 · 随上方时间段与筛选联动
+单位:点数 · 随上方时间段与筛选联动
+ +