Skip to content

feat: reply attribution, user status (haiku detection sadly removed)#422

Merged
barrydeen merged 4 commits intobarrydeen:mainfrom
dmnyc:post-ui-improvements
Apr 5, 2026
Merged

feat: reply attribution, user status (haiku detection sadly removed)#422
barrydeen merged 4 commits intobarrydeen:mainfrom
dmnyc:post-ui-improvements

Conversation

@dmnyc
Copy link
Copy Markdown
Contributor

@dmnyc dmnyc commented Apr 3, 2026

Summary

Reply-to Attribution

  • Show "replying to [name]" below the display name on posts that are replies
  • Resolves the reply-to author from the first p-tag via eventRepo.getProfileData()
  • Tapping the name navigates to their profile
  • Matches the pattern used by Amethyst (visible in screenshot comparison)

User Status Display & Editing (NIP-38, kind 30315)

  • Subscription: Request kind 30315 alongside kind 0 in OutboxRouter.requestProfiles, MetadataFetcher retry path, and self-data startup subscription
  • Event routing: Route kind 30315 from EventRouter to addEvent; also process in cacheEvent to avoid seenEventIds dedup race where cacheEvent runs first and addEvent skips the event
  • Caching: Store "general" status per pubkey in EventRepository with expiration support; empty content clears the status
  • Display: Italic faded text under the display name in PostCard, matching Amethyst/Damus style
  • Editing: Tap "Set status..." in the navigation drawer to open a dialog. Publishes kind 30315 with d-tag "general" to write relays. Submit with empty text to clear.

Misc

  • Add app/temp/ to .gitignore

Test plan

  • Open a reply post in the feed — verify "replying to [name]" appears below the author name
  • Tap the reply-to name — verify it navigates to that user's profile
  • Set a status from Amethyst or Damus — verify it appears under your name on posts in Wisp
  • Check other users with statuses — verify their status shows under their name
  • Tap "Set status..." in drawer — set a status — verify it publishes and displays
  • Clear status (submit empty) — verify it disappears
  • Status with expiration tag in the past should not display

🤖 Generated with Claude Code

@dmnyc dmnyc force-pushed the post-ui-improvements branch from b9b7281 to adcacda Compare April 3, 2026 17:26
@barrydeen
Copy link
Copy Markdown
Owner

lol you actually did it, thought you were meming, can you please remove the haiku code, i don't want us to start getting into a situation where we are maintaining code for different types of bots. People can just block it. The other two look good though i'll give them a spin

dmnyc added 3 commits April 3, 2026 16:13
Show "replying to [name]" below the display name when a post is a
reply. The reply-to author is resolved from the first p-tag via
eventRepo. Tapping the name navigates to their profile.
Subscribe to kind 30315 events alongside profile metadata in
OutboxRouter, MetadataFetcher, and self-data startup subscription.
Process status events in both addEvent and cacheEvent paths in
EventRepository to avoid seenEventIds dedup race. Route kind 30315
from EventRouter to addEvent for events from unknown subscriptions.

Display status in italic faded text under the display name in
PostCard, matching the style used by Amethyst and Damus.

Add status editor in the navigation drawer — tap "Set status..."
below the nip05 to open a dialog. Publishes kind 30315 with d-tag
"general" to write relays. Empty content clears the status.
@dmnyc dmnyc force-pushed the post-ui-improvements branch from adcacda to 7a8bafa Compare April 3, 2026 20:15
@dmnyc
Copy link
Copy Markdown
Contributor Author

dmnyc commented Apr 3, 2026

Haiku detection has been yeeted. RIP 🪦🍃

@dmnyc dmnyc changed the title feat: reply attribution, user status, haiku detection feat: reply attribution, user status (haiku detection sadly removed) Apr 3, 2026
- Extract duplicate NIP-38 status processing into shared helper method
- Add timestamp tracking so out-of-order status events don't regress
- Fix reply attribution to use reply target event's pubkey instead of
  first p-tag (which may be an unrelated mention)
- Make replyToName reactive via profileVersion so it updates when
  profiles load instead of showing hex permanently
@barrydeen
Copy link
Copy Markdown
Owner

Pushed a fixup commit addressing code review concerns:

Bug fixes:

  • Reply attribution used wrong pubkey — was using the first p-tag, which could be any mentioned user, not the reply target's author. Now resolves the pubkey from the actual reply target event via Nip10.getReplyTarget(), falling back to the first p-tag only if the target event isn't cached.
  • Reply-to name not reactivereplyToName was computed once with remember(replyToPubkey) and never updated when the profile loaded. Now keys on profileVersion so it recomposes when profiles arrive (shows the real name instead of staying as hex).
  • NIP-38 status timestamp tracking — out-of-order event delivery could regress a newer status to an older one. Added userStatusTimestamps map so older events are ignored.

Cleanup:

  • Deduplicated NIP-38 processing — the status handler was copy-pasted between addEvent and cacheEvent with subtle differences. Extracted into a single processUserStatus() helper used by both paths.

@barrydeen barrydeen merged commit c93395a into barrydeen:main Apr 5, 2026
@dmnyc dmnyc deleted the post-ui-improvements branch April 5, 2026 02:35
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