Skip to content

feat(event-bar): point XPOST @handle link at the user's X profile#838

Merged
11k merged 3 commits into
masterfrom
feat/xpost-view-post-button
May 29, 2026
Merged

feat(event-bar): point XPOST @handle link at the user's X profile#838
11k merged 3 commits into
masterfrom
feat/xpost-view-post-button

Conversation

@11k

@11k 11k commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a "View Post on X" button below the post text inside .event-bottom of the XPOST event card, with subtle resting/hover styling.
  • Repoints the @handle link in the same card from the post URL to the user's X profile (https://x.com/<handle>), so username → profile and button → specific post matches the standard X convention.

Test plan

  • npm run lint from chat-gui/ is clean.
  • In a local build (npm start), dispatch an XPOST event through the dev harness; confirm the expanded card renders the new button below the post text and that resting/hover backgrounds read clearly.
  • Hover the @handle link — status bar should read https://x.com/<handle> with no /status/... suffix. Click — opens the profile in a new tab.
  • Click "View Post on X" — opens https://x.com/<handle>/status/<postId> in a new tab.
  • End-to-end (optional): npm link dgg-chat-gui into website/ and trigger admin → X → "Test connection"; verify both links resolve correctly against a real broadcast.

11k added 2 commits May 29, 2026 09:41
The expanded card already wraps @handle in a link, but it looks like
a chat username and reads as inline text rather than an affordance.
Add a dedicated button below the post text inside .event-bottom that
opens the post on x.com in a new tab.

No template change — ChatXPostMessage builds the element in JS and
appends it next to the post text it wraps in .event-bottom-text.
The @handle in the expanded card and the new "View Post on X" button
both linked to the post URL — redundant. Username now opens the X
profile (https://x.com/<handle>); the button still opens the post.
Matches the standard X convention of username → profile.
@11k 11k added the enhancement New feature or request label May 29, 2026
ChatXPostMessage was creating its anchors imperatively via
document.createElement, out of step with how the other event
classes (donation, subscription, broadcast) clone #user-template
for sub-elements.

Reuse #user-template for the @handle link and add a small
#xpost-link-template that owns the static markup of the
"View Post on X" button. The JS now only sets dynamic values
(href and the handle text).
@11k 11k merged commit efec3ca into master May 29, 2026
2 checks passed
@11k 11k deleted the feat/xpost-view-post-button branch May 29, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant