Repository navigation
feat: Maintainer badge and configurable attribution line - #47
Merged
Merged
Conversation
New branch off main: badge label "Maintainer" and header attribution line,
per Robbert's decisions.
1. Maintainer badge. The hub is adding author_role: "maintainer"|"community"
to public case responses (comments already carry it). New shared
assets/src/badges.jsx MaintainerBadge renders a single, consistent
"Maintainer" badge (rt-badge rt-b-maintainer — a solid accent fill,
visually distinct from the light-tint type badges) next to the author
handle in: TopicRow (shared by every list — all/participating/roadmap/
started), TopicDetail's header meta row and its own post-author line, and
CommentRow. Comments previously rendered "Maintainer" via a generic
rt-role-badge shared with the "{agent} · Assistant" label — unified the
maintainer case onto the new component/class instead of adding a second
look; the assistant badge is untouched. assets/src/topics.js's
mapCaseToTopic now maps author_role onto authorRole, defaulting to
'community' when the hub omits it so the UI keeps working against an
older hub. Badge spacing: rt-b-maintainer carries its own margin-left for
the non-flex contexts (rt-cm-who, rt-post-who, matching their existing
6px-per-child convention); rt-cmeta's flex gap already spaces it, so that
context zeroes the margin back out.
2. Attribution line. New Config::$attribution (?string, default null),
passed through Page::enqueue()'s boot payload like the other strings. The
SDK carries no hardcoded vendor text — assets/src/community-app.jsx
renders it as one line directly under the page header
(`<p class="rt-sub rt-attribution">`, reusing the existing muted/small
header typography) only when non-empty; Preact's default text-child
escaping means no unsafe HTML can land in the DOM.
Tests: PageTest (attribution passthrough, present/absent) and ConfigTest
(default null, override) following the existing beta/enableChat pattern;
badges.test.mjs, plus maintainer-vs-community render assertions in
topic-list.test.mjs, topic-detail.test.mjs (header + post-author line),
topics.test.mjs (authorRole default/passthrough, resolveCommentRole's direct
author_role: 'maintainer' case), config.test.mjs, and community-app.test.mjs
(present/absent/escaped). CommentRow's maintainer branch itself isn't
exercised through a populated TopicDetail render — comments never populate
in this SSR-only test harness (no window.fetch, and useEffect doesn't run) —
so its correctness rests on the already-tested MaintainerBadge output plus
resolveCommentRole/mapCommentToView's role derivation.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Renders a unified "Maintainer" badge next to the author wherever one renders (topic rows, detail header, post-author line, comments) driven by the hub's author_role field (defaulting to community against older hubs), and adds an optional Config::attribution string rendered as one quiet line under the page header (host plugin supplies the sentence; plain-text escaped).
Tests: JS 167/167, PHP 223/223, phpcs + phpstan clean; bundle rebuilt and committed.
🤖 Generated with Claude Code