feat: Co-Lite labels only filter on Translations #50

Merged
ngqile merged 6 commits from add-messages-colite-filter into main 2026-12-02 07:00:45 +00:00
Owner

This is OpenSpec change add-messages-colite-filter, a follow-up to #49.

The Translations screen listed about 3,400 labels inherited from Tastefully. Because of them, Missing Chinese showed 1,739 rows that Co-Lite never displays.

What changes

  • Portal: a Co-Lite labels only checkbox, ticked by default.
    • When ticked, the list route sends the portal's own label codes from DEFAULT_MESSAGES to a new search endpoint.
    • The route builds those codes on the server and never takes them from the browser.
    • Unticked, the screen lists every label as before.
  • mobile-api: a new POST /api/admin/messages/search that needs BO_MESSAGES.
    • It refuses with 400 a codes value that is not a list of strings or has more than 5,000 entries.
    • The existing guard test, which checks that labels cannot be created, now also allows this read-only POST by name.
  • services-system: the message search takes an optional list of codes, matched ignoring case.
  • SQL:
    • One new label, MsgsOwnLabelsFilter. The zh-CN SQL is regenerated to include it.
    • sql/01-colite-filter-labels.sql adds only this label. It is for environments that already ran 03 before this change.
    • docs/deployment.md states which file to run.

Verification

  • Maven verify passes for services-system and mobile-api.
  • Portal:
    • vitest: 262 files and 1,769 tests pass, exit code 0;
    • tsc is clean;
    • lint has 0 errors and 4 warnings, all in files this change does not touch.
  • openspec validate --strict passes.
  • Live Playwright check on the local stack, at 1280 px and at 360 px in Chinese:
    • with the box ticked, the list shows 707 labels;
    • Missing Chinese shows 5 labels, all deliberately the same as English;
    • unticked, the screen shows 1,739 missing and 4,097 labels in all, as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs

This is OpenSpec change `add-messages-colite-filter`, a follow-up to #49. The Translations screen listed about 3,400 labels inherited from Tastefully. Because of them, Missing Chinese showed 1,739 rows that Co-Lite never displays. ## What changes - **Portal:** a **Co-Lite labels only** checkbox, ticked by default. - When ticked, the list route sends the portal's own label codes from `DEFAULT_MESSAGES` to a new search endpoint. - The route builds those codes on the server and never takes them from the browser. - Unticked, the screen lists every label as before. - **mobile-api:** a new `POST /api/admin/messages/search` that needs `BO_MESSAGES`. - It refuses with 400 a `codes` value that is not a list of strings or has more than 5,000 entries. - The existing guard test, which checks that labels cannot be created, now also allows this read-only POST by name. - **services-system:** the message search takes an optional list of codes, matched ignoring case. - **SQL:** - One new label, `MsgsOwnLabelsFilter`. The zh-CN SQL is regenerated to include it. - `sql/01-colite-filter-labels.sql` adds only this label. It is for environments that already ran 03 before this change. - `docs/deployment.md` states which file to run. ## Verification - Maven verify passes for services-system and mobile-api. - Portal: - vitest: 262 files and 1,769 tests pass, exit code 0; - tsc is clean; - lint has 0 errors and 4 warnings, all in files this change does not touch. - `openspec validate --strict` passes. - Live Playwright check on the local stack, at 1280 px and at 360 px in Chinese: - with the box ticked, the list shows 707 labels; - Missing Chinese shows 5 labels, all deliberately the same as English; - unticked, the screen shows 1,739 missing and 4,097 labels in all, as before. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile added 6 commits 2026-12-02 07:00:41 +00:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
POST /api/admin/messages/search takes the list filters plus up to 5,000
codes. The no-create guard test now allows this read-only POST by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
On by default. The portal server sends its own label codes to the new
search; unchecking lists every label as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile merged commit 05344d848d into main 2026-12-02 07:00:45 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ngqile/co-lite#50