Commit Graph
106 Commits
Author SHA1 Message Date
7w1 4fbcfef90d feat: add editor multiline mode and many edge case fixes (#476)
### Description

Fixes #350

This adds a dynamic multiline layout to `CustomEditor`. When the message
input grows past a single line (word wrap, explicit newlines, or
multiple blocks), the editor shifts from a single-row layout into a
two-row grid, before/textarea on top, with responsive content spanning
the full width below. It drops back to single-row once the text fits on
one line again.

The old `replacementContent` prop (which swapped out the textarea on
mobile during voice recording) is gone. It's replaced by
`responsiveAfter`, which renders inline next to the send button in
single-line mode and moves down to the footer row in multiline mode.
There's also a `forceMultilineLayout` prop for when you want to push
into multiline immediately, which is what we use when the audio recorder
opens. This means the recorder now takes the same code path on desktop
and mobile instead of having a separate mobile-only branch.

A few other things got fixed along the way:

- Holding the record button on mobile was selecting the "following the
conversation" text underneath it. Fixed with `userSelect: none`.
(related to #350)
- The stop button's `onClick` was being skipped on mobile entirely, so
if `pointerup` got lost mid-drag there was no way to stop recording. Now
`onClick` works as a fallback when recording is already active. (a form
of recovery in case more situations like #350 happen again)
- The waveform bar count is now calculated from the actual container
width via `ResizeObserver` instead of a hardcoded number.
- `cleanupMediaRecorder` wasn't being called in all the
stop/delete/restart/error/unmount paths, which could leave the mic track
open. That's fixed.
- Firefox couldn't seek voice messages because `audio/webm` doesn't
include a seek index. Codec preference now puts `audio/ogg;codecs=opus`
first so Firefox records seekable blobs. Also added a `seekTo` helper
that waits for `loadedmetadata` if the audio element isn't ready yet,
and `audio.preload = 'auto'` + `audio.load()` on mount so Firefox parses
metadata right away.
- Multiline wrap detection is now debounced through
`requestAnimationFrame` and uses a `ResizeObserver` on the scroll
container to cut down on flicker and extra re-renders.
- Added cloudflared tunnels for easier testing on mobile

Also sorry for the cursed line height measurer, there was legit no other
way to detect it that didn't cause other issues.

Good amount of this was created with help of AI (like figuring out
options on how to fix the edge cases), especially the edge case unit
tests, but It had to be fixed by hand in many places and frankly I can't
tell you exactly where was what. I've been working on this for couple
days now.. (losing my mind over it)

### Screenshots:

https://github.com/user-attachments/assets/bcff3766-6c60-46c7-ac9e-a8b943a665d3

https://github.com/user-attachments/assets/367cdcc4-666e-4324-8e81-1b415feb0aca

#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings

### AI disclosure:

- [x] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
2026-03-23 04:02:36 +00:00
Rawrington 525d3e311d i forgot typescript is evil sometimes 2026-03-23 00:53:01 +00:00
Rawrington 2283cd6711 Small refactor. JoinExisting works for starting a call/joining a voice room. 2026-03-22 23:54:19 +00:00
Rawrington a3fda5a13c Silly CallIntent for video auto turning on 2026-03-22 22:54:40 +00:00
hazre e5d52300b5 docs: clarify editor and recorder internals 2026-03-22 19:18:52 +01:00
hazre 2af3c72e30 fix: voice message preview seeking not working on firefox 2026-03-22 18:13:09 +01:00
hazre 340d643233 fix: fully tear down voice recorder audio graph 2026-03-22 18:13:09 +01:00
hazre 35e842f768 fix: simplify mobile stuff 2026-03-17 18:54:18 +01:00
hazre f81fdd38af chore: merge dev into nyxsutsn 2026-03-17 18:54:18 +01:00
Evie Gauthier 2ee72702e6 Merge pull request #314 from SableClient/fix/matrix-to-custom-base
fix: support custom matrix.to base URL via config
2026-03-17 03:04:28 +00:00
Evie Gauthier 55fd9bbc7e style(matrix-to): fix prettier formatting in test file 2026-03-16 21:51:39 -04:00
Evie Gauthier edc1c67ecf test(matrix-to): add unit tests; fix setMatrixToBase reset, http support, room regex 2026-03-16 21:43:51 -04:00
7w1 687d6721ce Merge pull request #127 from melogale/dev
Bring in sable-call!
2026-03-17 01:33:17 +00:00
melogale b224d936c4 final fix 2026-03-16 21:18:37 -04:00
Evie Gauthier 2da742d716 fix: dynamic matrix.to regexes; route mentions through plugin generators (#67)
- matrix-to.ts: replace static hardcoded regexes with a lazily-built
  cached set that matches both https://matrix.to (cross-client compat)
  and the configured custom base URL (if matrixToBaseUrl is set in
  config.json)
- editor/output.ts: Mention block now calls getMatrixToRoom /
  getMatrixToRoomEvent instead of hardcoding the matrix.to base
- room.ts: parseReplyFormattedBody uses getMatrixToRoomEvent /
  getMatrixToRoom for the same reason
2026-03-16 21:17:19 -04:00
Evie Gauthier b584d1867b fix: support matrixToBaseUrl config to override matrix.to base (#67) 2026-03-16 20:51:51 -04:00
Evie Gauthier 1a4af27d49 fix: persist volume for audio+video; split changesets; revert matrix.to (#120) 2026-03-16 20:51:22 -04:00
melogale 3e42d3bf70 Merge remote-tracking branch 'upstream/dev' into dev 2026-03-16 19:49:03 -04:00
melogale abf0848aa6 fix delayed events 2026-03-16 19:23:46 -04:00
Evie Gauthier ec5e9812aa fix: quick issues batch 1 (#2 #44 #45 #52 #66 #67 #69 #79 #35 #103 #120 #168) 2026-03-16 17:16:04 -04:00
Evie Gauthier 931c13fbfe Merge pull request #286 from dozro/fix/voice-message-mess
Fix audio codec handling and enhance voice recorder functionality
2026-03-16 18:24:16 +00:00
hazre 3c40ad77f3 chore: merge dev into fix/better-ux-voice-messages 2026-03-16 15:19:49 +01:00
hazre bf6d7ce4a6 fix: a lot more polish on voice messages 2026-03-16 15:16:20 +01:00
Rye 166c8f4835 fix file extension mapping 2026-03-16 14:10:56 +01:00
Rye 9ecfb84dd1 fixes for iOS (hopefully) 2026-03-16 14:03:05 +01:00
melogale 56d3918db1 fix calls! 2026-03-16 00:15:25 -04:00
melogale b06e177449 merge 2026-03-15 22:42:21 -04:00
Rye 7926c99d2e fix: improve cleanup process and ensure correct audio codec usage in useVoiceRecorder 2026-03-15 18:49:35 +01:00
Rye d4ad5cad5c refactor supported codecs for improved Safari compatibility and correct file extensions 2026-03-15 18:11:02 +01:00
Rye 126894a346 improve useVoiceRecorder to improve audio codec handling and enhance waveform sample documentation 2026-03-15 15:54:38 +01:00
Rye 6daa6150d0 fix a few js errors oops 2026-03-15 14:58:02 +01:00
Rye 215225bd28 fix audio codec choosing 2026-03-15 14:56:14 +01: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
7w1 4925f0f579 Merge pull request #176 from dozro/feat/audio-recordings
Add voice message functionality
2026-03-14 21:59:07 +00:00
Evie Gauthier 54ac93c39a chore: fix formatting and linting issues for CI 2026-03-13 22:10:36 -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
Rye fedbfa5756 adjusted code styling to match ours 2026-03-12 03:40:58 +01:00
7w1 8f394a1a87 merge upstream and remove duplicate voice room button 2026-03-11 14:02:47 -05:00
hazre fcfe06fc95 fix: resolve peer dependency and matrix-sdk-crypto-wasm issues 2026-03-11 17:23:52 +01:00
melogale 726129f9dd sable call and avatar fix 2026-03-10 02:08:52 -04:00
7w1 dd65e2241e Revert "avatars!" 2026-03-09 08:47:06 -05:00
Ajay Bura 4449e7c6e8 Show call support error and disable join button (#2748)
* allow user to end call if error when loading

* show call support missing error if livekit server is not provided

* prevent joining from nav item double click if no livekit support
2026-03-09 21:39:58 +11:00
Ajay Bura d679e68501 Fix recent emoji does not persist (#2722)
Fix recent emoji are not getting saved

Refactor recent emoji retrieval to ensure structured cloning and proper type checking. The sdk was not updating account data because we are mutating the original and it compare and early return if found same.
2026-03-09 17:34:44 +11:00
Ajay Bura bc6caddcc8 Add own control buttons for element-call (#2744)
* add mutation observer hok

* add hook to read speaking member by observing iframe content

* display speaking member name in call status bar and improve layout

* fix shrining

* add joined call control bar

* remove chat toggle from room header

* change member speaking icon to mic

* fix joined call control appear in other

* show spinner on end call button

* hide call statusbar for mobile view when room is selected

* make call statusbar more mobile friendly

* fix call status bar item align
2026-03-09 08:34:48 +05:30
7w1 d41f1479af Merge pull request #227 from melogale/dev
avatars!
2026-03-08 20:25:29 -05:00
7w1 3c2e29849e merge upstream 2026-03-08 14:30:06 -05:00
Ajay Bura 55e8306576 Display call member speaking status on bottom bar (#2742)
* add mutation observer hok

* add hook to read speaking member by observing iframe content

* display speaking member name in call status bar and improve layout

* fix shrining
2026-03-08 22:00:35 +11:00
Ajay Bura 7953ec80e5 Apply deafen state when call member changes (#2737)
* fix deafen not working

* apply deafen state when call member changes

* remove unnecessary condition
2026-03-08 14:22:11 +11:00
melogale f2dc410c11 Merge remote-tracking branch 'upstream/dev' into dev
# Conflicts:
#	src/app/features/call/SmallWidget.ts
2026-03-07 17:07:09 -05:00
7w1 32ed0b1495 lint fixes 2026-03-07 03:59:17 -06:00