### 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).
Sable
A Matrix client built to enhance the user experience with quality-of-life features, cosmetics, utilities, and sheer usability. See the changelog.
Soon to be replaced desktop apps can be downloaded here. They auto-update by pulling the website.
Join our matrix space here to discuss features, issues, or meowing.
Forked from Cinny.
Getting started
The web app is available at app.sable.moe and gets updated on frequently, as soon as a feature is deemed stable.
You can also download our desktop app for windows and linux from releases.
Self-hosting
You have a few options for self hosting, you can:
- Run the prebuilt docker container.
- Deploy on a site like GitLab Pages. Jae has a guide here.
- Build it yourself.
Docker
Prebuilt images are published to ghcr.io/sableclient/sable.
latesttracks the currentdevbranch image.X.Y.Ztags are versioned releases.X.Ytags float within a release line.- Pushes to
devalso publish a short commit SHA tag.
Run the latest image with:
docker run --rm -p 8080:8080 ghcr.io/sableclient/sable:latest
Then open http://localhost:8080.
If you want to override the bundled config.json, mount your own
file at /app/config.json:
services:
sable:
image: ghcr.io/sableclient/sable:latest
ports:
- '8080:8080'
volumes:
- ./config.json:/app/config.json:ro
Build it yourself
To build and serve Sable yourself with nginx, clone this repo and build it:
pnpm i # Installs all dependencies
pnpm run build # Compiles the app into the dist/ directory
After that, you can copy the dist/ directory to your server and serve it.
-
In the
config.json, you can modify the default homeservers, feature rooms/spaces, toggle the account switcher, and toggle experimental simplified slilding sync support. -
To deploy on subdirectory, you need to rebuild the app youself after updating the
basepath inbuild.config.ts.- For example, if you want to deploy on
https://sable.moe/app, then setbase: '/app'.
- For example, if you want to deploy on
Local development
Tip
We recommend using a version manager as versions change quickly. fnm is a great cross-platform option (Windows, macOS, and Linux). NVM on Windows and nvm on Linux/macOS are also good choices. Use the version defined in
.node-version.
Execute the following commands to start a development server:
fnm use --corepack-enabled # Activates the Node version and enables corepack
# If you not using fnm, install corepack manually: npm install --global corepack@latest
corepack install # Installs the pnpm version specified in package.json
pnpm i # Installs all dependencies
pnpm run dev # Serve a development version
To build the app:
pnpm run build # Compiles the app into the dist/ directory
Deployment and infrastructure
Deployment workflows and infrastructure details live in
infra/README.md.