Commit Graph
2004 Commits
Author SHA1 Message Date
Rye ed689792ee implement per message profile management functions 2026-03-16 17:44:30 +01:00
Evie Gauthier 621f402ede Merge pull request #288 from SableClient/fix/thread-fallback-reply-spec
fix: set m.in_reply_to fallback to latest thread event per spec
2026-03-15 18:58:07 +00:00
Evie Gauthier f8bb692093 chore: fix import order and add changeset 2026-03-15 14:54:46 -04:00
Evie Gauthier 0f7e6497e4 fix(direct): prevent double-badge on /direct/ icon for rooms in sidebar
The /direct/ icon badge was counting unread for all DMs, including
those already displayed as individual avatar entries in the sidebar
via DirectDMsList. This caused users to see duplicate badges — one
on the avatar entry and one on the /direct/ icon — for the same room.

Extract useSidebarDirectRoomIds hook (shared by DirectDMsList and
DirectTab) that returns the room IDs currently shown as sidebar
avatars. DirectTab now computes its badge only for DMs that overflow
beyond the MAX_SIDEBAR_DMS (3) limit shown in the sidebar.

Closes #235
2026-03-15 14:47:43 -04:00
Evie Gauthier 6a36f5dc1c fix: resolve string | undefined type error for thread event_id 2026-03-15 14:03:34 -04:00
Evie Gauthier df8e5e0cc7 style: fix prettier formatting in RoomInput 2026-03-15 13:58:13 -04:00
Evie Gauthier 43dba190ff fix: set m.in_reply_to fallback to latest thread event per spec 2026-03-15 13:31:29 -04:00
Evie Gauthier 76fa7f3030 fix: prevent event listener accumulation during sync retries
- Add unreadInfoRef in RoomTimeline; remove unreadInfo from useLiveEventArrive
  callback deps and LocalEchoUpdated effect deps to stop per-message listener churn
- Fix CallEmbed .bind(this) leak: bind handlers once in start(), push cleanup to
  disposables so dispose() correctly removes all listeners
- Add stable refs in useCallSignaling for mutedRoomId/ring callbacks; tighten
  effect deps to [mx, mDirects, setMutedRoomId] to prevent SessionEnded listener
  accumulation during sync retry cycles
2026-03-15 01:27:19 -04:00
Evie Gauthier 1bd5281c93 fix(timeline): stable callback ref pattern for room event listener hooks
useLiveEventArrive, useRelationUpdate, useLiveTimelineRefresh, and
useThreadUpdate each passed their callback argument into the useEffect
dependency array. This caused the listener to be removed and re-added
every time the callback identity changed (e.g. when unreadInfo toggled
or when any other parent-scope value included in the useCallback deps
changed).

Under normal conditions React's synchronous effect cleanup guarantees
one listener at a time. But during sliding-sync error/retry cycles the
client emits MaxListenersExceededWarning (11 session_ended, 51
RoomState.events) confirming that listeners accumulate. When the
callbacks change fast enough — or React defers cleanup in concurrent
mode — multiple handleTimelineEvent instances are live simultaneously.
Each one independently calls setTimeline({ range: start+1, end+1 }) for
the same arriving event, producing the spurious scroll jumps reported.

Fix: use the stable callback ref pattern in all four hooks.
- Add a ref (onArriveRef / onRelationRef / onRefreshRef / onUpdateRef)
- Assign ref.current = callback on every render (always up-to-date)
- Remove the callback from the useEffect dep array (effect runs only
  when `room` changes)
- Inside handlers, delegate via ref.current() instead of the captured
  closure value

The event listener identity is now stable for the entire lifetime of
each room mount. Listener counts stay at 1 regardless of how many
re-renders occur or how many sync error/retry cycles fire.
2026-03-15 01:27:04 -04:00
Evie Gauthier 832f597d6a fix(timeline): don't force scroll-to-bottom on sync gap when scrolled up
When a sliding-sync limited response fires RoomEvent.TimelineReset (or
the app fires RoomEvent.TimelineRefresh) the useLiveTimelineRefresh
callback was unconditionally calling setAtBottom(true) and incrementing
scrollToBottomRef, scrolling the user to the bottom even if they had
scrolled up to read history.

Three coordinated changes:

1. Add RoomEvent.TimelineReset handler to useLiveTimelineRefresh.
   The SDK emits TimelineReset on the EventTimelineSet (not the Room)
   when a limited sync response replaces the live EventTimeline. Without
   this listener the stored linkedTimelines reference the old detached
   chain; back-pagination silently no-ops, freezing the room.

2. Gate the viewport scroll on atBottomRef.current (prior position).
   Capture wasAtBottom before calling setTimeline(getInitialTimeline).
   Only call setAtBottom(true) and increment scrollToBottomRef when the
   user was already at the bottom. When scrolled up we still reinit the
   timeline (the old chain is gone) but avoid the forced scroll.

3. Add timelineJustResetRef to allow the self-heal effect to run when
   atBottom=false after a reset. The SDK fires TimelineReset before
   populating the fresh timeline, so getInitialTimeline sees range.end=0.
   Without the atBottom guard bypass the range stays at {0,0} as events
   arrive, leaving the virtual paginator rendering nothing. The ref is
   cleared on first successful heal, after which normal atBottom-gated
   behaviour resumes.
2026-03-15 01:27:04 -04:00
7w1 4925f0f579 Merge pull request #176 from dozro/feat/audio-recordings
Add voice message functionality
2026-03-14 21:59:07 +00:00
7w1 b2728598a0 Merge pull request #262 from dozro/fix/sticker-picker-webkit-speed-optimizations
Implement opt-in experimental bandwidth saving for stickers and emojis
2026-03-14 19:17:35 +00:00
7w1 8e67dbacbe Merge pull request #264 from piko-piko/urlpreview-middleclick
Middle click to open the url preview card thumbnail in a new tab
2026-03-14 15:16:24 +00:00
piko-piko 02aa299558 fixed formatting; fixed linting issues 2026-03-14 14:55:26 +01:00
7w1 28073b57a0 Merge pull request #253 from Vespe-r/small-notifications
Add width limit to notification banners
2026-03-14 12:38:55 +00:00
piko-piko 93c51ce6cc Middle click to open the preview card thumbnail in a new tab 2026-03-14 12:22:31 +01:00
Rye 8e07ab9911 implement bandwidth saving feature for stickers and emojis, but because it will increase server load make it opt-in and experimental 2026-03-14 05:45:44 +01:00
Evie Gauthier aed7b76f08 fix: resolve merge conflict markers and restore non-thread files from upstream 2026-03-13 23:48:22 -04:00
Evie Gauthier 0516054580 chore: remove non-thread files and references 2026-03-13 23:33:33 -04:00
Evie Gauthier dfcefe0d58 chore: remove thread-mockup and check-quality.sh, restore CallControls
- 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
2026-03-13 23:30:01 -04:00
Evie Gauthier 897ad0e7c3 fix(threads): add explicit type annotations to ThreadBrowser callbacks 2026-03-13 23:30:01 -04:00
Evie Gauthier e617ce0b1e feat(threads): add supporting features and infrastructure
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)
2026-03-13 23:30:01 -04:00
Evie Gauthier 516cd3d51e feat(threads): add thread reply input handling
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
2026-03-13 23:30:01 -04:00
Evie Gauthier 04495680a1 feat(threads): integrate threads into room timeline and header
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
2026-03-13 23:27:42 -04:00
Evie Gauthier 155492146d feat(threads): implement ThreadDrawer and ThreadBrowser components
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
2026-03-13 23:26:57 -04:00
Evie Gauthier cc22321cf7 feat(threads): add core thread state management and types
- 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
2026-03-13 23:26:57 -04:00
7w1 78ebffac2e Merge pull request #257 from dozro/compat/msc2723-msg-forwarding
add MSC2723 forwarding meta data for more compatibility
2026-03-14 03:15:13 +00:00
Evie Gauthier a4447dda6a Merge pull request #255 from Just-Insane/fix/media-and-chunk-errors
fix: Media blob cache and chunk loading error handling
2026-03-14 02:27:06 +00:00
Evie Gauthier f67abc05d7 fix: format src/index.tsx and add changeset 2026-03-13 22:25:30 -04:00
Evie Gauthier ea22db6d7d Merge pull request #245 from Just-Insane/feat/internal-debug-logging
feat: Add internal debug logging system
2026-03-14 02:24:28 +00:00
Evie Gauthier 2292a14571 fix(lint): suppress intentional ref read in BackgroundNotifications cleanup 2026-03-13 22:22:11 -04:00
Evie Gauthier 188f588ce7 fix(lint): adjust RoomTimeline callback dependencies for exhaustive-deps 2026-03-13 22:21:51 -04:00
Evie Gauthier 79e4e09436 fix(lint): resolve react-hooks/exhaustive-deps, arrow-body-style, and no-plusplus errors 2026-03-13 22:17:13 -04:00
Evie Gauthier 1261c3b2a0 fix(notifications): move variable declarations before use in debug log 2026-03-13 22:14:30 -04:00
Rye 9f65957442 add MSC2723 forwarded message props for compatibility with MSC2723 specifications 2026-03-14 03:12:56 +01:00
7w1 3b14c34142 Merge pull request #256 from dozro/sec/strip-beeper-pmp-on-forward
strip beeper's per message profile when forwarding
2026-03-14 02:12:04 +00:00
Evie Gauthier 54ac93c39a chore: fix formatting and linting issues for CI 2026-03-13 22:10:36 -04:00
Rye bb787c504c added forward meta data for public original messages as defined in MSC2723
see https://github.com/matrix-org/matrix-spec-proposals/pull/2723
2026-03-14 02:59:42 +01:00
Rye 40950a728f strip beepers per message profile on forward
fixes https://github.com/SableClient/Sable/issues/254
2026-03-14 02:48:39 +01:00
Evie Gauthier 83262b3593 feat: enhance debug logging and fix background notifications
Debug logging:
- Add logging to LeaveRoomPrompt, CreateRoom, Space, AccountSwitcherTab
- Add build version to debug log exports
- Add network/sync logging to initMatrix

Background notifications:
- Add explicit listener cleanup before stopping clients
- Add exponential backoff retry for failed background clients (5 attempts)
- Add 30s timeout to waitForSync to prevent indefinite hangs
- Use useMemo for inactive sessions array
- Track cleanup callbacks per client
2026-03-13 21:25:34 -04:00
Evie Gauthier 9c017b85cf feat(debug-logging): enhance sync logging and fix filter button issue
- Add comprehensive sync cycle logging in slidingSync.ts:
  - Track room count changes per list with deltas
  - Log initial sync completion with timing and room counts
  - Monitor list expansion progress with detailed stats
  - Detect slow sync cycles (>1s) and expansions (>500ms)
  - Track network connectivity changes with connection info
  - Log attach/dispose lifecycle with diagnostics
  - Add error logging for list operations

- Fix filter button closing settings dialog in DebugLogViewer:
  - Add stopPropagation to category/level menu button handlers
  - Prevents event bubbling that was closing parent dialog

- Add .envrc for automatic Node 24 environment activation via direnv
- Add .nvmrc to specify Node v24.14.0 requirement
2026-03-13 21:25:34 -04:00
Evie Gauthier c123cfefb2 fix(debug-logger): Fix TypeScript error with filters.since undefined check 2026-03-13 21:25:34 -04:00
Evie Gauthier 44029b6a5c fix(debug-logger): Fix PopOut component pattern and state management
- Change debugLoggerEnabledAtom from getter function to direct value atom to properly update UI
- Convert PopOut components from children function to anchor-based pattern
- Add click handlers for category and level filter menus
- Fix TypeScript errors with entry.data unknown type checks
- Filters should now display correctly when clicked
2026-03-13 21:25:34 -04:00
Evie Gauthier c647d561c1 fix build issue 2026-03-13 21:25:34 -04:00
Evie Gauthier 4624617bbf feat: add UI and timeline debug logging
- Add 'ui' and 'timeline' log categories to debugLogger
- Log Room component mount/unmount and drawer state changes
- Log RoomTimeline lifecycle events (mount, unmount, initialization)
- Track timeline pagination (start, complete, errors)
- Monitor live timeline linking state changes
- Log scroll position changes (at bottom, scrolled up)
- Track jump-to-event operations
- Log timeline refresh events
- Add UI and Timeline category filters in DebugLogViewer
- Update description to mention new categories

This provides comprehensive visibility into UI component lifecycle
and timeline visualization state for debugging issues with room
rendering, timeline scrolling, and UI element visibility.
2026-03-13 21:25:34 -04:00
Evie Gauthier bcf5a84220 feat: add internal debug logging system
- Add comprehensive debug logger utility with circular buffer (1000 entries max)
- Add debug log state management with Jotai atoms
- Create DebugLogViewer UI component with real-time updates and filtering
- Integrate debug logger into Developer Tools settings
- Add logging for sync state changes (initMatrix, slidingSync)
- Add logging for authentication (login, logout, session management)
- Add logging for push notifications (permissions, subscriptions)
- Add logging for app lifecycle (visibility changes, backgrounding)
- Add logging for network connectivity (online/offline)
- Add logging for notifications (filtering, routing, mute decisions)
- Add logging for messages (send success/failure, uploads, scheduled)
- Add logging for calls (widget lifecycle, join/hangup, events)
- Support filtering by category and level
- Support exporting logs as JSON (all or filtered)
- Support copying logs to clipboard
2026-03-13 21:25:34 -04:00
Evie Gauthier 24fbbc0dc2 Add automatic retry for chunk loading failures
- Global error handler catches chunk load errors
- Auto-reload on first 2 failures without user intervention
- On 3rd failure, let error bubble to Sentry error boundary
- Uses sessionStorage to track retry count across reloads
- Clears counter on successful page load
- Prevents stale HTML from breaking app after deployments
2026-03-13 21:20:22 -04:00
Evie Gauthier 8fd844e5cd fix: unhandled promise rejection in media blob cache
Fixes unhandled promise rejection when multiple components fetch
the same media URL and the initial request fails with 401.

### Root Cause
When a blob fetch request was in-flight and failed, subsequent callers
awaiting the same promise would receive an unhandled rejection because
the await was outside the try-catch block.

### Changes
1. useBlobCache: Wrap inflightRequests.get() await in try-catch
2. useBlobCache: Improve error message to include HTTP status
3. Service Worker: Add logging for session retrieval failures to
   diagnose authentication issues with media requests

Addresses Sentry issue with 401 errors on authenticated media endpoints.
2026-03-13 21:20:22 -04:00
Vesper d47e0a3efc Add width limit to notification banners 2026-03-13 22:20:50 +00:00
7w1 1b97bb8780 fix call preferences not persisting 2026-03-13 14:16:09 -05:00