fix(sessions): Messages stat card + slim prune button (#855)

* fix(sessions): show Messages stat + slim prune button

The Active stat card always rendered 0: the mobile model declared
'val active: Int = 0', a key GET /api/sessions/stats never sends
(backend returns total/active_store/archived/messages/by_source), and
with ignoreUnknownKeys = true deserialization silently fell back to 0.

Rework the stats row instead of just key-mapping:
- Messages card replaces Active, reading the 'messages' key
  (db.message_count(), web_routers/sessions.py:523-550)
- Prune becomes a slim 52dp icon-only card (contentDescription keeps it
  accessible) so the Messages card keeps width for large counts

* feat(sessions): compact stat counts (100k / 1.23m) for Total & Messages

formatCompactCount renders counts as max 3 digits + unit letter:
987 -> '987', 100987 -> '100k', 1234567 -> '1.23m', 100000000 -> '100m'.
Applied to both the Total and Messages stat cards so large numbers fit
the row. Covered by SessionsStatsFormatTest (5 test cases).

* fix(sessions): label prune + empty-cleanup buttons, drop top select toggle

- Prune card now sizes to its label (icon + 'Prune' text) instead of a
  52dp icon-only square, staying compact via wrap-content width.
- Empty-session cleanup becomes a labeled FilledTonalButton (icon +
  'Delete empty sessions', count badge kept) instead of a bare icon.
- Removed the top-bar select toggle (SelectAll icon); selection mode
  remains reachable via long-press > Select on any session row.
- Dropped now-orphaned content_desc_enter/exit_selection strings (en/ko).

* fix(sessions): prune card wrap-content width + shorter cleanup label

The prune card dropped its fixed 52dp width but kept fillMaxSize on the
inner Box — as an unweighted Row child that expands to the full row
width, starving the weighted Total/Messages cards (reported broken on
device). The Box now fills height only, so the Card wraps to its
content (icon + 'Prune').

Empty-session cleanup button label shortened to 'Delete empty'.

* fix(sessions): stack prune label under icon, cleanup button reads 'Empty'

- Prune card: trash icon above the 'Prune' label (column layout),
  still wrap-content width so Total/Messages keep their space.
- Empty-session cleanup button label shortened to 'Empty'.

---------

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-08-09 15:35:42 +03:00
1 parent 3b033a025b
commit 57dc4cdf5c
6 files changed
+108 -43

No files matched your search

+1 -3
View File
@@ -329,7 +329,7 @@
<!-- Sessions Stats -->
<string name="sessions_search_placeholder">세션 검색…</string>
<string name="sessions_stat_total">전체</string>
<string name="sessions_stat_active">활성</string>
<string name="sessions_stat_messages">메시지</string>
<string name="sessions_action_prune">정리</string>
<string name="sessions_prune_title">오래된 세션 정리</string>
<string name="sessions_prune_desc">지정된 일수보다 오래된 세션을 삭제합니다.</string>
@@ -342,8 +342,6 @@
<string name="sessions_action_select_all">전체 선택</string>
<string name="sessions_action_deselect_all">선택 해제</string>
<string name="sessions_action_delete_n">%1$d개 삭제</string>
<string name="content_desc_enter_selection">세션 선택</string>
<string name="content_desc_exit_selection">선택 종료</string>
<!-- Toolsets Screen -->
<string name="toolsets_empty_title">툴셋이 없습니다</string>