fix(web): surface non-in_sync status in Context overview badge (#692)#704
Merged
fix(web): surface non-in_sync status in Context overview badge (#692)#704
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #692.
Summary
inSync < totalwith an explicit sum acrossmissing_target,missing_canonical,out_of_sync, andparse_errorso the Context overview badge correctly flags multi-runtime divergence.parse_error→missing_target→missing_canonical→out_of_sync→ all-clear), so the user sees3 missinginstead of3/3 syncedand can click through to the per-runtime detail.settings.ctx.badge_*i18n keys (en + ko) for the new labels.Repro before / after
/api/context/overviewon a project with three commands tracked under bothclaude_commands(in sync) andgemini_commands(no target):{ "commands": { "total": 3, "in_sync": 3, "missing_target": 3 } }Before: green
3/3 syncedbadge — multi-runtime issue invisible.After: warning-coloured
3 missingbadge with click-through to the detail page.The summary endpoint shape is unchanged; the per-runtime detail at
/api/context/commandsalready 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/srcclean.3 missing).badge-warning, notbadge-success.ko.jsonstrings.Cache busters
context-gateway.js?v=5→?v=6.🤖 Generated with Claude Code