Repository navigation
Conversation
Account › Email signature builds a signature to paste into Gmail, Outlook, Apple Mail or Thunderbird, from a template for each kind of role the person holds: Carica (Presidente, Segretario), Direttivo, Admin (Capo Admin, Admin), Team and Socio. Name, email and roles come from the backend: board offices, Direttivo and Socio from PoliNetwork Auth through the backend's new `me.roles`, Admin, Capo Admin and teams from the People record. The person chooses the template, the roles shown, the layout (side, stacked, compact) and the language, and may add pronouns, a phone number and LinkedIn. The PoliNetwork logo and blue are fixed. The HTML is built for mail clients: nested tables, inline styles, exact line heights, an HTTPS PNG logo (`SIGNATURE_LOGO_URL`) sized in attributes, nothing they strip. Copy signature puts rich HTML and plain text on the clipboard; the page also offers the HTML code, the plain text and a .htm file for Outlook and Thunderbird. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
A new page, Account › Email signature (
/dashboard/account/signature), open to anyone withpeople:self. It generates a PoliNetwork signature to paste into a mail client.Templates. There is one template per kind of role the person holds, so each person sees only theirs:
Data from the backend, read-only.
me.roles(feat(me): tell a dashboard user their own PoliNetwork Auth roles backend#177). Admin, Capo Admin and teams come from the People record.Customization from the template:
linkedin.com/in/…)The PoliNetwork logo and blue are always there.
Output:
Preview in a sandboxed
iframe, so the dashboard's CSS can't change how it looks. A Desktop/Phone toggle shows it at 360px.Remembered choices. Template, layout, language and roles are kept in
localStorage. Phone and LinkedIn are not, since they're personal data.Email-safe HTML (
src/features/signature/signature.ts)Everything is in pure functions, unit-tested in
tests/signature.test.mjs:<style>,div, flexbox, SVG, web fonts ordata:URIsmso-line-height-rule:exactlyfor Outlookwidth/heightattributes, from theSIGNATURE_LOGO_URLenv, which defaults to the backend's email logo on GitHub (192px, which also covers retina)Compatibility with the backend
If
me.rolesisn't available yet (backend not released) or the snapshot is stale, the page offers only the templates from the People record and shows a warning. It never fails. In agent mode, the roles come fromAGENT_ROLES(defaultdirettivo,presidente,socio).Other changes
nav.ts,matchPath).people.me.signature(peopleSelfMiddleware).tests/server-security.test.mjslists the new functions file.SIGNATURE_LOGO_URL,AGENT_ROLES), AGENTS.md, design.md (Editor template).How I tested it
Dashboard page (agent mode, Chromium):
Clipboard (Chromium) – Copy signature, then a real Ctrl+V into a
contenteditableeditor, like the signature boxes in Gmail and Outlook web:text/htmlandtext/plainare both on the clipboard.mailto:,tel:, LinkedIn and website links, and the styles are all intact.Rendering – every template × layout at 640px and 360px:
Forced dark mode (Blink
forceDarkModeEnabled, which approximates the Gmail and Outlook apps' inversion): the signature stays readable and the logo holds up.Validation: an invalid phone blocks the copy, focuses the field and sets
aria-invalid.Checks:
pnpm checkhas 0 errors (the 46 warnings were already on main), andpnpm typecheck,pnpm test(266/266) andpnpm buildpass.Not tested, to check by hand
Open questions
vicepresidente,tesoriere) but don't exist as roles in Auth yet.SIGNATURE_LOGO_URLin production once it's published.🤖 Generated with Claude Code