Team View: mailto: link for non-admin members in 'E-mail an Auswahl senden' #75
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
m's report (2026-05-25 12:33)
Scope
The Team View currently exposes two "E-Mail an Auswahl senden" actions:
Both currently open an in-app compose form (admin-only mail sender). For non-admin users this is the wrong affordance — they should get a regular
mailto:link that opens their own mail client with the recipient list pre-filled.What to do
mailto:link.to:= the comma-joined recipient e-mails (URL-encoded), respecting the same source (manual selection vs. filter set) that drives each button.<a href="mailto:...">rather than JS-opening awindow.location— the native handler is the more reliable affordance and respects the user's default mail client.Files most likely touched
frontend/src/projects-detail.tsx→ Team tab section, or wherever the Team View bottom + filter bars live (might be a dedicatedfrontend/src/team-view.*— verify before editing).frontend/src/client/team-view.ts(or equivalent client file).Hard rules
mailto:recipient list URL-encoded correctly (commas,?if subject added).go build ./... && go test ./internal/... && cd frontend && bun run buildclean.mai/<worker>/team-view-mailto-non-admin.Out of scope
Reporting
mai report completedwith branch + SHAs + the exact UX path: open a project → Team tab → as non-admin, click either "E-Mail an Auswahl senden" button → see mail client open with recipients pre-filled.Done — Team View mailto: link for non-admin members
Branch:
mai/hermes/gitster-team-view-mailtoCommit: 5589cbb
What changed
Both
E-Mail an Auswahl sendenactions on/teamnow branch on the existingcanBroadcast()helper:global_adminor project-lead on the selected projects) — keeps the in-app compose modal exactly as before (POST /api/team/broadcast).<a href="mailto:...">with the recipient list pre-filled. Subject and body intentionally left empty per scope. Recipient emails URL-encoded (encodeURIComponent) and comma-joined via the existingbuildMailtoHrefhelper frombroadcast.ts(RFC 6068).Filter-bar button used to hide for non-admins (early-return in
buildBroadcastButton()); it now renders as themailto:anchor and itshrefis refreshed inupdateBroadcastButton()on every filter change so the link always reflects the currently visible recipients. Empty visible set disables the affordance visually (aria-disabled+pointer-events: none+ 0.5 opacity) so a stray click can't open an empty composer.Bottom selection footer mirrors the same shape —
renderSelectionFooter()emits either a<button>(admin) or an<a>(non-admin), and only registers the modal click-handler on the admin path. The anchor uses its nativehrefto open the user's mail client.Files touched
frontend/src/client/team.ts—buildBroadcastButton,updateBroadcastButton,renderSelectionFooter; addedbuildMailtoHrefto the existing./broadcastimport.team.tsx, the compose modal,openBroadcastModal, and the server/api/team/broadcastflow are all untouched.UX path
global_adminand not lead on the selected projects)./team).E-Mail an Auswahlpill in the filter bar renders as a button-styled<a>whosehrefismailto:<comma-joined emails>. Click → native mail client opens with all visible recipients in To, subject & body empty.E-Mail an Auswahlbutton styled identically; it is also amailto:anchor pre-filled with only the selected emails.global_adminor project-lead, both buttons still open the compose modal (no regression on admin path).Build hygiene
cd frontend && bun run build— clean (i18n scan clean, branding HLC, no new keys, dist contains the mailto path).go build ./...— clean.go test ./internal/...— clean (handlers / services / auth / branding / calc / changelog / db / offices all PASS).Notes / follow-ups
,. Themailto:URL stays comfortably below typical mail-client limits (~2 kB) for the current firm directory (~60 users → ~1.9 kB). Did not trim recipients; flagging here per the issue's request rather than blocking. If the directory ever grows past ~70 active users, we'll want a soft cap with a "too many recipients, use the compose form" hint./teamtab mailto path (buildMailtoHrefviawindow.location.href, t-paliad-231) was deliberately left as-is — the issue's<a href>preference is local to this task's two buttons.team.broadcast.buttonandteam.selection.sendare reused so the DE primary / EN secondary labels stay consistent.