Skip to content

0e7e13f0 - Mark replies from visitors without an account and render them as plain text - #275

Merged
TaprootFreak merged 10 commits into
developfrom
feat/0e7e13f0-nostr-zappers
Sep 20, 2026
Merged

TaprootFreak merged 10 commits into
developfrom
feat/0e7e13f0-nostr-zappers

Conversation

@TaprootFreakAI

@TaprootFreakAI TaprootFreakAI commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

EN:
Replies written by someone without a 21.gifts account now carry a "Visitor" badge, so nobody can pose as a member or as the team. Their text renders as plain text: no auto-links, no quoted-note embeds, also after translation. Link previews of such a reply contain no visitor-chosen text at all. The api sends such rows only for people who sent bitcoin to a post; the new via field is optional, so this change is safe to merge before or after the api side (21gifts/api#198).

DE:
Antworten von Personen ohne 21.gifts-Konto tragen jetzt das Abzeichen „Besucher“, damit sich niemand als Mitglied oder als Team ausgeben kann. Ihr Text erscheint als reiner Text: keine automatischen Links, keine eingebetteten Beitragszitate, auch nach der Übersetzung. Link-Vorschauen einer solchen Antwort enthalten keinerlei vom Besucher gewählten Text. Die api liefert solche Zeilen nur für Personen, die Bitcoin an einen Beitrag gesendet haben; das neue Feld via ist optional, der Merge ist also vor oder nach der api-Seite (21gifts/api#198) sicher.

Details

Schema

  • forumMessageSchema accepts the optional literal via: 'nostr'. It is strict on purpose: the public feed fails closed, and the reply fetchers skip an invalid row.
  • hiddenMessageSchema accepts any non-empty via, so an unexpected value can neither blank the moderators' list nor drop the marker.

Badge

  • Same anatomy as the role badge in docs/ui.md, never colour-coded.
  • The visible copy is technology-neutral (Visitor / Besucher / Visitante / Bisita), following principle 4 in docs/ui.md.
  • ForumBoard (note and reply author line): a button that toggles the existing per-row hint state.
  • The unsigned permalink card, the nested quoted card and the moderators' hidden list: a non-interactive span.
  • The quoted-card link announces the visitor to assistive tech (forum.quotedNoteVisitor).

Plain text

  • LinkedText, ForumNoteText and NoteTranslate gain an optional plain prop (default off).
  • Every render site uses it for rows with via instead of ForumQuotedBody; a /messages/<uuid> URL in such a row stays visible text.
  • Rows without via render the same DOM and classes as before.

Link previews

  • publicMessageOgMetadata returns fully generic metadata for a note with via: fixed title, fixed description and the default image. Nothing from the note's name, text or photo reaches a preview.

Screen variants

  • /welcome expanded-visitor and /messages/[id] visitor-reply, with handbook entries, needles, shotScreen calls, eight Linux baselines, the regenerated variant catalog and behavioural e2e tests (badge, hint, URL is not a link).

Unchanged on purpose

  • The pay control stays driven by payable (the api sends false for such rows).
  • The staff delete control stays driven by the viewer's role.
  • No link to any external profile.
  • Notifications carry no marker, because the api sends a generic sender name for these replies.

CI

@TaprootFreakAI TaprootFreakAI changed the title 0e7e13f0 - Mark replies from external Nostr zappers with a via Nostr badge 0e7e13f0 - Mark replies from visitors without an account and render them as plain text Sep 18, 2026
Accept the optional via field on forum messages, show a via Nostr badge with a hint on the board and a plain badge on the public thread and quoted cards, and render such rows as plain text without auto-links or quoted-note embeds. Adds the expanded-nostr and nostr-reply screen variants with handbook and e2e coverage.
The seeded PNGs are copies of neighbouring states so the handbook image sync can start the e2e web server; the next commit replaces them with the Linux Chromium output of the visual jobs.
…y in its test

Replaces the seeded PNGs with the Linux Chromium output of the four visual jobs. The via note test now clears the shared fetchPublicMessage mock before asserting that no quoted note is fetched.
…, quotes and the hidden list

The visible badge copy no longer names the protocol (docs/ui.md principle 4). The social preview title of a visitor note is prefixed, the quoted-card link announces the visitor, and the moderators' hidden list shows the badge. Fixture names and the expanded-nostr needle follow the new copy; the eight baselines are refreshed in the next commit.
…idden list, rename the variants

A note with a via value now gets fully generic preview metadata, so no visitor-chosen name or text reaches a link preview. The moderators' hidden list accepts any non-empty via and still shows the badge. The two new screen variants are renamed to expanded-visitor and visitor-reply so no label on the handbook screens page names the protocol, the generated variant catalog is committed, and docs/ui.md lists the hidden-list badge.
…r-reply needle

Adds the /moderate/hidden visitor variant with its handbook entry, a behavioural and a visual e2e test, the regenerated variant catalog and seeded baselines that the next commit replaces with the Linux Chromium output. The visitor-reply needle is now the reply text the permalink visual test asserts.
Replaces the seeded PNGs with the Linux Chromium output. Badge lookups use an exact text match so the note text 'Hidden visitor note' cannot satisfy them.
A count-zero assertion with an exact name would miss a stray control whose name merely contains the word, so the two negative lookups match case-insensitively again; positive lookups stay exact.
@TaprootFreakAI
TaprootFreakAI force-pushed the feat/0e7e13f0-nostr-zappers branch from eeedf2e to 38a9ff8 Compare September 20, 2026 08:40
@TaprootFreakAI

Copy link
Copy Markdown
Collaborator Author

EN:
Six review passes were needed until all four review lanes reported zero findings (reviewed at eeedf2e, since rebased without conflicts onto develop as 38a9ff8). Replies from Nostr users without a 21.gifts account get a via Nostr badge and render as plain text without auto-links.

DE:
Sechs Review-Durchläufe waren nötig, bis alle vier Review-Lanes null Mängel meldeten (geprüft an eeedf2e, danach konfliktfrei auf develop rebased als 38a9ff8). Antworten von Nostr-Nutzern ohne 21.gifts-Konto bekommen das Abzeichen via Nostr und erscheinen als reiner Text ohne automatische Links.

Details

The summary sentence names the api field. The rendered badge copy is "Visitor" and never names the protocol.

What the passes changed

  • The badge copy became technology-neutral (docs/ui.md principle 4).
  • Link previews of such a reply are fully generic, so no visitor-chosen string reaches them.
  • The moderators' hidden list shows the badge, tolerates an unknown via value, and its badge state is a gated screen variant with handbook entry, e2e test and four baselines.
  • The quoted-card link announces the visitor to assistive tech.
  • The two new variants are named expanded-visitor and visitor-reply, and the generated variant catalog is committed.
  • In the e2e specs, positive lookups of the new copy are exact and negative lookups are broad.

Decided, not changed

Checks at head 38a9ff8

@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review September 20, 2026 08:45
@TaprootFreak
TaprootFreak merged commit 9a87a03 into develop Sep 20, 2026
12 checks passed
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.

2 participants