Skip to content

feat(pulse): rich text editor with @mentions, media uploads, and formatting#407

Merged
wesbillman merged 6 commits into
mainfrom
pulse-rich-input
Apr 27, 2026
Merged

feat(pulse): rich text editor with @mentions, media uploads, and formatting#407
wesbillman merged 6 commits into
mainfrom
pulse-rich-input

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the plain ComposeNote textarea with the shared ForumComposer, giving Pulse posts full Tiptap rich-text editing: markdown, bold/italic/strike/code, blockquotes, lists, and links
  • Wire @mention autocomplete populated from the user's contact list (contacts + agents + self) through a new externalMembers parameter on useMentions
  • Pass mention_pubkeys and media_tags through the publish pipeline (TypeScript → Tauri → Rust) so mentions and media uploads are included in published notes
  • Fix @mention popup being clipped by removing overflow-hidden from the PulseView outer container
  • Fix duplicate Tiptap Link extension warning by disabling StarterKit's built-in Link (we configure it separately)
  • Strengthen toggle active-state styling (bg-primary/20 + ring) so formatting toolbar buttons clearly show when active
  • Delete ComposeNote.tsx (fully replaced, net -17 lines)

Test plan

  • Open Pulse, verify rich text editor renders with formatting toolbar
  • Type @ and verify mention autocomplete popup appears above the input with contacts
  • Toggle bold/italic/etc and verify toolbar buttons show distinct active state
  • Paste/drag an image and verify media upload works
  • Publish a note with mentions and verify p tags appear in the published event
  • Verify no [tiptap warn]: Duplicate extension names in console
  • Verify channel composer still works as before (no regression)

🤖 Generated with Claude Code

wesbillman and others added 5 commits April 27, 2026 13:05
Swap the basic ComposeNote textarea for the shared ForumComposer,
giving Pulse posts full rich-text editing: markdown, @mentions from
the contact list, #channel links, emoji autocomplete, media uploads
with imeta tags, and a formatting toolbar with visible active states.

- Wire mention_pubkeys and media_tags through publishNote → Tauri → Rust
- Add externalMembers param to useMentions for non-channel contexts
- Remove overflow-hidden on PulseView outer div so mention popup isn't clipped
- Fix duplicate Tiptap Link extension warning (disable StarterKit's built-in)
- Strengthen toggle active-state styling (bg-primary/20 + ring)
- Delete ComposeNote.tsx (fully replaced)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous 20% opacity tint was too subtle to notice. Switch to
full bg-primary + text-primary-foreground so active formatting
buttons (bold, italic, etc.) are unmistakable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace useEditorState with a direct editor.on("transaction")
subscription to ensure active-mark state (bold, italic, etc.)
always triggers re-renders in the FormattingToolbar. The previous
approach may have had issues with React.memo preventing updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Radix Toggle with plain <button> elements and direct
conditional class toggling via cn(). Active buttons get
bg-primary + text-primary-foreground directly from the className
ternary — no data-state attribute, no Radix state management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same fix as the formatting buttons — bypass Radix Toggle for the
Aa formatting-panel toggle. Uses plain <button> with cn() ternary
for active state (bg-primary + text-primary-foreground).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesbillman

Copy link
Copy Markdown
Collaborator Author

@codex please review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a2fe12a1b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +406 to +407
onSubmit={(content, mentionPubkeys, mediaTags) => {
publishMutation.mutate({ content, mentionPubkeys, mediaTags });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep Pulse draft when publish mutation errors

Switching Pulse to ForumComposer here calls publishMutation.mutate(...) fire-and-forget, while ForumComposer clears content/attachments before invoking onSubmit; if publish fails (offline, auth, relay error), the user's draft is lost and cannot be retried. This is a user-facing regression from the previous ComposeNote flow, which awaited publish and preserved the draft on error.

Useful? React with 👍 / 👎.

ForumComposer now saves draft state before clearing and restores it if
onSubmit rejects. Callers switched from mutate to mutateAsync so the
promise propagates, preventing silent draft loss on network/auth errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesbillman wesbillman merged commit 5a93403 into main Apr 27, 2026
13 checks passed
@wesbillman wesbillman deleted the pulse-rich-input branch April 27, 2026 20:57
tlongwell-block added a commit that referenced this pull request Apr 28, 2026
* origin/main:
  Add multi-workspace support to desktop app (#409)
  feat(mobile): add #channel autocomplete to compose bar (#411)
  fix: close race window that dropped active channel messages (#410)
  feat(pulse): rich text editor with @mentions, media uploads, and formatting (#407)
  feat(mobile): multi-workspace support (#408)
  feat: always notify on DM messages like Slack/Discord (#405)
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.

1 participant