Skip to content

feat(threads): implement thread side panel with full functionality#123

Merged
Just-Insane merged 10 commits intoSableClient:devfrom
Just-Insane:feat/threads
Mar 14, 2026
Merged

feat(threads): implement thread side panel with full functionality#123
Just-Insane merged 10 commits intoSableClient:devfrom
Just-Insane:feat/threads

Conversation

@Just-Insane
Copy link
Contributor

@Just-Insane Just-Insane commented Mar 10, 2026

Summary

Implements Matrix thread support with side panels, browser, and notification integration.

Features

  • Thread Drawer: Side panel for viewing and replying within threads
    • Full message rendering with replies, reactions, edits, and deletions
    • Emoji picker and sticker support
    • Automatic read receipt management
  • Thread Browser: Panel listing all room threads with search functionality
  • Thread Chips: Visual indicators on messages that start threads
    • Shows reply count
    • Click to open thread
  • Unread Badge: Discord-style notification badge on thread icon showing unread count
  • Cross-device Sync: Threads created on other devices automatically appear in list
    • Initializes Thread objects from room history on mount
    • Auto-creates Thread objects when receiving new thread events
  • Notification Integration: Clicking inbox notifications for thread replies opens the thread

Implementation Details

  • Uses matrix-js-sdk Thread API (room.createThread(), room.getThreads())
  • Filters thread replies from main timeline
  • Scans timeline on mount to initialize Thread objects for existing threads
  • Auto-creates Thread objects when receiving ThreadEvent.New
  • Auto-opens drawer when navigating to thread events from notifications
  • Tracks unread status using thread.getEventReadUpTo() and thread.hasCurrentUserParticipated

Related

Future enhancement tracked in #124 to leverage SDK's thread-specific notification APIs (getThreadUnreadNotificationCount(), hasThreadUnreadNotification()).

@Just-Insane
Copy link
Contributor Author

Also Fixes #124 - Use the SDK's notification options, will properly respect user's notification settings.

@Just-Insane Just-Insane marked this pull request as ready for review March 10, 2026 05:58
@Just-Insane Just-Insane requested a review from a team March 10, 2026 05:58
@Just-Insane Just-Insane marked this pull request as draft March 10, 2026 12:11
@Just-Insane Just-Insane force-pushed the feat/threads branch 2 times, most recently from fa71c0a to 1d65bfa Compare March 10, 2026 18:17
@Just-Insane Just-Insane marked this pull request as ready for review March 10, 2026 19:16
@7w1
Copy link
Member

7w1 commented Mar 11, 2026

A few issues I found, not sure which ones overlap with #124 :

  • Pressing reply on a thread message does nothing.
  • Reactions don't render until something triggers a render (editing a message, sending a message, etc)
  • No view source button on thread messages.
  • Threads don't auto scroll down to latest message.
  • When jumping to a message in a thread there's no background indication so... can't really tell exactly what's being jumped to.
  • No hover effect on messages
  • No mention background colors

Also, maybe we should align the editor at the bottom with the main editor? Looks a bit weird having it lower down.

@Just-Insane Just-Insane marked this pull request as draft March 12, 2026 03:12
@Just-Insane
Copy link
Contributor Author

A few issues I found, not sure which ones overlap with #124 :

  • Pressing reply on a thread message does nothing.
  • Reactions don't render until something triggers a render (editing a message, sending a message, etc)
  • No view source button on thread messages.
  • Threads don't auto scroll down to latest message.
  • When jumping to a message in a thread there's no background indication so... can't really tell exactly what's being jumped to.
  • No hover effect on messages
  • No mention background colors

Also, maybe we should align the editor at the bottom with the main editor? Looks a bit weird having it lower down.

These should all be fixed now, if you want to test?

@Just-Insane Just-Insane marked this pull request as ready for review March 12, 2026 04:57
@Just-Insane Just-Insane marked this pull request as draft March 13, 2026 16:05
@Just-Insane Just-Insane marked this pull request as ready for review March 13, 2026 16:09
Just-Insane pushed a commit to Just-Insane/Sable that referenced this pull request Mar 13, 2026
# Conflicts:
#	src/app/features/room/Room.tsx
#	src/app/features/room/RoomInput.tsx
@Just-Insane Just-Insane force-pushed the feat/threads branch 3 times, most recently from 80879cc to cd4cc56 Compare March 13, 2026 20:32
@Just-Insane Just-Insane reopened this Mar 14, 2026
@Just-Insane Just-Insane marked this pull request as draft March 14, 2026 01:05
@Just-Insane Just-Insane marked this pull request as ready for review March 14, 2026 01:41
@Just-Insane Just-Insane enabled auto-merge March 14, 2026 02:09
@Just-Insane Just-Insane disabled auto-merge March 14, 2026 02:32
@Just-Insane Just-Insane added this pull request to the merge queue Mar 14, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 14, 2026
feat(threads): implement thread side panel with full functionality
@Just-Insane Just-Insane removed this pull request from the merge queue due to a manual request Mar 14, 2026
Evie Gauthier added 8 commits March 13, 2026 23:26
- Add roomToOpenThread atom family for tracking active thread per room
- Add roomToThreadBrowser atom family for thread browser visibility
- Add Thread, ThreadEvent, and NotificationCountType exports to matrix-sdk types
- Update toggleReaction to support thread timeline sets
- Foundation for thread feature state management
ThreadDrawer:
- Side panel for viewing and replying within threads
- Full message rendering with reactions, edits, deletions, replies
- Auto-scrolls to bottom on new replies
- Marks thread as read when viewing
- Isolated draft state per thread
- Emoji picker and sticker support

ThreadBrowser:
- List view of all threads in room sorted by latest activity
- Search functionality to filter threads by content
- Thread preview with root message, reply count, and latest reply
- Click to open thread in drawer
- Jump button to navigate to root message in main timeline

Both:
- Desktop: side panel mode
- Mobile: full-screen overlay mode
- Re-render on ThreadEvent updates
RoomTimeline:
- Add ThreadReplyChip component showing reply count, avatars, latest reply preview
- Filter thread replies from main timeline (keep only root messages)
- Add thread button to start threads from messages
- Exclude thread events from triggering timeline pagination
- Re-render on ThreadEvent updates for live reply counts
- Thread reply counts exclude root message, reactions, and edits

RoomViewHeader:
- Add thread button with unread badge using SDK notification APIs
- Initialize Thread objects from room history on mount
- Scan timeline for thread roots and thread replies
- Auto-create Thread objects for new thread events
- Toggle between thread drawer and thread browser
- Close drawer and open browser when clicking button with drawer open

Room:
- Render ThreadDrawer when thread is open (desktop: side panel, mobile: overlay)
- Render ThreadBrowser when browser open and no thread active
- Auto-open thread drawer when navigating to thread event IDs
- Coordinate openThreadId and threadBrowserOpen state

RoomViewFollowing:
- Support filtering read receipts by thread participant IDs
- Show thread-specific following indicator
RoomInput:
- Seed thread reply draft when opening drawer from notification
- Handle thread relation in message composition
- Support isolated draft state per thread
- Auto-populate replyTo when replying in thread
- Send messages with thread relation metadata
- Clear thread draft after sending reply
Editor:
- Fix Slate initialValue per-instance to support multiple editors
- Each editor (main timeline, thread drawer) maintains independent state
- Prevents value conflicts between simultaneous editors

Thread Mockup:
- Add ThreadMockupPage for development and design testing
- Full mockup UI with realistic thread interactions
- Navigation from WelcomePage for easy access
- Routes added for /mockup/threads path

Quality Tooling:
- Add check-quality.sh script for pre-push validation
- Runs type checks, lint, and builds before pushing
- Helps catch issues before CI/CD

CI/CD:
- Update GitHub Actions workflows for quality checks
- Update dependabot and cloudflare preview workflows
- Update docker-publish workflow
- Update require-changeset workflow

Call Preferences:
- Clean up unused imports in CallControls.tsx
- Remove orphaned callPreferences hook code

Changesets:
- Add feat-threads.md for minor version bump
- Remove fix_call_preferences.md (superseded)
- Remove src/app/features/thread-mockup/ directory and all mockup references
- Remove scripts/check-quality.sh
- Restore CallControls.tsx to origin/dev (removed unrelated changes)
- Verified RoomInput.tsx and RoomTimeline.tsx contain only thread-related changes
@Just-Insane Just-Insane added this pull request to the merge queue Mar 14, 2026
Merged via the queue into SableClient:dev with commit 61d5a2e Mar 14, 2026
7 checks passed
@Just-Insane Just-Insane deleted the feat/threads branch March 15, 2026 04:23
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