Skip to content

feat(web): render structured report flags as coarse, localized chips#429

Merged
hyoshi merged 1 commit into
mainfrom
feat/report-flags-frontend
Jul 15, 2026
Merged

feat(web): render structured report flags as coarse, localized chips#429
hyoshi merged 1 commit into
mainfrom
feat/report-flags-frontend

Conversation

@hyoshi

@hyoshi hyoshi commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

This PR (frontend + i18n) — stacked on #428

Renders the structured report flags introduced by the backend contract PR as
coarse, localizable chips with a drill-down, so the detail no longer sits
on the chip face and the Japanese UI reads in Japanese.

  • mureo/_data/web/dashboard.js
    • humanizeReportFlag localizes object flags by dashboard.reports_flag_<code>;
      a custom flag uses its author label via pickLocalizedLabel
      (document.documentElement.lang).
    • reportFlagKind maps the four canonical severities to chip classes via
      SEVERITY_CHIP, adding a neutral is-info so info / positive flags are
      not styled as alarms.
    • buildFlagDetail / formatFlagParam render params (adspot ids, yen, ctr,
      booleans) as a localized detail string; buildFlagChipElement makes a chip
      with detail an interactive <button> that toggles a .report-flag-detail
      line (ARIA disclosure: aria-expanded + aria-controls).
    • REPORTS_FLAG_BASES aligned to the canonical vocabulary; is-info added to
      the client-card severity sort order.
  • mureo/_data/web/i18n.json — new dashboard.reports_flag_* and
    dashboard.reports_param_* keys (incl. yes/no) in both en and ja.
  • mureo/_data/web/app.css.report-chip.is-info, .report-chip.is-interactive
    (caret), .report-chip-wrap, .report-flag-detail.

Also fixes a pre-existing latent bug: structured object flags previously rendered
[object Object] on the multi-client index cards.

Tests

tests/test_web_assets_report_flags_vocab.py (i18n en/ja parity + presence of the
localized labels, severity colouring incl. is-info, drill-down wiring, boolean
localization). All web-selected pytest pass; node --check on dashboard.js
passes; no innerHTML (all textContent — no XSS surface).

Stack

Depends on #428 (uses its vocabulary/severity). Independent of PR B.
Legacy bare-string flags still humanize, so this is safe to ship before PR B.

@hyoshi
hyoshi changed the base branch from feat/report-flags-contract to main July 15, 2026 07:54
Localize report-flag chips by canonical code (dashboard.reports_flag_<code>)
in both en and ja, colour them by the four severity buckets (adds a neutral
is-info), and move per-flag detail (adspot ids, yen, ctr) off the chip face
into a click-to-expand drill-down built from the flag's params. Custom flags
use their author-supplied label; legacy bare-string flags still humanize.
@hyoshi
hyoshi force-pushed the feat/report-flags-frontend branch from ca666d4 to 71e6d18 Compare July 15, 2026 08:18
@hyoshi
hyoshi merged commit 5a96ae8 into main Jul 15, 2026
9 checks passed
@hyoshi
hyoshi deleted the feat/report-flags-frontend branch July 15, 2026 08:25
hyoshi added a commit that referenced this pull request Jul 15, 2026
Bump 0.10.26 -> 0.10.27 (pyproject, __init__, plugin.json, 51 SKILL.md
frontmatters) and cut the CHANGELOG for the report-flag changes merged since
0.10.26 (#428 / #429 / #430 / #431).

Added — structured, localizable report-flag chips on the Reports dashboard:
flags persisted via mureo_state_report_set can be {code, severity, params} from
an 18-code vocabulary; the dashboard renders coarse, localized (en / ja),
severity-coloured chips with the detail on a click-to-expand drill-down. The
daily-check / weekly-report / goal-review skills author flags in this shape.

Changed — mureo_state_report_set validates report flags (unknown non-custom
codes rejected, severities defaulted); legacy bare-string flags still pass through.
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.

1 participant