Skip to content

gut(ui): strip session-cost i18n + msg-meta CSS orphans — #2529 audit#2552

Merged
alexey-pelykh merged 1 commit intomainfrom
spike/2529-ui-remnants-audit
Apr 24, 2026
Merged

gut(ui): strip session-cost i18n + msg-meta CSS orphans — #2529 audit#2552
alexey-pelykh merged 1 commit intomainfrom
spike/2529-ui-remnants-audit

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Closes #2529. Re-audit of 5 prior gut areas for lingering UI remnants in ui/src/. Inline fix for trivial session-cost orphans (i18n + CSS, same precedent as #2536). Non-trivial findings filed as follow-ups (#2549, #2550).

Audit matrix

Area Gut PR Verdict Inline fix? Follow-up
Session cost analytics #2307 / #2332 ORPHAN — F1 (i18n), F6 (CSS) yes (this PR)
Model fallback #2106 / #2130 DEAD WIRING — F2 no, non-trivial #2549
Default-agent ordering #2286 ORPHAN — F3 no, semantic judgment #2550
contextTokens #2277 grep-clean
LLM provider code #2363 grep-clean

Findings

F1 — Session-cost i18n keys missed in 5 non-English locales (FIXED)

The ui/src/i18n/locales/en.ts locale was cleaned by #2332 but the 5 non-English locales (de, es, pt-BR, zh-CN, zh-TW) retained tabs.usage + subtitles.usage entries. No call site reads these keys — grep-clean after removal.

F2 — Model-fallback UI dead wiring (→ #2549)

FallbackStatus, handleLifecycleFallbackEvent, renderFallbackIndicator, FallbackIndicatorStatus, parseFallbackAttempts, FALLBACK_TOAST_DURATION_MS, plus .compaction-indicator--fallback* CSS — all remain in ui/src/ despite #2130 claiming removal. The backend stub at src/auto-reply/fallback-state.ts:9 returns {}, so the guarded emit branches in agent-runner.ts:587,616 never fire — confirming dead wiring. ~300 LOC cleanup; filed separately for reviewable scope.

F3 — "default" agent pill badge (→ #2550)

agentBadgeText at ui/src/ui/views/agents-utils.ts:104-106 still returns "default" pill in the agents list, contradicting #2286's explicit "no special default marker" intent. Backend defaultId field is LIVE (agent pre-selection), only the visual badge is vestigial. Judgment call on whether to preserve as UX cue; filed separately.

F4 — contextTokens (grep-clean)

Terms searched: contextTokens, DEFAULT_CONTEXT_TOKENS, lookupContextTokens, resolveContextTokens, contextTokensUsed, remainingTokens, percentUsed, 200k. No matches in ui/src/.

F5 — LLM provider code (grep-clean)

Terms searched: ollama-stream, Ollama, minimax-portal, qwen-portal, model-auth-markers, provider-auth-result. No matches in ui/src/.

F6 — Session-cost .msg-meta* CSS orphans (FIXED)

Discovered during secondary sweep. The CSS block in styles/chat/grouped.css defined under comment "Message metadata (tokens, cost, model, context %)" — the per-message cost display — had zero TS/TSX references anywhere in the repo. 8 CSS rules removed (class count: 728 -> 720). Same gut area as F1 (#2307/#2332).

Changes

  • ui/src/i18n/locales/{de,es,pt-BR,zh-CN,zh-TW}.ts — remove tabs.usage + subtitles.usage (F1)
  • ui/src/styles/chat/grouped.css — remove .msg-meta* block (F6)

Test plan

  • pnpm check (format + tsgo + lint + lint:tmp:no-random-messaging + lint:no-remoteclaw-ai + lint:ui:no-css-class-drift) — PASS
  • pnpm test:ui:smoke (app.smoke + app.computed-style) — 12/12 PASS
  • grep -rn 'tabs\.usage\|subtitles\.usage' ui/src/ — no matches
  • grep -rn 'msg-meta' . (excluding node_modules, .tmp, .git) — no matches
  • CI green (build + test + lint + docs + test-ui-smoke)

Related

Post-#2332 session-cost-analytics gut missed:

- `tabs.usage` + `subtitles.usage` i18n keys in 5 non-English locales
  (de, es, pt-BR, zh-CN, zh-TW). English locale was cleaned correctly;
  non-English locales were not. No call site reads these keys.
- `.msg-meta*` CSS rules (`.msg-meta`, `.msg-meta__tokens`, `.msg-meta__cache`,
  `.msg-meta__cost`, `.msg-meta__ctx`, `.msg-meta__ctx--warn`,
  `.msg-meta__ctx--danger`, `.msg-meta__model`) in `styles/chat/grouped.css`.
  Comment reads "Message metadata (tokens, cost, model, context %)" — same
  gutted feature. Zero TS/TSX references anywhere in the repo.

Part of the #2529 re-audit of prior gut areas. Findings F2 (fallback UI
dead wiring) and F3 (default agent badge) tracked separately as #2549
and #2550 — non-trivial and warrant their own review.

CSS class count: 728 → 720 (matches the 8 removed msg-meta* rules).
Browser smoke + computed-style tests pass (12/12).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh merged commit 3127a10 into main Apr 24, 2026
16 checks passed
@alexey-pelykh alexey-pelykh deleted the spike/2529-ui-remnants-audit branch April 24, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spike(ui): re-audit prior gut areas for UI remnants (session-cost, model-fallback, default-agent)

1 participant