Skip to content

fix(web): surface non-in_sync status in Context overview badge (#692)#704

Merged
memtomem merged 1 commit intomainfrom
fix/692-context-overview-badge
May 2, 2026
Merged

fix(web): surface non-in_sync status in Context overview badge (#692)#704
memtomem merged 1 commit intomainfrom
fix/692-context-overview-badge

Conversation

@memtomem
Copy link
Copy Markdown
Owner

@memtomem memtomem commented May 2, 2026

Closes #692.

Summary

  • Replace inSync < total with an explicit sum across missing_target, missing_canonical, out_of_sync, and parse_error so the Context overview badge correctly flags multi-runtime divergence.
  • Pick the most actionable status to surface in the badge (precedence: parse_errormissing_targetmissing_canonicalout_of_sync → all-clear), so the user sees 3 missing instead of 3/3 synced and can click through to the per-runtime detail.
  • Add five settings.ctx.badge_* i18n keys (en + ko) for the new labels.

Repro before / after

/api/context/overview on a project with three commands tracked under both claude_commands (in sync) and gemini_commands (no target):

{ "commands": { "total": 3, "in_sync": 3, "missing_target": 3 } }

Before: green 3/3 synced badge — multi-runtime issue invisible.
After: warning-coloured 3 missing badge with click-through to the detail page.

The summary endpoint shape is unchanged; the per-runtime detail at /api/context/commands already reported the truth.

Test plan

  • uv run pytest packages/memtomem/tests/test_i18n.py -q — 12 passed.
  • uv run ruff check + format --check packages/memtomem/src clean.
  • Manual UI: open Settings → Context Gateway overview on a project with the multi-runtime fixture and confirm:
    • Badge text reflects the dominant issue (e.g. 3 missing).
    • Badge colour is badge-warning, not badge-success.
    • Korean toggle renders the matching ko.json strings.
    • Clicking the card navigates into the corresponding detail tab.

Cache busters

context-gateway.js?v=5?v=6.

🤖 Generated with Claude Code

The Context Gateway overview card painted a green ``3/3 synced`` badge
whenever ``in_sync == total``, even when other status counts
(``missing_target``, ``missing_canonical``, ``out_of_sync``,
``parse_error``) were non-zero on the same artifact type. Multi-runtime
artifacts in particular hit this — ``commands: {total: 3, in_sync: 3,
missing_target: 3}`` (3 commands all in sync for one runtime AND all
missing on another) rendered as a confident green pass.

The shape comes from ``_count_statuses`` in
``web/routes/context_gateway.py``: ``total`` is the number of distinct
names, but each per-status count is incremented per
``(runtime, name)`` pair, so the per-status counts can sum well above
``total``. The detail endpoint at ``/api/context/{type}`` already
exposes the per-runtime breakdown — only the overview's summary was
collapsing the signal.

Replace the ``inSync < total`` check with an explicit issue-count sum
across the four problem states. Pick the most actionable state to
surface in the badge (parse_error → missing_target → missing_canonical
→ out_of_sync → all-clear), so a user sees ``3 missing`` instead of
``3/3 synced`` and can click through to the per-runtime detail.

Five new ``settings.ctx.badge_*`` i18n keys land in both ``en.json``
and ``ko.json`` for the new badge labels. ``context-gateway.js?v=5``
bumped to ``?v=6`` per the cache-bust convention.

Co-Authored-By: Claude <[email protected]>
@memtomem memtomem merged commit f4cdd51 into main May 2, 2026
8 of 9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context overview shows '3/3 synced' green badge when missing_target > 0

2 participants