Skip to content

Admin Mail tab for support tickets - #480

Merged
neuromechanist merged 25 commits into
stagingfrom
feature/issue-479-admin-mail-tab
Oct 25, 2026
Merged

neuromechanist merged 25 commits into
stagingfrom
feature/issue-479-admin-mail-tab

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Adds a Mail tab to /admin over the support-ticket admin API (nemarOrg/nemar-cli#1898, epic nemarOrg/nemar-cli#1893). It is the web counterpart of nemar admin mail; admins may be people or agents and the tab never tells them apart.

  • List with status, queue, assignee and search filters and forward paging; ticket page with the thread oldest first, authentication results, tags and events; actions to reply, add an internal note, assign, set status and escalate; queues (read for admins, edit for owners) and away windows (UTC; owners may set anyone's).
  • Replies are never sent twice. The API proxy now forwards Idempotency-Key (it dropped it before). Each draft keeps one key across retries and reloads (sessionStorage); "Try again" reuses it; reply_delivery_unknown is final for its key, and writing a new reply instead is behind an explicit warning that a second copy may go out.
  • Ticket text is untrusted email: rendered only as escaped plain text, with control, bidirectional and zero-width characters shown as visible escapes; no set:html, links, images or remote content.
  • Visibility is the API's call: restricted queues and tickets simply do not appear for an admin, and a hidden ticket gets the same 404 page as a missing one.
  • Badge: open tickets assigned to you (fail-soft, capped at 100+).
  • Contract copy src/lib/mail-admin-contract.ts with a drift test against nemar-cli; ADR 0029.

Closes #479

Merge gate

Draft until nemar-cli epic #1893 reaches dev: the strict mail-contract drift test is red in CI until shared/contract/mail-admin.ts exists there, and test.nemar.org cannot exercise the tab before the routes deploy. Before merging: capture address-scrubbed dev API responses as test/fixtures/mail-tickets-list.json and mail-ticket-detail.json and switch the tests to them.

Release gate: no staging to main promotion until the mail API is in production.

Test plan

  • Unit tests (4267 pass), typecheck, lint, build
  • Drift test passes locally against the nemar-cli epic copy of the contract
  • CI (drift test expected red until the epic reaches dev)
  • Fixtures captured from the dev API
  • QA on test.nemar.org with test-admin and test-owner: security ticket invisible to admin (direct URL 404), reply double-click sends once, lost response plus Try again sends once, hostile ticket renders inert, 360 px, themes, keyboard, screen reader, forced colors

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

neuromechanist and others added 6 commits October 24, 2026 11:40
Also: notes are never retried after an unknown outcome, and the badge fallback warning is throttled to once a minute.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reload and start-over are disabled while another request is in flight, like send and retry, and the in-doubt guidance says why the text is locked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
neuromechanist and others added 3 commits October 24, 2026 14:09
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also adds putSummary, the summary filter and wording for the retention error codes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@neuromechanist neuromechanist mentioned this pull request Oct 24, 2026
1 of 2 tasks
@neuromechanist
neuromechanist marked this pull request as ready for review October 25, 2026 01:35
@neuromechanist
neuromechanist merged commit 172f686 into staging Oct 25, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-479-admin-mail-tab branch October 25, 2026 01:35
@neuromechanist neuromechanist mentioned this pull request Oct 26, 2026
2 tasks
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