From 5bb0ce06437850b2ba9329fb12563c3d36b81a3b Mon Sep 17 00:00:00 2001 From: hazre Date: Tue, 3 Mar 2026 17:41:26 +0100 Subject: [PATCH 01/67] feat: add Cloudflare Workers IaC and deployment workflows --- .../workflows/cloudflare-worker-preview.yml | 143 ++ .github/workflows/cloudflare-worker-prod.yml | 147 ++ .gitignore | 13 +- README.md | 4 + infra/README.md | 109 ++ infra/gitlab.http.tfbackend.example | 7 + infra/terraform.tfvars.example | 4 + infra/web/.terraform.lock.hcl | 19 + infra/web/backend.tf | 3 + infra/web/main.tf | 47 + infra/web/outputs.tf | 9 + infra/web/providers.tf | 3 + infra/web/terraform.tf | 10 + infra/web/variables.tf | 29 + netlify.toml | 36 - package-lock.json | 1449 ++++++++++++++++- package.json | 4 +- vite.config.ts | 13 +- 18 files changed, 2006 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/cloudflare-worker-preview.yml create mode 100644 .github/workflows/cloudflare-worker-prod.yml create mode 100644 infra/README.md create mode 100644 infra/gitlab.http.tfbackend.example create mode 100644 infra/terraform.tfvars.example create mode 100644 infra/web/.terraform.lock.hcl create mode 100644 infra/web/backend.tf create mode 100644 infra/web/main.tf create mode 100644 infra/web/outputs.tf create mode 100644 infra/web/providers.tf create mode 100644 infra/web/terraform.tf create mode 100644 infra/web/variables.tf delete mode 100644 netlify.toml diff --git a/.github/workflows/cloudflare-worker-preview.yml b/.github/workflows/cloudflare-worker-preview.yml new file mode 100644 index 000000000..78889616b --- /dev/null +++ b/.github/workflows/cloudflare-worker-preview.yml @@ -0,0 +1,143 @@ +name: Cloudflare Worker Preview Deploy + +on: + pull_request: + +concurrency: + group: cloudflare-worker-preview-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + deploy: + if: github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Prepare preview metadata + id: metadata + shell: bash + run: | + preview_message="$(git log -1 --pretty=%s)" + preview_message="$(printf '%s' "$preview_message" | head -c 100)" + + { + echo 'preview_message<> "$GITHUB_OUTPUT" + + - name: Setup node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.node-version' + package-manager-cache: false + + - name: Install dependencies + run: npm ci + + - name: Build app + run: npm run build + + - name: Upload Worker preview + id: deploy + uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1 + with: + apiToken: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.TF_VAR_ACCOUNT_ID }} + command: > + versions upload + -c dist/wrangler.json + --preview-alias pr-${{ github.event.pull_request.number }} + --message "${{ steps.metadata.outputs.preview_message }}" + + - name: Resolve preview URL + id: preview + env: + DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }} + COMMAND_OUTPUT: ${{ steps.deploy.outputs.command-output }} + PR_NUMBER: ${{ github.event.pull_request.number }} + shell: bash + run: | + alias="pr-${PR_NUMBER}" + preview_url="" + alias_url_pattern="^https?://${alias}-[^[:space:]]+$" + + if printf '%s\n' "$DEPLOYMENT_URL" | grep -Eq "$alias_url_pattern"; then + preview_url="$DEPLOYMENT_URL" + else + preview_url="$(printf '%s\n' "$COMMAND_OUTPUT" | grep -Eo "https?://${alias}-[^[:space:]\"'<>)]+" | head -n 1 || true)" + fi + + if ! printf '%s\n' "$preview_url" | grep -Eq "$alias_url_pattern"; then + echo "Failed to resolve aliased Worker preview URL." >&2 + exit 1 + fi + + { + echo "preview_alias=${alias}" + echo "preview_url=${preview_url}" + } >> "$GITHUB_OUTPUT" + + - name: Write deployment summary + env: + PREVIEW_ALIAS: ${{ steps.preview.outputs.preview_alias }} + PREVIEW_URL: ${{ steps.preview.outputs.preview_url }} + shell: bash + run: | + { + echo "## Cloudflare Worker Preview" + echo + echo "- Alias: \`${PREVIEW_ALIAS}\`" + echo "- Preview URL: ${PREVIEW_URL}" + } >> "$GITHUB_STEP_SUMMARY" + + - name: Publish preview URL + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + env: + MARKER: '' + PREVIEW_URL: ${{ steps.preview.outputs.preview_url }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const marker = process.env.MARKER; + const previewUrl = process.env.PREVIEW_URL; + if (!previewUrl) { + core.setFailed("Missing preview URL from Cloudflare deploy step."); + return; + } + + const body = `${marker}\nWorker preview: ${previewUrl}`; + const { owner, repo } = context.repo; + const issue_number = context.issue.number; + const comments = await github.paginate(github.rest.issues.listComments, { + owner, + repo, + issue_number, + }); + const existing = comments.find( + (comment) => comment.user.type === "Bot" && comment.body.includes(marker), + ); + + if (existing) { + await github.rest.issues.updateComment({ + owner, + repo, + comment_id: existing.id, + body, + }); + return; + } + + await github.rest.issues.createComment({ + owner, + repo, + issue_number, + body, + }); diff --git a/.github/workflows/cloudflare-worker-prod.yml b/.github/workflows/cloudflare-worker-prod.yml new file mode 100644 index 000000000..ed0d33ff5 --- /dev/null +++ b/.github/workflows/cloudflare-worker-prod.yml @@ -0,0 +1,147 @@ +name: Cloudflare Infra + +on: + pull_request: + paths: + - 'infra/web/**' + - '.github/workflows/cloudflare-worker-prod.yml' + push: + branches: + - dev + workflow_dispatch: + +concurrency: + group: cloudflare-infra + cancel-in-progress: false + +jobs: + plan: + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + permissions: + contents: read + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} + TF_VAR_account_id: ${{ secrets.TF_VAR_ACCOUNT_ID }} + TF_VAR_zone_id: ${{ secrets.TF_VAR_ZONE_ID }} + TF_HTTP_ADDRESS: ${{ secrets.TF_HTTP_ADDRESS }} + TF_HTTP_LOCK_ADDRESS: ${{ secrets.TF_HTTP_LOCK_ADDRESS }} + TF_HTTP_UNLOCK_ADDRESS: ${{ secrets.TF_HTTP_UNLOCK_ADDRESS }} + TF_HTTP_USERNAME: ${{ secrets.TF_HTTP_USERNAME }} + TF_HTTP_PASSWORD: ${{ secrets.TF_HTTP_PASSWORD }} + TF_HTTP_LOCK_METHOD: 'POST' + TF_HTTP_UNLOCK_METHOD: 'DELETE' + TF_HTTP_RETRY_WAIT_MIN: '5' + defaults: + run: + working-directory: infra/web + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Prepare deployment metadata + shell: bash + run: | + workers_message="$(git log -1 --pretty=%s)" + workers_message="$(printf '%s' "$workers_message" | head -c 100)" + printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV" + + - name: Setup node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.node-version' + cache: 'npm' + + - name: Install dependencies + working-directory: . + run: npm ci + + - name: Build app + working-directory: . + run: npm run build + + - name: Setup OpenTofu + uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8 + with: + tofu_version: 1.11.5 + + - name: Check formatting + run: tofu fmt -check + + - name: Initialize OpenTofu + run: tofu init -input=false -reconfigure + + - name: Validate configuration + run: tofu validate -no-color + + - name: Plan infrastructure + run: tofu plan -input=false -lock=false -no-color + + apply: + if: (github.event_name == 'push' && github.ref_name == 'dev') || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + permissions: + contents: read + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} + TF_VAR_account_id: ${{ secrets.TF_VAR_ACCOUNT_ID }} + TF_VAR_zone_id: ${{ secrets.TF_VAR_ZONE_ID }} + TF_HTTP_ADDRESS: ${{ secrets.TF_HTTP_ADDRESS }} + TF_HTTP_LOCK_ADDRESS: ${{ secrets.TF_HTTP_LOCK_ADDRESS }} + TF_HTTP_UNLOCK_ADDRESS: ${{ secrets.TF_HTTP_UNLOCK_ADDRESS }} + TF_HTTP_USERNAME: ${{ secrets.TF_HTTP_USERNAME }} + TF_HTTP_PASSWORD: ${{ secrets.TF_HTTP_PASSWORD }} + TF_HTTP_LOCK_METHOD: 'POST' + TF_HTTP_UNLOCK_METHOD: 'DELETE' + TF_HTTP_RETRY_WAIT_MIN: '5' + defaults: + run: + working-directory: infra/web + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Prepare deployment metadata + shell: bash + run: | + workers_message="$(git log -1 --pretty=%s)" + workers_message="$(printf '%s' "$workers_message" | head -c 100)" + printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV" + + - name: Setup node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.node-version' + cache: 'npm' + + - name: Install dependencies + working-directory: . + run: npm ci + + - name: Build app + working-directory: . + run: npm run build + + - name: Setup OpenTofu + uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8 + with: + tofu_version: 1.11.5 + + - name: Check formatting + run: tofu fmt -check + + - name: Initialize OpenTofu + run: tofu init -input=false -reconfigure + + - name: Validate configuration + run: tofu validate -no-color + + - name: Plan infrastructure + run: tofu plan -input=false -no-color + + - name: Apply infrastructure + run: tofu apply -input=false -auto-approve diff --git a/.gitignore b/.gitignore index d08837374..1c1104414 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,15 @@ devAssets .DS_Store .idea -.env \ No newline at end of file +.env + +.wrangler +.dev.vars* +.terraform/ +*.tfstate +*.tfstate.* +*.tfvars +!*.tfvars.example +*.tfbackend +!*.tfbackend.example +crash.log diff --git a/README.md b/README.md index 8937286c4..e0ac5815e 100644 --- a/README.md +++ b/README.md @@ -74,3 +74,7 @@ To build the app: ```sh npm run build # Compiles the app into the dist/ directory ``` + +## Deployment and infrastructure +Deployment workflows and infrastructure details live in +[`infra/README.md`](infra/README.md). diff --git a/infra/README.md b/infra/README.md new file mode 100644 index 000000000..74c8d8ee2 --- /dev/null +++ b/infra/README.md @@ -0,0 +1,109 @@ +# Infrastructure + +`infra/web` manages the Cloudflare Worker service, immutable Worker version uploads, +the live production deployment, and the Worker custom domain. Local setup uses +`terraform.tfvars.example` for shared inputs and `gitlab.http.tfbackend.example` for +the GitLab state backend config. + +Prerequisites: + +- OpenTofu `1.11.x` installed locally +- Node.js/npm installed locally so you can build `dist/` before Worker uploads +- A Cloudflare account with the target zone already onboarded to Cloudflare +- A GitLab project to store the OpenTofu state +- A GitLab access token that can read and write that project's OpenTofu state + +Required GitHub repository secrets: + +- `TF_CLOUDFLARE_API_TOKEN` +- `TF_VAR_ACCOUNT_ID` +- `TF_VAR_ZONE_ID` +- `TF_HTTP_ADDRESS` +- `TF_HTTP_LOCK_ADDRESS` +- `TF_HTTP_UNLOCK_ADDRESS` +- `TF_HTTP_USERNAME` +- `TF_HTTP_PASSWORD` + +The workflows map those secrets onto the actual runtime environment variable names +that Cloudflare and OpenTofu expect. + +Cloudflare API token permissions: + +- `Account > Workers Scripts > Edit` +- Scope the token to the specific Cloudflare account that owns the Worker. +- Scope the token to the specific zone that serves `app.sable.moe`. +- Do not grant Pages or DNS edit permissions here. The Worker script upload and + custom-domain attach endpoints used by this repo accept Workers Scripts Write, and + Cloudflare creates the DNS record for the Worker custom domain automatically. + +GitLab access token permissions: + +- `api` + +Helpful reference links: + +- Create the main Cloudflare API token: + https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ +- Find your account ID and zone ID: + https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/ +- GitLab-managed OpenTofu state: + https://docs.gitlab.com/user/infrastructure/iac/terraform_state/ + +Local setup: + +1. Copy `terraform.tfvars.example` to `terraform.tfvars` and fill in shared values. +2. Copy `gitlab.http.tfbackend.example` to `gitlab.http.tfbackend` and fill in the + GitLab project ID, state name, and username. +3. Run `npm ci` from the repo root. +4. Export the GitLab access token as the backend password. +5. Export the Cloudflare API token for OpenTofu. +6. Run `npm run build` before `tofu plan` or `tofu apply`, because + `cloudflare_worker_version` uploads the built `dist/` assets. +7. Initialize the backend. + +Local OpenTofu production flow from the repo root: + +```bash +npm run build +export TF_HTTP_PASSWORD="" +export CLOUDFLARE_API_TOKEN="" +tofu -chdir=infra/web init -reconfigure -backend-config="../gitlab.http.tfbackend" +tofu -chdir=infra/web validate +tofu -chdir=infra/web plan -var-file="../terraform.tfvars" +tofu -chdir=infra/web apply -var-file="../terraform.tfvars" +``` + +Optional local OpenTofu deployment message: + +```bash +export TF_VAR_workers_message="$(git log -1 --pretty=%s)" +tofu -chdir=infra/web apply -var-file="../terraform.tfvars" +``` + +If you already created local state before switching to GitLab state, use +`tofu -chdir=infra/web init -reconfigure -migrate-state -backend-config="../gitlab.http.tfbackend"` +once instead. + +Preview deploys: + +- PR previews use Wrangler `versions upload` against the generated + `dist/wrangler.json`. +- That Wrangler-based preview path is temporary until the Cloudflare provider adds support for preview version/alias management. +- `npm run build` generates both `dist/` and `dist/wrangler.json`; Wrangler uploads a + preview Worker version and binds a stable alias such as `pr-123`. +- GitHub Actions also sets the preview version message from the current git commit + subject, truncated to 100 bytes to fit Cloudflare's limit. +- Preview URLs live on `workers.dev` and do not touch the live custom domain. + +Production deploys: + +- `.github/workflows/cloudflare-worker-prod.yml` builds the app and runs `tofu apply` on + pushes to `dev`, or via manual workflow dispatch. +- `tofu apply` uploads `dist/` as a new immutable Worker version with + `cloudflare_worker_version`, then `cloudflare_workers_deployment` moves live traffic + to that exact version. +- GitHub Actions sets the production deployment message from the current git commit + subject, truncated to 100 bytes to fit Cloudflare's limit. +- `app.sable.moe` is the Worker custom domain for production. +- `cloudflare_workers_custom_domain` attaches the Worker to `app.sable.moe`, and + Cloudflare creates the backing DNS record automatically. diff --git a/infra/gitlab.http.tfbackend.example b/infra/gitlab.http.tfbackend.example new file mode 100644 index 000000000..0128a474f --- /dev/null +++ b/infra/gitlab.http.tfbackend.example @@ -0,0 +1,7 @@ +address = "https://gitlab.com/api/v4/projects/replace-with-gitlab-project-id/terraform/state/replace-with-gitlab-state-name" +lock_address = "https://gitlab.com/api/v4/projects/replace-with-gitlab-project-id/terraform/state/replace-with-gitlab-state-name/lock" +unlock_address = "https://gitlab.com/api/v4/projects/replace-with-gitlab-project-id/terraform/state/replace-with-gitlab-state-name/lock" +username = "replace-with-gitlab-username" +lock_method = "POST" +unlock_method = "DELETE" +retry_wait_min = 5 diff --git a/infra/terraform.tfvars.example b/infra/terraform.tfvars.example new file mode 100644 index 000000000..a054c1771 --- /dev/null +++ b/infra/terraform.tfvars.example @@ -0,0 +1,4 @@ +account_id = "replace-with-cloudflare-account-id" +zone_id = "replace-with-cloudflare-zone-id" +worker_name = "sable" +custom_domain = "app.sable.moe" diff --git a/infra/web/.terraform.lock.hcl b/infra/web/.terraform.lock.hcl new file mode 100644 index 000000000..016626158 --- /dev/null +++ b/infra/web/.terraform.lock.hcl @@ -0,0 +1,19 @@ +# This file is maintained automatically by "tofu init". +# Manual edits may be lost in future updates. + +provider "registry.opentofu.org/cloudflare/cloudflare" { + version = "5.18.0" + constraints = "~> 5.0" + hashes = [ + "h1:ny17Q/ce8iuHxppA/yIuRpCkVDtqhE+LDynWtv9/qwI=", + "zh:47e7bdfd8eddd2685f383269c0b6936ef62edd6d8383c8d7757b0cce0a689737", + "zh:aa23eb6aa128667883cabc449ceca4072d0181f574cd727e08ebd6d69a4bfd48", + "zh:c3da673e05d3bd933c82e2b6ba0f85aa23c5e24fadd3932f7c066314feeb65a3", + "zh:c59f07c017fc78b79e80554a0737c9db2a2e681c3e46ff637942d28d1f1a3924", + "zh:d559074612835a37fa684d8d7d0cf68911487b71f4067acc59069cb00bb8baf0", + "zh:e12290a4eda757c183a4258230245dd170f0def389c37eb771db144ce3b382dd", + "zh:ed47e484432ba1bbbb4802061f395ebd253ae8e20be9b72552d3d830fd2ca268", + "zh:f35e08d468408697b3e7c4a7f548b874141ac8f8d395ab8edded322201cc7047", + "zh:f809ab383cca0a5f83072981c64208cbd7fa67e986a86ee02dd2c82333221e32", + ] +} diff --git a/infra/web/backend.tf b/infra/web/backend.tf new file mode 100644 index 000000000..1736bf13b --- /dev/null +++ b/infra/web/backend.tf @@ -0,0 +1,3 @@ +terraform { + backend "http" {} +} diff --git a/infra/web/main.tf b/infra/web/main.tf new file mode 100644 index 000000000..6091baafc --- /dev/null +++ b/infra/web/main.tf @@ -0,0 +1,47 @@ +resource "cloudflare_worker" "site" { + account_id = var.account_id + name = var.worker_name + + subdomain = { + enabled = true + previews_enabled = true + } +} + +resource "cloudflare_worker_version" "site" { + account_id = var.account_id + compatibility_date = "2026-03-03" + worker_id = cloudflare_worker.site.id + + assets = { + directory = abspath("${path.module}/../../dist") + config = { + not_found_handling = "single-page-application" + } + } +} + +resource "cloudflare_workers_deployment" "site" { + account_id = var.account_id + script_name = cloudflare_worker.site.name + strategy = "percentage" + + annotations = var.workers_message == null ? null : { + workers_message = var.workers_message + } + + versions = [{ + percentage = 100 + version_id = cloudflare_worker_version.site.id + }] +} + +resource "cloudflare_workers_custom_domain" "site" { + account_id = var.account_id + environment = "production" + hostname = var.custom_domain + service = cloudflare_worker.site.name + zone_id = var.zone_id + + depends_on = [cloudflare_workers_deployment.site] +} diff --git a/infra/web/outputs.tf b/infra/web/outputs.tf new file mode 100644 index 000000000..e6b48bd00 --- /dev/null +++ b/infra/web/outputs.tf @@ -0,0 +1,9 @@ +output "custom_domain" { + description = "Custom domain attached to the Worker" + value = cloudflare_workers_custom_domain.site.hostname +} + +output "worker_name" { + description = "Cloudflare Worker name" + value = cloudflare_worker.site.name +} diff --git a/infra/web/providers.tf b/infra/web/providers.tf new file mode 100644 index 000000000..e862769b5 --- /dev/null +++ b/infra/web/providers.tf @@ -0,0 +1,3 @@ +provider "cloudflare" { + # API token will be read from CLOUDFLARE_API_TOKEN environment variable +} diff --git a/infra/web/terraform.tf b/infra/web/terraform.tf new file mode 100644 index 000000000..741fd99b5 --- /dev/null +++ b/infra/web/terraform.tf @@ -0,0 +1,10 @@ +terraform { + required_version = "~> 1.11.0" + + required_providers { + cloudflare = { + source = "cloudflare/cloudflare" + version = "~> 5.0" + } + } +} diff --git a/infra/web/variables.tf b/infra/web/variables.tf new file mode 100644 index 000000000..3569c9822 --- /dev/null +++ b/infra/web/variables.tf @@ -0,0 +1,29 @@ +variable "account_id" { + description = "Cloudflare Account ID" + type = string + sensitive = true +} + +variable "custom_domain" { + description = "Custom domain attached to the Worker" + type = string + default = "app.sable.moe" +} + +variable "worker_name" { + description = "Cloudflare Worker name" + type = string + default = "sable" +} + +variable "workers_message" { + description = "Optional short message attached to Worker deployments" + type = string + default = null +} + +variable "zone_id" { + description = "Cloudflare Zone ID" + type = string + sensitive = true +} diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index a87103032..000000000 --- a/netlify.toml +++ /dev/null @@ -1,36 +0,0 @@ -[[redirects]] - from = "/config.json" - to = "/config.json" - status = 200 - -[[redirects]] - from = "/manifest.json" - to = "/manifest.json" - status = 200 - -[[redirects]] - from = "/sw.js" - to = "/sw.js" - status = 200 - - -[[redirects]] - from = "/pdf.worker.min.js" - to = "/pdf.worker.min.js" - status = 200 - -[[redirects]] - from = "/public/*" - to = "/public/:splat" - status = 200 - -[[redirects]] - from = "/assets/*" - to = "/assets/:splat" - status = 200 - -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 - force = true \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cace30ba4..111844ea6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,6 +69,7 @@ "ua-parser-js": "^1.0.41" }, "devDependencies": { + "@cloudflare/vite-plugin": "^1.26.0", "@element-hq/element-call-embedded": "0.16.3", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@eslint/compat": "2.0.2", @@ -99,7 +100,8 @@ "vite-plugin-pwa": "^1.2.0", "vite-plugin-static-copy": "^3.2.0", "vite-plugin-svgr": "4.5.0", - "vite-plugin-top-level-await": "^1.6.0" + "vite-plugin-top-level-await": "^1.6.0", + "wrangler": "^4.70.0" }, "engines": { "node": "24.x", @@ -1754,6 +1756,159 @@ "node": ">=6.9.0" } }, + "node_modules/@cloudflare/kv-asset-handler": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.4.2.tgz", + "integrity": "sha512-SIOD2DxrRRwQ+jgzlXCqoEFiKOFqaPjhnNTGKXSRLvp1HiOvapLaFG2kEr9dYQTYe8rKrd9uvDUzmAITeNyaHQ==", + "dev": true, + "license": "MIT OR Apache-2.0", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@cloudflare/unenv-preset": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.14.0.tgz", + "integrity": "sha512-XKAkWhi1nBdNsSEoNG9nkcbyvfUrSjSf+VYVPfOto3gLTZVc3F4g6RASCMh6IixBKCG2yDgZKQIHGKtjcnLnKg==", + "dev": true, + "license": "MIT OR Apache-2.0", + "peerDependencies": { + "unenv": "2.0.0-rc.24", + "workerd": "^1.20260218.0" + }, + "peerDependenciesMeta": { + "workerd": { + "optional": true + } + } + }, + "node_modules/@cloudflare/vite-plugin": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@cloudflare/vite-plugin/-/vite-plugin-1.26.0.tgz", + "integrity": "sha512-F5jSOj9JeWMp9iQa2x+Ocjz++SCfK6Phcca/YLkaddPw5ie7W1VvEWudQ/gxYtRd47mQ/PfCLkE9QGyy6OGEng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cloudflare/unenv-preset": "2.14.0", + "miniflare": "4.20260301.1", + "unenv": "2.0.0-rc.24", + "wrangler": "4.70.0", + "ws": "8.18.0" + }, + "peerDependencies": { + "vite": "^6.1.0 || ^7.0.0", + "wrangler": "^4.70.0" + } + }, + "node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260301.1.tgz", + "integrity": "sha512-+kJvwociLrvy1JV9BAvoSVsMEIYD982CpFmo/yMEvBwxDIjltYsLTE8DLi0mCkGsQ8Ygidv2fD9wavzXeiY7OQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260301.1.tgz", + "integrity": "sha512-PPIetY3e67YBr9O4UhILK8nbm5TqUDl14qx4rwFNrRSBOvlzuczzbd4BqgpAtbGVFxKp1PWpjAnBvGU/OI/tLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260301.1.tgz", + "integrity": "sha512-Gu5vaVTZuYl3cHa+u5CDzSVDBvSkfNyuAHi6Mdfut7TTUdcb3V5CIcR/mXRSyMXzEy9YxEWIfdKMxOMBjupvYQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260301.1.tgz", + "integrity": "sha512-igL1pkyCXW6GiGpjdOAvqMi87UW0LMc/+yIQe/CSzuZJm5GzXoAMrwVTkCFnikk6JVGELrM5x0tGYlxa0sk5Iw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260301.1.tgz", + "integrity": "sha512-Q0wMJ4kcujXILwQKQFc1jaYamVsNvjuECzvRrTI8OxGFMx2yq9aOsswViE4X1gaS2YQQ5u0JGwuGi5WdT1Lt7A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@element-hq/element-call-embedded": { "version": "0.16.3", "resolved": "https://registry.npmjs.org/@element-hq/element-call-embedded/-/element-call-embedded-0.16.3.tgz", @@ -2558,6 +2713,496 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@internationalized/date": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.11.0.tgz", @@ -3315,6 +3960,48 @@ "url": "https://opencollective.com/pkgr" } }, + "node_modules/@poppinss/colors": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^4.1.5" + } + }, + "node_modules/@poppinss/dumper": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", + "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@sindresorhus/is": "^7.0.2", + "supports-color": "^10.0.0" + } + }, + "node_modules/@poppinss/dumper/node_modules/supports-color": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/@poppinss/exception": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", + "dev": true, + "license": "MIT" + }, "node_modules/@react-aria/breadcrumbs": { "version": "3.5.31", "resolved": "https://registry.npmjs.org/@react-aria/breadcrumbs/-/breadcrumbs-3.5.31.tgz", @@ -5581,6 +6268,26 @@ "dev": true, "license": "MIT" }, + "node_modules/@sindresorhus/is": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz", + "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@speed-highlight/core": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.14.tgz", + "integrity": "sha512-G4ewlBNhUtlLvrJTb88d2mdy2KRijzs4UhnlrOSRT4bmjh/IqNElZa3zkrZ+TC47TwtlDWzVLFADljF1Ijp5hA==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/@stylistic/eslint-plugin": { "version": "5.9.0", "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.9.0.tgz", @@ -8357,6 +9064,13 @@ "resolved": "https://registry.npmjs.org/bind-event-listener/-/bind-event-listener-3.0.0.tgz", "integrity": "sha512-PJvH288AWQhKs2v9zyfYdPzlPqf5bXbGMmhmUIY9x4dAUGIWgomO771oBQNwJnMQSnUIXhKu6sgzpBRXTlvb8Q==" }, + "node_modules/blake3-wasm": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", + "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", + "dev": true, + "license": "MIT" + }, "node_modules/blurhash": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/blurhash/-/blurhash-2.0.5.tgz", @@ -8728,6 +9442,20 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/core-js-compat": { "version": "3.48.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.48.0.tgz", @@ -8971,6 +9699,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/direction": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/direction/-/direction-1.0.4.tgz", @@ -9157,6 +9895,16 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/error-stack-parser-es": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz", + "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/es-abstract": { "version": "1.24.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz", @@ -11766,6 +12514,16 @@ "json-buffer": "3.0.1" } }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/knip": { "version": "5.85.0", "resolved": "https://registry.npmjs.org/knip/-/knip-5.85.0.tgz", @@ -12109,6 +12867,27 @@ "millify": "bin/millify" } }, + "node_modules/miniflare": { + "version": "4.20260301.1", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260301.1.tgz", + "integrity": "sha512-fqkHx0QMKswRH9uqQQQOU/RoaS3Wjckxy3CUX3YGJr0ZIMu7ObvI+NovdYi6RIsSPthNtq+3TPmRNxjeRiasog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "^0.34.5", + "undici": "7.18.2", + "workerd": "1.20260301.1", + "ws": "8.18.0", + "youch": "4.1.0-beta.10" + }, + "bin": { + "miniflare": "bootstrap.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/minimatch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", @@ -12613,6 +13392,13 @@ "node": "20 || >=22" } }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, + "license": "MIT" + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -13527,6 +14313,51 @@ "node": ">= 0.4" } }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -14426,12 +15257,32 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.18.2.tgz", + "integrity": "sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/undici-types": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "license": "MIT" }, + "node_modules/unenv": { + "version": "2.0.0-rc.24", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", + "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "pathe": "^2.0.3" + } + }, "node_modules/unhomoglyph": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/unhomoglyph/-/unhomoglyph-1.0.6.tgz", @@ -15679,6 +16530,62 @@ "workbox-core": "7.4.0" } }, + "node_modules/workerd": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260301.1.tgz", + "integrity": "sha512-oterQ1IFd3h7PjCfT4znSFOkJCvNQ6YMOyZ40YsnO3nrSpgB4TbJVYWFOnyJAw71/RQuupfVqZZWKvsy8GO3fw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20260301.1", + "@cloudflare/workerd-darwin-arm64": "1.20260301.1", + "@cloudflare/workerd-linux-64": "1.20260301.1", + "@cloudflare/workerd-linux-arm64": "1.20260301.1", + "@cloudflare/workerd-windows-64": "1.20260301.1" + } + }, + "node_modules/wrangler": { + "version": "4.70.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.70.0.tgz", + "integrity": "sha512-PNDZ9o4e+B5x+1bUbz62Hmwz6G9lw+I9pnYe/AguLddJFjfIyt2cmFOUOb3eOZSoXsrhcEPUg2YidYIbVwUkfw==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/kv-asset-handler": "0.4.2", + "@cloudflare/unenv-preset": "2.14.0", + "blake3-wasm": "2.1.5", + "esbuild": "0.27.3", + "miniflare": "4.20260301.1", + "path-to-regexp": "6.3.0", + "unenv": "2.0.0-rc.24", + "workerd": "1.20260301.1" + }, + "bin": { + "wrangler": "bin/wrangler.js", + "wrangler2": "bin/wrangler.js" + }, + "engines": { + "node": ">=20.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^4.20260226.1" + }, + "peerDependenciesMeta": { + "@cloudflare/workers-types": { + "optional": true + } + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -15695,6 +16602,28 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -15759,6 +16688,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/youch": { + "version": "4.1.0-beta.10", + "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", + "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@poppinss/dumper": "^0.6.4", + "@speed-highlight/core": "^1.2.7", + "cookie": "^1.0.2", + "youch-core": "^0.3.3" + } + }, + "node_modules/youch-core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", + "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/exception": "^1.2.2", + "error-stack-parser-es": "^1.0.5" + } + }, "node_modules/zod": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", @@ -16828,6 +17782,87 @@ "@babel/helper-validator-identifier": "^7.28.5" } }, + "@cloudflare/kv-asset-handler": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.4.2.tgz", + "integrity": "sha512-SIOD2DxrRRwQ+jgzlXCqoEFiKOFqaPjhnNTGKXSRLvp1HiOvapLaFG2kEr9dYQTYe8rKrd9uvDUzmAITeNyaHQ==", + "dev": true + }, + "@cloudflare/unenv-preset": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.14.0.tgz", + "integrity": "sha512-XKAkWhi1nBdNsSEoNG9nkcbyvfUrSjSf+VYVPfOto3gLTZVc3F4g6RASCMh6IixBKCG2yDgZKQIHGKtjcnLnKg==", + "dev": true + }, + "@cloudflare/vite-plugin": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@cloudflare/vite-plugin/-/vite-plugin-1.26.0.tgz", + "integrity": "sha512-F5jSOj9JeWMp9iQa2x+Ocjz++SCfK6Phcca/YLkaddPw5ie7W1VvEWudQ/gxYtRd47mQ/PfCLkE9QGyy6OGEng==", + "dev": true, + "requires": { + "@cloudflare/unenv-preset": "2.14.0", + "miniflare": "4.20260301.1", + "unenv": "2.0.0-rc.24", + "wrangler": "4.70.0", + "ws": "8.18.0" + } + }, + "@cloudflare/workerd-darwin-64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260301.1.tgz", + "integrity": "sha512-+kJvwociLrvy1JV9BAvoSVsMEIYD982CpFmo/yMEvBwxDIjltYsLTE8DLi0mCkGsQ8Ygidv2fD9wavzXeiY7OQ==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-darwin-arm64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260301.1.tgz", + "integrity": "sha512-PPIetY3e67YBr9O4UhILK8nbm5TqUDl14qx4rwFNrRSBOvlzuczzbd4BqgpAtbGVFxKp1PWpjAnBvGU/OI/tLQ==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-linux-64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260301.1.tgz", + "integrity": "sha512-Gu5vaVTZuYl3cHa+u5CDzSVDBvSkfNyuAHi6Mdfut7TTUdcb3V5CIcR/mXRSyMXzEy9YxEWIfdKMxOMBjupvYQ==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-linux-arm64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260301.1.tgz", + "integrity": "sha512-igL1pkyCXW6GiGpjdOAvqMi87UW0LMc/+yIQe/CSzuZJm5GzXoAMrwVTkCFnikk6JVGELrM5x0tGYlxa0sk5Iw==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-windows-64": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260301.1.tgz", + "integrity": "sha512-Q0wMJ4kcujXILwQKQFc1jaYamVsNvjuECzvRrTI8OxGFMx2yq9aOsswViE4X1gaS2YQQ5u0JGwuGi5WdT1Lt7A==", + "dev": true, + "optional": true + }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, "@element-hq/element-call-embedded": { "version": "0.16.3", "resolved": "https://registry.npmjs.org/@element-hq/element-call-embedded/-/element-call-embedded-0.16.3.tgz", @@ -17259,6 +18294,213 @@ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true }, + "@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "dev": true + }, + "@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "dev": true, + "optional": true + }, + "@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "dev": true, + "optional": true, + "requires": { + "@emnapi/runtime": "^1.7.0" + } + }, + "@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "dev": true, + "optional": true + }, + "@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "dev": true, + "optional": true + }, + "@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "dev": true, + "optional": true + }, "@internationalized/date": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.11.0.tgz", @@ -17660,6 +18902,40 @@ "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true }, + "@poppinss/colors": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", + "dev": true, + "requires": { + "kleur": "^4.1.5" + } + }, + "@poppinss/dumper": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", + "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", + "dev": true, + "requires": { + "@poppinss/colors": "^4.1.5", + "@sindresorhus/is": "^7.0.2", + "supports-color": "^10.0.0" + }, + "dependencies": { + "supports-color": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "dev": true + } + } + }, + "@poppinss/exception": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", + "dev": true + }, "@react-aria/breadcrumbs": { "version": "3.5.31", "resolved": "https://registry.npmjs.org/@react-aria/breadcrumbs/-/breadcrumbs-3.5.31.tgz", @@ -19190,6 +20466,18 @@ "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", "dev": true }, + "@sindresorhus/is": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz", + "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==", + "dev": true + }, + "@speed-highlight/core": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.14.tgz", + "integrity": "sha512-G4ewlBNhUtlLvrJTb88d2mdy2KRijzs4UhnlrOSRT4bmjh/IqNElZa3zkrZ+TC47TwtlDWzVLFADljF1Ijp5hA==", + "dev": true + }, "@stylistic/eslint-plugin": { "version": "5.9.0", "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.9.0.tgz", @@ -20695,6 +21983,12 @@ "resolved": "https://registry.npmjs.org/bind-event-listener/-/bind-event-listener-3.0.0.tgz", "integrity": "sha512-PJvH288AWQhKs2v9zyfYdPzlPqf5bXbGMmhmUIY9x4dAUGIWgomO771oBQNwJnMQSnUIXhKu6sgzpBRXTlvb8Q==" }, + "blake3-wasm": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", + "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", + "dev": true + }, "blurhash": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/blurhash/-/blurhash-2.0.5.tgz", @@ -20934,6 +22228,12 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, + "cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "dev": true + }, "core-js-compat": { "version": "3.48.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.48.0.tgz", @@ -21082,6 +22382,12 @@ "object-keys": "^1.1.1" } }, + "detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true + }, "direction": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/direction/-/direction-1.0.4.tgz", @@ -21202,6 +22508,12 @@ "is-arrayish": "^0.2.1" } }, + "error-stack-parser-es": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz", + "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==", + "dev": true + }, "es-abstract": { "version": "1.24.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz", @@ -22897,6 +24209,12 @@ "json-buffer": "3.0.1" } }, + "kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true + }, "knip": { "version": "5.85.0", "resolved": "https://registry.npmjs.org/knip/-/knip-5.85.0.tgz", @@ -23134,6 +24452,20 @@ "yargs": "^17.0.1" } }, + "miniflare": { + "version": "4.20260301.1", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260301.1.tgz", + "integrity": "sha512-fqkHx0QMKswRH9uqQQQOU/RoaS3Wjckxy3CUX3YGJr0ZIMu7ObvI+NovdYi6RIsSPthNtq+3TPmRNxjeRiasog==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "^0.34.5", + "undici": "7.18.2", + "workerd": "1.20260301.1", + "ws": "8.18.0", + "youch": "4.1.0-beta.10" + } + }, "minimatch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", @@ -23473,6 +24805,12 @@ } } }, + "path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true + }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -24053,6 +25391,41 @@ "es-object-atoms": "^1.0.0" } }, + "sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "dev": true, + "requires": { + "@img/colour": "^1.0.0", + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -24651,11 +26024,26 @@ "which-boxed-primitive": "^1.1.1" } }, + "undici": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.18.2.tgz", + "integrity": "sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==", + "dev": true + }, "undici-types": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==" }, + "unenv": { + "version": "2.0.0-rc.24", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", + "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", + "dev": true, + "requires": { + "pathe": "^2.0.3" + } + }, "unhomoglyph": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/unhomoglyph/-/unhomoglyph-1.0.6.tgz", @@ -25360,6 +26748,36 @@ "workbox-core": "7.4.0" } }, + "workerd": { + "version": "1.20260301.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260301.1.tgz", + "integrity": "sha512-oterQ1IFd3h7PjCfT4znSFOkJCvNQ6YMOyZ40YsnO3nrSpgB4TbJVYWFOnyJAw71/RQuupfVqZZWKvsy8GO3fw==", + "dev": true, + "requires": { + "@cloudflare/workerd-darwin-64": "1.20260301.1", + "@cloudflare/workerd-darwin-arm64": "1.20260301.1", + "@cloudflare/workerd-linux-64": "1.20260301.1", + "@cloudflare/workerd-linux-arm64": "1.20260301.1", + "@cloudflare/workerd-windows-64": "1.20260301.1" + } + }, + "wrangler": { + "version": "4.70.0", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.70.0.tgz", + "integrity": "sha512-PNDZ9o4e+B5x+1bUbz62Hmwz6G9lw+I9pnYe/AguLddJFjfIyt2cmFOUOb3eOZSoXsrhcEPUg2YidYIbVwUkfw==", + "dev": true, + "requires": { + "@cloudflare/kv-asset-handler": "0.4.2", + "@cloudflare/unenv-preset": "2.14.0", + "blake3-wasm": "2.1.5", + "esbuild": "0.27.3", + "fsevents": "~2.3.2", + "miniflare": "4.20260301.1", + "path-to-regexp": "6.3.0", + "unenv": "2.0.0-rc.24", + "workerd": "1.20260301.1" + } + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -25370,6 +26788,12 @@ "strip-ansi": "^6.0.0" } }, + "ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true + }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -25409,6 +26833,29 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" }, + "youch": { + "version": "4.1.0-beta.10", + "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", + "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", + "dev": true, + "requires": { + "@poppinss/colors": "^4.1.5", + "@poppinss/dumper": "^0.6.4", + "@speed-highlight/core": "^1.2.7", + "cookie": "^1.0.2", + "youch-core": "^0.3.3" + } + }, + "youch-core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", + "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", + "dev": true, + "requires": { + "@poppinss/exception": "^1.2.2", + "error-stack-parser-es": "^1.0.5" + } + }, "zod": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", diff --git a/package.json b/package.json index ae706794a..18c5cea19 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "ua-parser-js": "^1.0.41" }, "devDependencies": { + "@cloudflare/vite-plugin": "^1.26.0", "@element-hq/element-call-embedded": "0.16.3", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@eslint/compat": "2.0.2", @@ -113,6 +114,7 @@ "vite-plugin-pwa": "^1.2.0", "vite-plugin-static-copy": "^3.2.0", "vite-plugin-svgr": "4.5.0", - "vite-plugin-top-level-await": "^1.6.0" + "vite-plugin-top-level-await": "^1.6.0", + "wrangler": "^4.70.0" } } diff --git a/vite.config.ts b/vite.config.ts index 2c2f1619a..ab5757c2c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,6 +12,7 @@ import topLevelAwait from 'vite-plugin-top-level-await'; import { VitePWA } from 'vite-plugin-pwa'; import fs from 'fs'; import path from 'path'; +import { cloudflare } from '@cloudflare/vite-plugin'; import buildConfig from './build.config'; const packageJson = JSON.parse( @@ -56,10 +57,6 @@ const copyFiles = { dest: '', rename: 'pdf.worker.min.js', }, - { - src: 'netlify.toml', - dest: '', - }, { src: 'config.json', dest: '', @@ -166,6 +163,14 @@ export default defineConfig({ type: 'module', }, }), + cloudflare({ + config: { + compatibility_date: '2026-03-03', + assets: { + not_found_handling: 'single-page-application', + }, + }, + }), ], optimizeDeps: { // Rebuild dep optimizer cache on each dev start to avoid stale API shapes. From fa3e899162e7e85bc9ba62a02acf06b6818e70e2 Mon Sep 17 00:00:00 2001 From: hazre Date: Wed, 4 Mar 2026 14:47:23 +0100 Subject: [PATCH 02/67] ci: comment OpenTofu plans on Cloudflare worker prod PRs --- .../workflows/cloudflare-worker-preview.yml | 4 ++-- .github/workflows/cloudflare-worker-prod.yml | 20 +++++++++++++------ infra/README.md | 2 ++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cloudflare-worker-preview.yml b/.github/workflows/cloudflare-worker-preview.yml index 78889616b..4f1b941bf 100644 --- a/.github/workflows/cloudflare-worker-preview.yml +++ b/.github/workflows/cloudflare-worker-preview.yml @@ -34,7 +34,7 @@ jobs: } >> "$GITHUB_OUTPUT" - name: Setup node - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version-file: '.node-version' package-manager-cache: false @@ -99,7 +99,7 @@ jobs: } >> "$GITHUB_STEP_SUMMARY" - name: Publish preview URL - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 env: MARKER: '' PREVIEW_URL: ${{ steps.preview.outputs.preview_url }} diff --git a/.github/workflows/cloudflare-worker-prod.yml b/.github/workflows/cloudflare-worker-prod.yml index ed0d33ff5..b26091ace 100644 --- a/.github/workflows/cloudflare-worker-prod.yml +++ b/.github/workflows/cloudflare-worker-prod.yml @@ -10,6 +10,9 @@ on: - dev workflow_dispatch: +env: + OPENTOFU_VERSION: '1.11.5' + concurrency: group: cloudflare-infra cancel-in-progress: false @@ -20,8 +23,10 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + pull-requests: write env: CLOUDFLARE_API_TOKEN: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TF_VAR_account_id: ${{ secrets.TF_VAR_ACCOUNT_ID }} TF_VAR_zone_id: ${{ secrets.TF_VAR_ZONE_ID }} TF_HTTP_ADDRESS: ${{ secrets.TF_HTTP_ADDRESS }} @@ -49,7 +54,7 @@ jobs: printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV" - name: Setup node - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version-file: '.node-version' cache: 'npm' @@ -65,7 +70,7 @@ jobs: - name: Setup OpenTofu uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8 with: - tofu_version: 1.11.5 + tofu_version: ${{ env.OPENTOFU_VERSION }} - name: Check formatting run: tofu fmt -check @@ -76,8 +81,11 @@ jobs: - name: Validate configuration run: tofu validate -no-color - - name: Plan infrastructure - run: tofu plan -input=false -lock=false -no-color + - name: Comment PR plan + uses: dflook/tofu-plan@3f5dc358343fb58cd60f83b019e810315aa8258f # v2.2.3 + with: + path: infra/web + label: production apply: if: (github.event_name == 'push' && github.ref_name == 'dev') || github.event_name == 'workflow_dispatch' @@ -113,7 +121,7 @@ jobs: printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV" - name: Setup node - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version-file: '.node-version' cache: 'npm' @@ -129,7 +137,7 @@ jobs: - name: Setup OpenTofu uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8 with: - tofu_version: 1.11.5 + tofu_version: ${{ env.OPENTOFU_VERSION }} - name: Check formatting run: tofu fmt -check diff --git a/infra/README.md b/infra/README.md index 74c8d8ee2..0617d3779 100644 --- a/infra/README.md +++ b/infra/README.md @@ -97,6 +97,8 @@ Preview deploys: Production deploys: +- PRs that change `infra/web` get an OpenTofu plan comment on the PR from + `.github/workflows/cloudflare-worker-prod.yml`. - `.github/workflows/cloudflare-worker-prod.yml` builds the app and runs `tofu apply` on pushes to `dev`, or via manual workflow dispatch. - `tofu apply` uploads `dist/` as a new immutable Worker version with From 94797a9faf87608e1c3c64754905f2e364c52843 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 11:01:38 -0600 Subject: [PATCH 03/67] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 497fbc5cd..d2ae5b2a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Sable Client Changelog +## 1.3.3 + +- Fix unread counts and dot badges for muted rooms ([#118](https://github.com/7w1/sable/pull/118)) - [Evie Gauthier](https://github.com/Just-Insane) + ## 1.3.2 - 3/3/2026 - Content toggles in push notifications ([#88](https://github.com/7w1/sable/pull/88)) - [Evie Gauthier](https://github.com/Just-Insane) From f428b6364442e1a0d02b8427a4d1de90117d6ddb Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 12:25:49 -0600 Subject: [PATCH 04/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ae5b2a0..b5802d2b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.3.3 - Fix unread counts and dot badges for muted rooms ([#118](https://github.com/7w1/sable/pull/118)) - [Evie Gauthier](https://github.com/Just-Insane) +- /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120]) ## 1.3.2 - 3/3/2026 From e7ed00e5edfd65b5091b4d962a1ea2f5c5ae5a73 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 12:27:28 -0600 Subject: [PATCH 05/67] bump version --- package-lock.json | 4 ++-- package.json | 2 +- src/app/pages/auth/AuthFooter.tsx | 2 +- src/app/pages/client/WelcomePage.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c214abfbd..15a98aadd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sable", - "version": "1.3.2", + "version": "1.3.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sable", - "version": "1.3.2", + "version": "1.3.3", "license": "AGPL-3.0-only", "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "^1.7.7", diff --git a/package.json b/package.json index 0cd4acde3..b2f28665d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sable", - "version": "1.3.2", + "version": "1.3.3", "description": "Yet another matrix client fork", "type": "module", "packageManager": "npm@11.11.0", diff --git a/src/app/pages/auth/AuthFooter.tsx b/src/app/pages/auth/AuthFooter.tsx index 53d59271c..3f8f5c04f 100644 --- a/src/app/pages/auth/AuthFooter.tsx +++ b/src/app/pages/auth/AuthFooter.tsx @@ -14,7 +14,7 @@ export function AuthFooter() { target="_blank" rel="noreferrer" > - v1.3.2 + v1.3.3 Powered by Matrix diff --git a/src/app/pages/client/WelcomePage.tsx b/src/app/pages/client/WelcomePage.tsx index 316a6fe37..049de5c0c 100644 --- a/src/app/pages/client/WelcomePage.tsx +++ b/src/app/pages/client/WelcomePage.tsx @@ -19,7 +19,7 @@ export function WelcomePage() { Yet another matrix client fork.{' '} - v1.3.2 + v1.3.3 } From 79206bc6197b407df0925d4d702d6da17be62e34 Mon Sep 17 00:00:00 2001 From: hazre Date: Wed, 4 Mar 2026 16:53:41 +0100 Subject: [PATCH 06/67] ci: remove preview workflow --- .../workflows/cloudflare-worker-preview.yml | 143 ------------------ infra/README.md | 43 +++--- 2 files changed, 18 insertions(+), 168 deletions(-) delete mode 100644 .github/workflows/cloudflare-worker-preview.yml diff --git a/.github/workflows/cloudflare-worker-preview.yml b/.github/workflows/cloudflare-worker-preview.yml deleted file mode 100644 index 4f1b941bf..000000000 --- a/.github/workflows/cloudflare-worker-preview.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: Cloudflare Worker Preview Deploy - -on: - pull_request: - -concurrency: - group: cloudflare-worker-preview-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - deploy: - if: github.event.pull_request.head.repo.full_name == github.repository - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - - name: Prepare preview metadata - id: metadata - shell: bash - run: | - preview_message="$(git log -1 --pretty=%s)" - preview_message="$(printf '%s' "$preview_message" | head -c 100)" - - { - echo 'preview_message<> "$GITHUB_OUTPUT" - - - name: Setup node - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version-file: '.node-version' - package-manager-cache: false - - - name: Install dependencies - run: npm ci - - - name: Build app - run: npm run build - - - name: Upload Worker preview - id: deploy - uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1 - with: - apiToken: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.TF_VAR_ACCOUNT_ID }} - command: > - versions upload - -c dist/wrangler.json - --preview-alias pr-${{ github.event.pull_request.number }} - --message "${{ steps.metadata.outputs.preview_message }}" - - - name: Resolve preview URL - id: preview - env: - DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }} - COMMAND_OUTPUT: ${{ steps.deploy.outputs.command-output }} - PR_NUMBER: ${{ github.event.pull_request.number }} - shell: bash - run: | - alias="pr-${PR_NUMBER}" - preview_url="" - alias_url_pattern="^https?://${alias}-[^[:space:]]+$" - - if printf '%s\n' "$DEPLOYMENT_URL" | grep -Eq "$alias_url_pattern"; then - preview_url="$DEPLOYMENT_URL" - else - preview_url="$(printf '%s\n' "$COMMAND_OUTPUT" | grep -Eo "https?://${alias}-[^[:space:]\"'<>)]+" | head -n 1 || true)" - fi - - if ! printf '%s\n' "$preview_url" | grep -Eq "$alias_url_pattern"; then - echo "Failed to resolve aliased Worker preview URL." >&2 - exit 1 - fi - - { - echo "preview_alias=${alias}" - echo "preview_url=${preview_url}" - } >> "$GITHUB_OUTPUT" - - - name: Write deployment summary - env: - PREVIEW_ALIAS: ${{ steps.preview.outputs.preview_alias }} - PREVIEW_URL: ${{ steps.preview.outputs.preview_url }} - shell: bash - run: | - { - echo "## Cloudflare Worker Preview" - echo - echo "- Alias: \`${PREVIEW_ALIAS}\`" - echo "- Preview URL: ${PREVIEW_URL}" - } >> "$GITHUB_STEP_SUMMARY" - - - name: Publish preview URL - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - env: - MARKER: '' - PREVIEW_URL: ${{ steps.preview.outputs.preview_url }} - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const marker = process.env.MARKER; - const previewUrl = process.env.PREVIEW_URL; - if (!previewUrl) { - core.setFailed("Missing preview URL from Cloudflare deploy step."); - return; - } - - const body = `${marker}\nWorker preview: ${previewUrl}`; - const { owner, repo } = context.repo; - const issue_number = context.issue.number; - const comments = await github.paginate(github.rest.issues.listComments, { - owner, - repo, - issue_number, - }); - const existing = comments.find( - (comment) => comment.user.type === "Bot" && comment.body.includes(marker), - ); - - if (existing) { - await github.rest.issues.updateComment({ - owner, - repo, - comment_id: existing.id, - body, - }); - return; - } - - await github.rest.issues.createComment({ - owner, - repo, - issue_number, - body, - }); diff --git a/infra/README.md b/infra/README.md index 0617d3779..ad003c0ba 100644 --- a/infra/README.md +++ b/infra/README.md @@ -1,9 +1,7 @@ # Infrastructure -`infra/web` manages the Cloudflare Worker service, immutable Worker version uploads, -the live production deployment, and the Worker custom domain. Local setup uses -`terraform.tfvars.example` for shared inputs and `gitlab.http.tfbackend.example` for -the GitLab state backend config. +`infra/web` manages the Cloudflare Worker, immutable Worker versions, the live +production deployment, and the production custom domain. Prerequisites: @@ -84,28 +82,23 @@ If you already created local state before switching to GitLab state, use `tofu -chdir=infra/web init -reconfigure -migrate-state -backend-config="../gitlab.http.tfbackend"` once instead. -Preview deploys: +Preview builds: -- PR previews use Wrangler `versions upload` against the generated - `dist/wrangler.json`. -- That Wrangler-based preview path is temporary until the Cloudflare provider adds support for preview version/alias management. -- `npm run build` generates both `dist/` and `dist/wrangler.json`; Wrangler uploads a - preview Worker version and binds a stable alias such as `pr-123`. -- GitHub Actions also sets the preview version message from the current git commit - subject, truncated to 100 bytes to fit Cloudflare's limit. -- Preview URLs live on `workers.dev` and do not touch the live custom domain. +- `infra/web/main.tf` enables preview URL capability with `subdomain.previews_enabled = true`. +- Previews are handled by Cloudflare Workers Builds, not GitHub Actions. +- Connect the repo once in Cloudflare Workers Builds. +- Set the Cloudflare Builds deploy command to `npx wrangler versions upload`. +- This disables automatic deployments while still allowing Cloudflare to build PRs/branches and save them as preview versions. +- That keeps Cloudflare from promoting `dev` commits to production. Production stays on the OpenTofu/GitHub Actions path in this repo. + +```bash +npx wrangler versions upload +``` Production deploys: -- PRs that change `infra/web` get an OpenTofu plan comment on the PR from - `.github/workflows/cloudflare-worker-prod.yml`. -- `.github/workflows/cloudflare-worker-prod.yml` builds the app and runs `tofu apply` on - pushes to `dev`, or via manual workflow dispatch. -- `tofu apply` uploads `dist/` as a new immutable Worker version with - `cloudflare_worker_version`, then `cloudflare_workers_deployment` moves live traffic - to that exact version. -- GitHub Actions sets the production deployment message from the current git commit - subject, truncated to 100 bytes to fit Cloudflare's limit. -- `app.sable.moe` is the Worker custom domain for production. -- `cloudflare_workers_custom_domain` attaches the Worker to `app.sable.moe`, and - Cloudflare creates the backing DNS record automatically. +- `.github/workflows/cloudflare-worker-prod.yml` comments PR plans for `infra/web` changes. +- That PR plan job only runs for same-repo PRs, not fork PRs, because it needs repo secrets. +- The same workflow applies production on pushes to `dev` or manual dispatch. +- `tofu apply` uploads `dist/` through `cloudflare_worker_version` and promotes it with `cloudflare_workers_deployment`. +- Production lives on `app.sable.moe`. From 14bd3aa1f51eb700da4c2ae2dd604861d3093edf Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 12:49:08 -0600 Subject: [PATCH 07/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5802d2b0..822867c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix unread counts and dot badges for muted rooms ([#118](https://github.com/7w1/sable/pull/118)) - [Evie Gauthier](https://github.com/Just-Insane) - /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120]) +- Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it [#113](https://github.com/7w1/sable/pull/113). ## 1.3.2 - 3/3/2026 From 1046edf03d3b9be57c640bd26cd908c5aaf649ea Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 14:53:39 -0600 Subject: [PATCH 08/67] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 822867c7b..ea3022184 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ - Fix unread counts and dot badges for muted rooms ([#118](https://github.com/7w1/sable/pull/118)) - [Evie Gauthier](https://github.com/Just-Insane) - /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120]) -- Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it [#113](https://github.com/7w1/sable/pull/113). +- Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it ([#113](https://github.com/7w1/sable/pull/113)) +- Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) ## 1.3.2 - 3/3/2026 From 70ece20bfcaa7f4bca35a39248bda59214ad3f11 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 14:56:07 -0600 Subject: [PATCH 09/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea3022184..275bd0d15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120]) - Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it ([#113](https://github.com/7w1/sable/pull/113)) - Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) +- Fix consistency of nicknames in dm rooms ([#122](https://github.com/7w1/sable/pull/122)) - [Rose](https://github.com/dozro) ## 1.3.2 - 3/3/2026 From 33f14b657e47740cd58f4439d5f4a56b70db25ec Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 14:57:23 -0600 Subject: [PATCH 10/67] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 275bd0d15..1b675325c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.3.3 - Fix unread counts and dot badges for muted rooms ([#118](https://github.com/7w1/sable/pull/118)) - [Evie Gauthier](https://github.com/Just-Insane) -- /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120]) +- /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120](https://github.com/7w1/sable/pull/120)) - Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it ([#113](https://github.com/7w1/sable/pull/113)) - Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) - Fix consistency of nicknames in dm rooms ([#122](https://github.com/7w1/sable/pull/122)) - [Rose](https://github.com/dozro) From 9f40d4b989d4a7ba4b4866d691f0311feaba42d6 Mon Sep 17 00:00:00 2001 From: hazre Date: Wed, 4 Mar 2026 21:58:46 +0100 Subject: [PATCH 11/67] ci: extract reusable setup composite action and reuse across workflows --- .github/actions/prepare-tofu/action.yml | 36 +++++ .github/actions/setup/action.yml | 40 +++++ .github/workflows/cloudflare-web-deploy.yml | 80 ++++++++++ .github/workflows/cloudflare-worker-prod.yml | 155 ------------------- .github/workflows/quality-checks.yml | 44 ++---- infra/README.md | 2 +- 6 files changed, 174 insertions(+), 183 deletions(-) create mode 100644 .github/actions/prepare-tofu/action.yml create mode 100644 .github/actions/setup/action.yml create mode 100644 .github/workflows/cloudflare-web-deploy.yml delete mode 100644 .github/workflows/cloudflare-worker-prod.yml diff --git a/.github/actions/prepare-tofu/action.yml b/.github/actions/prepare-tofu/action.yml new file mode 100644 index 000000000..409a50ee4 --- /dev/null +++ b/.github/actions/prepare-tofu/action.yml @@ -0,0 +1,36 @@ +name: Prepare OpenTofu Deployment +description: Prepares OpenTofu in infra/web. + +inputs: + opentofu-version: + description: The OpenTofu version to install. + required: false + default: '1.11.5' + +runs: + using: composite + steps: + - name: Setup app and build + uses: ./.github/actions/setup + with: + build: 'true' + + - name: Setup OpenTofu + uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8 + with: + tofu_version: ${{ inputs.opentofu-version }} + + - name: Check formatting + shell: bash + working-directory: ${{ github.workspace }}/infra/web + run: tofu fmt -check + + - name: Initialize OpenTofu + shell: bash + working-directory: ${{ github.workspace }}/infra/web + run: tofu init -input=false -reconfigure + + - name: Validate configuration + shell: bash + working-directory: ${{ github.workspace }}/infra/web + run: tofu validate -no-color diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 000000000..b4aa12459 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,40 @@ +name: Setup App +description: Sets up Node.js, installs dependencies, and optionally builds the app. + +inputs: + install-command: + description: Command used to install dependencies. + required: false + default: npm ci + build: + description: Whether to build the app after installing dependencies. + required: false + default: 'false' + build-command: + description: Command used when build is enabled. + required: false + default: npm run build + +runs: + using: composite + steps: + - name: Setup node + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version-file: '.node-version' + cache: 'npm' + + - name: Install dependencies + shell: bash + working-directory: ${{ github.workspace }} + run: ${INPUTS_INSTALL_COMMAND} + env: + INPUTS_INSTALL_COMMAND: ${{ inputs.install-command }} + + - name: Build app + if: ${{ inputs.build == 'true' }} + shell: bash + working-directory: ${{ github.workspace }} + run: ${INPUTS_BUILD_COMMAND} + env: + INPUTS_BUILD_COMMAND: ${{ inputs.build-command }} diff --git a/.github/workflows/cloudflare-web-deploy.yml b/.github/workflows/cloudflare-web-deploy.yml new file mode 100644 index 000000000..bfd9ef931 --- /dev/null +++ b/.github/workflows/cloudflare-web-deploy.yml @@ -0,0 +1,80 @@ +name: Cloudflare Infra + +on: + pull_request: + paths: + - 'infra/web/**' + - '.github/workflows/cloudflare-web-deploy.yml' + - '.github/actions/prepare-tofu/**' + - '.github/actions/setup/**' + push: + branches: + - dev + workflow_dispatch: + +env: + CLOUDFLARE_API_TOKEN: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TF_VAR_workers_message: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || github.event.head_commit.message || github.sha }} + TF_VAR_account_id: ${{ secrets.TF_VAR_ACCOUNT_ID }} + TF_VAR_zone_id: ${{ secrets.TF_VAR_ZONE_ID }} + TF_HTTP_ADDRESS: ${{ secrets.TF_HTTP_ADDRESS }} + TF_HTTP_LOCK_ADDRESS: ${{ secrets.TF_HTTP_LOCK_ADDRESS }} + TF_HTTP_UNLOCK_ADDRESS: ${{ secrets.TF_HTTP_UNLOCK_ADDRESS }} + TF_HTTP_USERNAME: ${{ secrets.TF_HTTP_USERNAME }} + TF_HTTP_PASSWORD: ${{ secrets.TF_HTTP_PASSWORD }} + TF_HTTP_LOCK_METHOD: 'POST' + TF_HTTP_UNLOCK_METHOD: 'DELETE' + TF_HTTP_RETRY_WAIT_MIN: '5' + +concurrency: + group: cloudflare-infra + cancel-in-progress: false + +jobs: + plan: + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + defaults: + run: + working-directory: infra/web + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Prepare OpenTofu deployment + uses: ./.github/actions/prepare-tofu + + - name: Comment PR plan + uses: dflook/tofu-plan@3f5dc358343fb58cd60f83b019e810315aa8258f # v2.2.3 + with: + path: infra/web + label: production + + apply: + if: (github.event_name == 'push' && github.ref_name == 'dev') || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + permissions: + contents: read + defaults: + run: + working-directory: infra/web + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Prepare OpenTofu deployment + uses: ./.github/actions/prepare-tofu + + - name: Plan infrastructure + run: tofu plan -input=false -no-color + + - name: Apply infrastructure + run: tofu apply -input=false -auto-approve diff --git a/.github/workflows/cloudflare-worker-prod.yml b/.github/workflows/cloudflare-worker-prod.yml deleted file mode 100644 index b26091ace..000000000 --- a/.github/workflows/cloudflare-worker-prod.yml +++ /dev/null @@ -1,155 +0,0 @@ -name: Cloudflare Infra - -on: - pull_request: - paths: - - 'infra/web/**' - - '.github/workflows/cloudflare-worker-prod.yml' - push: - branches: - - dev - workflow_dispatch: - -env: - OPENTOFU_VERSION: '1.11.5' - -concurrency: - group: cloudflare-infra - cancel-in-progress: false - -jobs: - plan: - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TF_VAR_account_id: ${{ secrets.TF_VAR_ACCOUNT_ID }} - TF_VAR_zone_id: ${{ secrets.TF_VAR_ZONE_ID }} - TF_HTTP_ADDRESS: ${{ secrets.TF_HTTP_ADDRESS }} - TF_HTTP_LOCK_ADDRESS: ${{ secrets.TF_HTTP_LOCK_ADDRESS }} - TF_HTTP_UNLOCK_ADDRESS: ${{ secrets.TF_HTTP_UNLOCK_ADDRESS }} - TF_HTTP_USERNAME: ${{ secrets.TF_HTTP_USERNAME }} - TF_HTTP_PASSWORD: ${{ secrets.TF_HTTP_PASSWORD }} - TF_HTTP_LOCK_METHOD: 'POST' - TF_HTTP_UNLOCK_METHOD: 'DELETE' - TF_HTTP_RETRY_WAIT_MIN: '5' - defaults: - run: - working-directory: infra/web - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - - name: Prepare deployment metadata - shell: bash - run: | - workers_message="$(git log -1 --pretty=%s)" - workers_message="$(printf '%s' "$workers_message" | head -c 100)" - printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV" - - - name: Setup node - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version-file: '.node-version' - cache: 'npm' - - - name: Install dependencies - working-directory: . - run: npm ci - - - name: Build app - working-directory: . - run: npm run build - - - name: Setup OpenTofu - uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8 - with: - tofu_version: ${{ env.OPENTOFU_VERSION }} - - - name: Check formatting - run: tofu fmt -check - - - name: Initialize OpenTofu - run: tofu init -input=false -reconfigure - - - name: Validate configuration - run: tofu validate -no-color - - - name: Comment PR plan - uses: dflook/tofu-plan@3f5dc358343fb58cd60f83b019e810315aa8258f # v2.2.3 - with: - path: infra/web - label: production - - apply: - if: (github.event_name == 'push' && github.ref_name == 'dev') || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - permissions: - contents: read - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.TF_CLOUDFLARE_API_TOKEN }} - TF_VAR_account_id: ${{ secrets.TF_VAR_ACCOUNT_ID }} - TF_VAR_zone_id: ${{ secrets.TF_VAR_ZONE_ID }} - TF_HTTP_ADDRESS: ${{ secrets.TF_HTTP_ADDRESS }} - TF_HTTP_LOCK_ADDRESS: ${{ secrets.TF_HTTP_LOCK_ADDRESS }} - TF_HTTP_UNLOCK_ADDRESS: ${{ secrets.TF_HTTP_UNLOCK_ADDRESS }} - TF_HTTP_USERNAME: ${{ secrets.TF_HTTP_USERNAME }} - TF_HTTP_PASSWORD: ${{ secrets.TF_HTTP_PASSWORD }} - TF_HTTP_LOCK_METHOD: 'POST' - TF_HTTP_UNLOCK_METHOD: 'DELETE' - TF_HTTP_RETRY_WAIT_MIN: '5' - defaults: - run: - working-directory: infra/web - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - - name: Prepare deployment metadata - shell: bash - run: | - workers_message="$(git log -1 --pretty=%s)" - workers_message="$(printf '%s' "$workers_message" | head -c 100)" - printf 'TF_VAR_workers_message=%s\n' "$workers_message" >> "$GITHUB_ENV" - - - name: Setup node - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - with: - node-version-file: '.node-version' - cache: 'npm' - - - name: Install dependencies - working-directory: . - run: npm ci - - - name: Build app - working-directory: . - run: npm run build - - - name: Setup OpenTofu - uses: opentofu/setup-opentofu@9d84900f3238fab8cd84ce47d658d25dd008be2f # v1.0.8 - with: - tofu_version: ${{ env.OPENTOFU_VERSION }} - - - name: Check formatting - run: tofu fmt -check - - - name: Initialize OpenTofu - run: tofu init -input=false -reconfigure - - - name: Validate configuration - run: tofu validate -no-color - - - name: Plan infrastructure - run: tofu plan -input=false -no-color - - - name: Apply infrastructure - run: tofu apply -input=false -auto-approve diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml index fb8e582cf..9a37398e6 100644 --- a/.github/workflows/quality-checks.yml +++ b/.github/workflows/quality-checks.yml @@ -15,13 +15,10 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Setup node - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - with: - node-version-file: '.node-version' - cache: 'npm' - - name: Install dependencies - run: npm ci + + - name: Setup app + uses: ./.github/actions/setup + - name: Check formatting run: npm run fmt:check @@ -35,13 +32,10 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Setup node - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - with: - node-version-file: '.node-version' - cache: 'npm' - - name: Install dependencies - run: npm ci + + - name: Setup app + uses: ./.github/actions/setup + - name: Run ESLint run: npm run lint @@ -55,13 +49,10 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Setup node - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - with: - node-version-file: '.node-version' - cache: 'npm' - - name: Install dependencies - run: npm ci + + - name: Setup app + uses: ./.github/actions/setup + - name: Run TypeScript typecheck run: npm run typecheck -- --pretty false @@ -75,12 +66,11 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Setup node - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + + - name: Setup app + uses: ./.github/actions/setup with: - node-version-file: '.node-version' - cache: 'npm' - - name: Install dependencies - run: npm ci --ignore-scripts + install-command: npm ci --ignore-scripts + - name: Run Knip run: npm run knip diff --git a/infra/README.md b/infra/README.md index ad003c0ba..b1b0452da 100644 --- a/infra/README.md +++ b/infra/README.md @@ -97,7 +97,7 @@ npx wrangler versions upload Production deploys: -- `.github/workflows/cloudflare-worker-prod.yml` comments PR plans for `infra/web` changes. +- `.github/workflows/cloudflare-web-deploy.yml` comments PR plans for `infra/web` changes. - That PR plan job only runs for same-repo PRs, not fork PRs, because it needs repo secrets. - The same workflow applies production on pushes to `dev` or manual dispatch. - `tofu apply` uploads `dist/` through `cloudflare_worker_version` and promotes it with `cloudflare_workers_deployment`. From b8bf367551173898087d387c1750091238715ac7 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 16:44:51 -0600 Subject: [PATCH 12/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b675325c..d611456e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it ([#113](https://github.com/7w1/sable/pull/113)) - Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) - Fix consistency of nicknames in dm rooms ([#122](https://github.com/7w1/sable/pull/122)) - [Rose](https://github.com/dozro) +- Fix view source scroll bar ([#125](https://github.com/7w1/sable/pull/125)) ## 1.3.2 - 3/3/2026 From f846070400993df438a8c88ff30871467c6d3ac4 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 17:09:26 -0600 Subject: [PATCH 13/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d611456e5..92e8f7284 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) - Fix consistency of nicknames in dm rooms ([#122](https://github.com/7w1/sable/pull/122)) - [Rose](https://github.com/dozro) - Fix view source scroll bar ([#125](https://github.com/7w1/sable/pull/125)) +- Added back Cinny Light theme as an option ([#80](https://github.com/7w1/sable/issues/80), [#126](https://github.com/7w1/sable/pull/126)) ## 1.3.2 - 3/3/2026 From 2cf5b8382cb3159657318036b2eebd4475a1cb43 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 19:24:01 -0500 Subject: [PATCH 14/67] fix: improve message send UX - Remove 'Sending...' text from pending messages; text is now dimmed via opacity while in-flight to reduce timeline jump - Add 'Delete' button alongside 'Retry' on failed sends, using mx.cancelPendingEvent for client-side removal - Clear the input box immediately on send rather than waiting for the network round-trip to complete --- src/app/features/room/RoomInput.tsx | 8 +++----- src/app/features/room/RoomTimeline.tsx | 11 +++++++++++ src/app/features/room/message/Message.tsx | 24 ++++++++++++++++------- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 3c2ca1813..abd46d495 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -499,12 +499,10 @@ export const RoomInput = forwardRef( // Cancel failed — leave state intact for retry } } else { - try { - await mx.sendMessage(roomId, content as any); - } catch (error) { - log.error('failed to send message', { roomId }, error); - } resetInput(); + mx.sendMessage(roomId, content as any).catch((error: unknown) => { + log.error('failed to send message', { roomId }, error); + }); } }, [ mx, diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index c153ab524..f9a652c50 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -1197,6 +1197,14 @@ export function RoomTimeline({ [mx, room] ); + const handleDeleteFailedSend = useCallback( + (mEvent: MatrixEvent) => { + if (mEvent.getAssociatedStatus() !== EventStatus.NOT_SENT) return; + mx.cancelPendingEvent(mEvent); + }, + [mx] + ); + const handleEdit = useCallback( (editEvtId?: string) => { if (editEvtId) { @@ -1269,6 +1277,7 @@ export function RoomTimeline({ senderDisplayName={senderDisplayName} sendStatus={mEvent.getAssociatedStatus()} onResend={handleResend} + onDeleteFailedSend={handleDeleteFailedSend} onEditId={handleEdit} activeReplyId={activeReplyId} reply={ @@ -1356,6 +1365,7 @@ export function RoomTimeline({ senderDisplayName={senderDisplayName} sendStatus={mEvent.getAssociatedStatus()} onResend={handleResend} + onDeleteFailedSend={handleDeleteFailedSend} reply={ replyEventId && ( void; + onDeleteFailedSend?: (event: MatrixEvent) => void; }; function useMobileDoubleTap(callback: () => void, delay = 300) { @@ -308,6 +309,7 @@ function MessageInternal( activeReplyId, sendStatus, onResend, + onDeleteFailedSend, ...props }: MessageProps & { className?: string; children?: ReactNode }, ref: any @@ -445,6 +447,7 @@ function MessageInternal( sendStatus === EventStatus.SENDING; const isFailedSend = sendStatus === EventStatus.NOT_SENT; const canResend = isFailedSend && senderId === mx.getUserId() && !!onResend; + const canDeleteFailedSend = isFailedSend && senderId === mx.getUserId() && !!onDeleteFailedSend; const handleResendClick: MouseEventHandler = useCallback( (evt) => { @@ -455,6 +458,15 @@ function MessageInternal( [mEvent, onResend] ); + const handleDeleteFailedSendClick: MouseEventHandler = useCallback( + (evt) => { + evt.preventDefault(); + evt.stopPropagation(); + onDeleteFailedSend?.(mEvent); + }, + [mEvent, onDeleteFailedSend] + ); + const MSG_CONTENT_STYLE = { maxWidth: '100%' }; const msgContentJSX = ( @@ -484,13 +496,6 @@ function MessageInternal( {children} )} {reactions} - {isPendingSend && ( - - - Sending... - - - )} {isFailedSend && ( @@ -501,6 +506,11 @@ function MessageInternal( Retry )} + {canDeleteFailedSend && ( + + )} )} From d88682a2977285834588e923e4d038592a328734 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 19:26:21 -0500 Subject: [PATCH 15/67] fix: correct pending/failed message opacity levels P500 resolves to 1.0 (fully opaque) so pending messages were not visually dimmed at all. Switch to Placeholder (0.5) for pending to match Discord's treatment, and P300 (0.75) for failed to keep it visually distinct from pending. --- src/app/features/room/message/styles.css.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/features/room/message/styles.css.ts b/src/app/features/room/message/styles.css.ts index 8b52f526a..49ccfb928 100644 --- a/src/app/features/room/message/styles.css.ts +++ b/src/app/features/room/message/styles.css.ts @@ -57,11 +57,11 @@ export const ReactionsTooltipText = style({ }); export const MessagePending = style({ - opacity: config.opacity.P500, + opacity: config.opacity.Placeholder, }); export const MessageFailed = style({ - opacity: config.opacity.P400, + opacity: config.opacity.P300, }); export const SendStatusRow = style({ From 57822ab2b36eee061bc840050167397567c2d671 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 19:28:07 -0500 Subject: [PATCH 16/67] style: fix prettier formatting on delete button --- src/app/features/room/message/Message.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index ab2b7620a..65a88f9f8 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -507,7 +507,11 @@ function MessageInternal( )} {canDeleteFailedSend && ( - )} From 294029175efd557148fae9dd45e0613a6a8aee10 Mon Sep 17 00:00:00 2001 From: mini-bomba <55105495+mini-bomba@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:35:53 +0100 Subject: [PATCH 17/67] refactor(room): move reaction code to utils --- src/app/features/room/RoomTimeline.tsx | 25 +++------------------ src/app/utils/matrix.ts | 30 ++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index c153ab524..662c48ad2 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -51,7 +51,7 @@ import { import { isKeyHotkey } from 'is-hotkey'; import { Opts as LinkifyOpts } from 'linkifyjs'; import { useTranslation } from 'react-i18next'; -import { eventWithShortcode, factoryEventSentBy, getMxIdLocalPart } from '$utils/matrix'; +import { getMxIdLocalPart, toggleReaction } from '$utils/matrix'; import { useMatrixClient } from '$hooks/useMatrixClient'; import { ItemRange, useVirtualPaginator } from '$hooks/useVirtualPaginator'; import { useAlive } from '$hooks/useAlive'; @@ -85,7 +85,6 @@ import { getEventReactions, getLatestEditableEvt, getMemberDisplayName, - getReactionContent, isMembershipChanged, reactionOrEditEvent, } from '$utils/room'; @@ -1166,26 +1165,8 @@ export function RoomTimeline({ ); const handleReactionToggle = useCallback( - (targetEventId: string, key: string, shortcode?: string) => { - const relations = getEventReactions(room.getUnfilteredTimelineSet(), targetEventId); - const allReactions = relations?.getSortedAnnotationsByKey() ?? []; - const [, reactionsSet] = allReactions.find(([k]: [string, any]) => k === key) ?? []; - const reactions: MatrixEvent[] = reactionsSet ? Array.from(reactionsSet) : []; - const myReaction = reactions.find(factoryEventSentBy(mx.getUserId()!)); - - if (myReaction && !!(myReaction as any)?.isRelation()) { - mx.redactEvent(room.roomId, (myReaction as any).getId()); - return; - } - const rShortcode = - shortcode || - ((reactions.find(eventWithShortcode) as any)?.getContent().shortcode as string | undefined); - mx.sendEvent( - room.roomId, - MessageEvent.Reaction as any, - getReactionContent(targetEventId, key, rShortcode) - ); - }, + (targetEventId: string, key: string, shortcode?: string) => + toggleReaction(mx, room, targetEventId, key, shortcode), [mx, room] ); diff --git a/src/app/utils/matrix.ts b/src/app/utils/matrix.ts index 12b455b55..46d5e6ecc 100644 --- a/src/app/utils/matrix.ts +++ b/src/app/utils/matrix.ts @@ -16,8 +16,8 @@ import { import to from 'await-to-js'; import { IImageInfo, IThumbnailContent, IVideoInfo } from '$types/matrix/common'; import { AccountDataEvent } from '$types/matrix/accountData'; -import { Membership, StateEvent } from '$types/matrix/room'; -import { getStateEvent } from './room'; +import { Membership, MessageEvent, StateEvent } from '$types/matrix/room'; +import { getEventReactions, getReactionContent, getStateEvent } from './room'; const DOMAIN_REGEX = /\b(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}\b/; @@ -382,3 +382,29 @@ export const creatorsSupported = (version: string): boolean => { const unsupportedVersion = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; return !unsupportedVersion.includes(version); }; + +export const toggleReaction = ( + mx: MatrixClient, + room: Room, + targetEventId: string, + key: string, + shortcode?: string +) => { + const relations = getEventReactions(room.getUnfilteredTimelineSet(), targetEventId); + const allReactions = relations?.getSortedAnnotationsByKey() ?? []; + const [, reactionsSet] = allReactions.find(([k]: [string, any]) => k === key) ?? []; + const reactions: MatrixEvent[] = reactionsSet ? Array.from(reactionsSet) : []; + const myReaction = reactions.find(factoryEventSentBy(mx.getUserId()!)); + + if (myReaction && !!(myReaction as any)?.isRelation()) { + mx.redactEvent(room.roomId, (myReaction as any).getId()); + return; + } + const rShortcode = + shortcode || (reactions.find(eventWithShortcode)?.getContent().shortcode as string | undefined); + mx.sendEvent( + room.roomId, + MessageEvent.Reaction as any, + getReactionContent(targetEventId, key, rShortcode) + ); +}; From bf9b6f51116c9c6d1bed0e0cbacd80aa881c451a Mon Sep 17 00:00:00 2001 From: mini-bomba <55105495+mini-bomba@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:36:53 +0100 Subject: [PATCH 18/67] fix(editor): make autocomplete detection split on any whitespace --- src/app/components/editor/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/editor/utils.ts b/src/app/components/editor/utils.ts index 851bc30d3..85ff437a1 100644 --- a/src/app/components/editor/utils.ts +++ b/src/app/components/editor/utils.ts @@ -261,7 +261,8 @@ export const getPrevWorldRange = (editor: Editor): BaseRange | undefined => { const [cursorPoint] = Range.edges(selection); const worldStartPoint = getPointUntilChar(editor, cursorPoint, { reverse: true, - match: (char) => char === ' ', + // line breaks produce empty chars, not \n + match: (char) => /\s|^$/.test(char), }); return worldStartPoint && Editor.range(editor, worldStartPoint, cursorPoint); }; From b28160301a7a15af13475f7ffb5d355a861f30cc Mon Sep 17 00:00:00 2001 From: mini-bomba <55105495+mini-bomba@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:37:58 +0100 Subject: [PATCH 19/67] feat: quick react via message editor typing `+:` in the message editor will bring up the emoticon autocomplete prompt, where choosing an emoticon will clear the editor and react with that emoticon under the latest message this commit also splits the autocomplete prefixes in two: ones that can be used anywhere in the message, and those that only work at the beginning also i set a default type param on one of the autocomplete query functions because who wants to keep typing out that type everywhere all the time --- .../autocomplete/EmoticonAutocomplete.tsx | 25 +++++--- .../editor/autocomplete/autocompleteQuery.ts | 8 ++- src/app/features/room/RoomInput.tsx | 58 +++++++++++++++++-- .../features/room/message/MessageEditor.tsx | 4 +- .../features/settings/account/BioEditor.tsx | 3 +- 5 files changed, 80 insertions(+), 18 deletions(-) diff --git a/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx b/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx index a6c7b3b6b..169266454 100644 --- a/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx +++ b/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx @@ -23,10 +23,14 @@ type EmoticonCompleteHandler = (key: string, shortcode: string) => void; type EmoticonSearchItem = PackImageReader | IEmoji; type EmoticonAutocompleteProps = { + title?: string; imagePackRooms: Room[]; editor: Editor; query: AutocompleteQuery; requestClose: () => void; + // this allows you to override the default behaviour of inserting the selection + // used to implement the +: reaction shortcut + onEmoticonSelected?: EmoticonCompleteHandler; }; const SEARCH_OPTIONS: UseAsyncSearchOptions = { @@ -36,10 +40,12 @@ const SEARCH_OPTIONS: UseAsyncSearchOptions = { }; export function EmoticonAutocomplete({ + title, imagePackRooms, editor, query, requestClose, + onEmoticonSelected, }: EmoticonAutocompleteProps) { const mx = useMatrixClient(); const useAuthentication = useMediaAuthentication(); @@ -67,12 +73,14 @@ export function EmoticonAutocomplete({ else resetSearch(); }, [query.text, search, resetSearch]); - const handleAutocomplete: EmoticonCompleteHandler = (key, shortcode) => { - const emoticonEl = createEmoticonElement(key, shortcode); - replaceWithElement(editor, query.range, emoticonEl); - moveCursor(editor, true); - requestClose(); - }; + const handleAutocomplete: EmoticonCompleteHandler = + onEmoticonSelected ?? + ((key, shortcode) => { + const emoticonEl = createEmoticonElement(key, shortcode); + replaceWithElement(editor, query.range, emoticonEl); + moveCursor(editor, true); + requestClose(); + }); useKeyDown(window, (evt: KeyboardEvent) => { onTabPress(evt, () => { @@ -84,7 +92,10 @@ export function EmoticonAutocomplete({ }); return autoCompleteEmoticon.length === 0 ? null : ( - Emojis} requestClose={requestClose}> + {title ?? 'Emojis'}} + requestClose={requestClose} + > {autoCompleteEmoticon.map((emoticon) => { const isCustomEmoji = 'url' in emoticon; const key = isCustomEmoji ? emoticon.url : emoticon.unicode; diff --git a/src/app/components/editor/autocomplete/autocompleteQuery.ts b/src/app/components/editor/autocomplete/autocompleteQuery.ts index 1baa44a13..5b8294afb 100644 --- a/src/app/components/editor/autocomplete/autocompleteQuery.ts +++ b/src/app/components/editor/autocomplete/autocompleteQuery.ts @@ -5,12 +5,16 @@ export enum AutocompletePrefix { UserMention = '@', Emoticon = ':', Command = '/', + Reaction = '+:', } -export const AUTOCOMPLETE_PREFIXES: readonly AutocompletePrefix[] = [ +export const ANYWHERE_AUTOCOMPLETE_PREFIXES: readonly AutocompletePrefix[] = [ AutocompletePrefix.RoomMention, AutocompletePrefix.UserMention, AutocompletePrefix.Emoticon, +]; +export const BEGINNING_AUTOCOMPLETE_PREFIXES: readonly AutocompletePrefix[] = [ AutocompletePrefix.Command, + AutocompletePrefix.Reaction, ]; export type AutocompleteQuery = { @@ -34,7 +38,7 @@ export const getAutocompleteQueryText = ( prefix: string ): string => Editor.string(editor, queryRange).slice(prefix.length); -export const getAutocompleteQuery = ( +export const getAutocompleteQuery = ( editor: Editor, queryRange: BaseRange, validPrefixes: readonly TPrefix[] diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx index 3c2ca1813..a92e150a9 100644 --- a/src/app/features/room/RoomInput.tsx +++ b/src/app/features/room/RoomInput.tsx @@ -21,7 +21,7 @@ import { StickerEventContent, } from '$types/matrix-sdk'; import { ReactEditor } from 'slate-react'; -import { Editor, Transforms } from 'slate'; +import { Editor, Point, Range, Transforms } from 'slate'; import { Box, config, @@ -51,7 +51,6 @@ import { import { useMatrixClient } from '$hooks/useMatrixClient'; import { - AUTOCOMPLETE_PREFIXES, AutocompletePrefix, AutocompleteQuery, createEmoticonElement, @@ -73,6 +72,8 @@ import { getBeginCommand, trimCommand, getMentions, + ANYWHERE_AUTOCOMPLETE_PREFIXES, + BEGINNING_AUTOCOMPLETE_PREFIXES, } from '$components/editor'; import { EmojiBoard, EmojiBoardTab } from '$components/emoji-board'; import { UseStateProvider } from '$components/UseStateProvider'; @@ -82,6 +83,7 @@ import { getImageInfo, getMxIdLocalPart, mxcUrlToHttp, + toggleReaction, } from '$utils/matrix'; import { useTypingStatusUpdater } from '$hooks/useTypingStatusUpdater'; import { useFilePicker } from '$hooks/useFilePicker'; @@ -141,6 +143,7 @@ import { } from '$utils/delayedEvents'; import { timeHourMinute, timeDayMonthYear } from '$utils/time'; import { stopPropagation } from '$utils/keyboard'; +import { MessageEvent } from '$types/matrix/room'; import { SchedulePickerDialog } from './schedule-send'; import * as css from './schedule-send/SchedulePickerDialog.css'; import { @@ -559,9 +562,19 @@ export const RoomInput = forwardRef( } const prevWordRange = getPrevWorldRange(editor); - const query = prevWordRange - ? getAutocompleteQuery(editor, prevWordRange, AUTOCOMPLETE_PREFIXES) - : undefined; + if (!prevWordRange) { + setAutocompleteQuery(undefined); + return; + } + + const firstPosition = Editor.start(editor, []); + const isRangeAtBeginning = !Point.isAfter(Range.start(prevWordRange), firstPosition); + const query = + (isRangeAtBeginning + ? getAutocompleteQuery(editor, prevWordRange, BEGINNING_AUTOCOMPLETE_PREFIXES) + : undefined) ?? + getAutocompleteQuery(editor, prevWordRange, ANYWHERE_AUTOCOMPLETE_PREFIXES); + setAutocompleteQuery(query); }, [editor, sendTypingStatus, hideActivity] @@ -572,6 +585,31 @@ export const RoomInput = forwardRef( ReactEditor.focus(editor); }, [editor]); + const handleReactionAutocomplete = (key: string, shortcode: string) => { + const lastMessage = room + .getLiveTimeline() + .getEvents() + .findLast((event) => + ( + [ + MessageEvent.RoomMessage, + MessageEvent.RoomMessageEncrypted, + MessageEvent.Sticker, + ] as string[] + ).includes(event.getType()) + ); + const lastMessageId = lastMessage?.getId(); + + if (lastMessageId) { + toggleReaction(mx, room, lastMessageId, key, shortcode); + } + + resetEditor(editor); + resetEditorHistory(editor); + sendTypingStatus(false); + handleCloseAutocomplete(); + }; + const handleEmoticonSelect = (key: string, shortcode: string) => { editor.insertNode(createEmoticonElement(key, shortcode)); moveCursor(editor); @@ -680,6 +718,16 @@ export const RoomInput = forwardRef( requestClose={handleCloseAutocomplete} /> )} + {autocompleteQuery?.prefix === AutocompletePrefix.Reaction && ( + + )} {autocompleteQuery?.prefix === AutocompletePrefix.Command && ( ( const prevWordRange = getPrevWorldRange(editor); const query = prevWordRange - ? getAutocompleteQuery(editor, prevWordRange, AUTOCOMPLETE_PREFIXES) + ? getAutocompleteQuery(editor, prevWordRange, ANYWHERE_AUTOCOMPLETE_PREFIXES) : undefined; setAutocompleteQuery(query); }, diff --git a/src/app/features/settings/account/BioEditor.tsx b/src/app/features/settings/account/BioEditor.tsx index 3bb33467c..49b47d7b9 100644 --- a/src/app/features/settings/account/BioEditor.tsx +++ b/src/app/features/settings/account/BioEditor.tsx @@ -16,7 +16,6 @@ import { Editor, Transforms } from 'slate'; import { ReactEditor } from 'slate-react'; import { isKeyHotkey } from 'is-hotkey'; import { - AUTOCOMPLETE_PREFIXES, AutocompletePrefix, AutocompleteQuery, CustomEditor, @@ -145,7 +144,7 @@ export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditor } const prevWordRange = getPrevWorldRange(editor); const query = prevWordRange - ? getAutocompleteQuery(editor, prevWordRange, AUTOCOMPLETE_PREFIXES) + ? getAutocompleteQuery(editor, prevWordRange, [AutocompletePrefix.Emoticon]) : undefined; setAutocompleteQuery(query); }, From 049a12dbc47ad775d9237a3882ec4a2a6c3bda33 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 4 Mar 2026 22:28:44 +0100 Subject: [PATCH 20/67] fix(auth): disable auto-capitalization for server and username inputs --- src/app/pages/auth/ServerPicker.tsx | 2 ++ src/app/pages/auth/login/PasswordLoginForm.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/app/pages/auth/ServerPicker.tsx b/src/app/pages/auth/ServerPicker.tsx index e66d92a1d..10dddb7d0 100644 --- a/src/app/pages/auth/ServerPicker.tsx +++ b/src/app/pages/auth/ServerPicker.tsx @@ -89,6 +89,8 @@ export function ServerPicker({ size="500" readOnly={!allowCustomServer} onClick={allowCustomServer ? undefined : handleOpenServerMenu} + // disable auto-capitalization, which is usually undesirable for server name input. + autoCapitalize="off" after={ serverList.length === 0 || (serverList.length === 1 && !allowCustomServer) ? undefined : ( } /> {loginState.status === AsyncStatus.Error && ( From 1862e418f3b318483a4ac7e6af1a3a2a69cc6a5f Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 4 Mar 2026 22:28:44 +0100 Subject: [PATCH 21/67] formatting using fmt --- src/app/pages/auth/login/PasswordLoginForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/auth/login/PasswordLoginForm.tsx b/src/app/pages/auth/login/PasswordLoginForm.tsx index 6e98be1d3..74a55250a 100644 --- a/src/app/pages/auth/login/PasswordLoginForm.tsx +++ b/src/app/pages/auth/login/PasswordLoginForm.tsx @@ -211,7 +211,7 @@ export function PasswordLoginForm({ defaultUsername, defaultEmail }: PasswordLog required outlined // disable auto-capitalization, which is usually undesirable for username input. - autoCapitalize='off' + autoCapitalize="off" after={} /> {loginState.status === AsyncStatus.Error && ( From 3a191a7055a5b5599062039c19189f25e34f6953 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 20:06:18 -0600 Subject: [PATCH 22/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92e8f7284..5724da057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it ([#113](https://github.com/7w1/sable/pull/113)) - Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) - Fix consistency of nicknames in dm rooms ([#122](https://github.com/7w1/sable/pull/122)) - [Rose](https://github.com/dozro) +- Message sending improvements, color change instead of "Sending..." message. ([#128](https://github.com/7w1/sable/pull/128)) - [Evie Gauthier](https://github.com/Just-Insane) - Fix view source scroll bar ([#125](https://github.com/7w1/sable/pull/125)) - Added back Cinny Light theme as an option ([#80](https://github.com/7w1/sable/issues/80), [#126](https://github.com/7w1/sable/pull/126)) From 8b30a023ab3a935a622c91117461cb42d7aad978 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 20:16:26 -0600 Subject: [PATCH 23/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5724da057..0a3367968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Message sending improvements, color change instead of "Sending..." message. ([#128](https://github.com/7w1/sable/pull/128)) - [Evie Gauthier](https://github.com/Just-Insane) - Fix view source scroll bar ([#125](https://github.com/7w1/sable/pull/125)) - Added back Cinny Light theme as an option ([#80](https://github.com/7w1/sable/issues/80), [#126](https://github.com/7w1/sable/pull/126)) +- Fix auto capitalization in login screen ([#131](https://github.com/7w1/sable/pull/131)) - [Rose](https://github.com/dozro) ## 1.3.2 - 3/3/2026 From 05463747e85f2dcf4b6e478dd6bf7ed323d3d430 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 20:31:06 -0600 Subject: [PATCH 24/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a3367968..b0ea225f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix unread counts and dot badges for muted rooms ([#118](https://github.com/7w1/sable/pull/118)) - [Evie Gauthier](https://github.com/Just-Insane) - /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120](https://github.com/7w1/sable/pull/120)) +- Quick reactions by typing +:emoji and hitting tab ([#132](https://github.com/7w1/sable/pull/132)) - [mini-bomba](https://github.com/mini-bomba) - Add support for [MSC4140](https://github.com/matrix-org/matrix-spec-proposals/pull/4140) scheduled messages on homeservers that support it ([#113](https://github.com/7w1/sable/pull/113)) - Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) - Fix consistency of nicknames in dm rooms ([#122](https://github.com/7w1/sable/pull/122)) - [Rose](https://github.com/dozro) From c996e5e31ba0aff2e83a1442c64f9883081761c5 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 22:15:16 -0500 Subject: [PATCH 25/67] fix(notifications): iOS reliability, SW click handling, and account switching - HandleNotificationClick moved outside ClientRoot loading gate so SW postMessages are never dropped during account-switch reloads - iOS Safari event.source=null guard removed; type-check used instead - ToRoomEvent simplified: writes pendingNotificationAtom + sets active session, delegates navigation to NotificationJumper - NotificationJumper: jumpingRef prevents repeated navigation; stable performJumpRef avoids re-registering listeners on every atom change during account switch - BackgroundNotifications: uses SW showNotification for reliable tap routing on iOS; dedupeId is now userId+eventId scoped; visibility guard prevents backgrounded in-app popups; ref pattern avoids stale closure on settings - SW: persist/restore notification settings across iOS SW restarts via Cache API; group notifications by room (tag + renotify); prefer navigate() over postMessage when available; prefer visible tab on notificationclick - pushNotification: resolveSilent respects tweaks.sound; recipientId in title; fallbackNotification removed (redundant) - RoomTimeline: use ref for handleOpenEvent to stop re-pulling on every new message --- src/app/features/room/RoomTimeline.tsx | 11 +- src/app/hooks/useNotificationJumper.ts | 63 +++++--- src/app/pages/Router.tsx | 6 +- .../pages/client/BackgroundNotifications.tsx | 140 ++++++++++-------- src/app/pages/client/ClientNonUIFeatures.tsx | 127 +++++++++------- src/app/pages/client/ToRoomEvent.tsx | 56 +++---- src/app/utils/notificationStyle.ts | 11 +- src/sw.ts | 79 +++++++++- src/sw/pushNotification.ts | 60 ++++---- 9 files changed, 349 insertions(+), 204 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index c153ab524..0a44e571f 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -899,11 +899,18 @@ export function RoomTimeline({ ) ); + // Keep a stable ref so timeline state updates (new messages arriving) don't + // cause handleOpenEvent to rebuild and re-trigger this effect, yanking the + // user back to the notification event on every incoming message. + // We only want to scroll once per unique eventId value. + const handleOpenEventRef = useRef(handleOpenEvent); + handleOpenEventRef.current = handleOpenEvent; + useEffect(() => { if (eventId) { - handleOpenEvent(eventId); + handleOpenEventRef.current(eventId); } - }, [eventId, handleOpenEvent]); + }, [eventId]); // handleOpenEvent intentionally omitted — use ref above // Scroll to bottom on initial timeline load useLayoutEffect(() => { diff --git a/src/app/hooks/useNotificationJumper.ts b/src/app/hooks/useNotificationJumper.ts index 011549023..1d4f63eaa 100644 --- a/src/app/hooks/useNotificationJumper.ts +++ b/src/app/hooks/useNotificationJumper.ts @@ -1,4 +1,4 @@ -import { useCallback, useEffect } from 'react'; +import { useCallback, useEffect, useRef } from 'react'; import { useAtom, useAtomValue } from 'jotai'; import { SyncState, ClientEvent } from '$types/matrix-sdk'; import { activeSessionIdAtom, pendingNotificationAtom } from '../state/sessions'; @@ -14,30 +14,42 @@ export function NotificationJumper() { const { navigateRoom } = useRoomNavigate(); const log = createLogger('NotificationJumper'); + // Set true the moment we fire navigateRoom. Only reset when `pending` changes + // to a new value (via the effect below). Do NOT reset inside performJump itself: + // setPending(null) is async — resetting here creates a window where atom/render + // churn re-calls performJump (from the ClientEvent.Room listener or effect + // re-runs) before React has committed the null, causing repeated navigation. + const jumpingRef = useRef(false); + const performJump = useCallback(() => { - if (!pending) return; + if (!pending || jumpingRef.current) return; if (pending.targetSessionId && pending.targetSessionId !== activeSessionId) { - log.log('waiting for target session...', { + log.log('waiting for target session atom...', { targetSessionId: pending.targetSessionId, activeSessionId, }); return; } - const isSyncing = mx.getSyncState() === SyncState.Syncing; + // The mx client context may lag one render behind the atom — wait until it catches up. + if (pending.targetSessionId && mx.getUserId() !== pending.targetSessionId) { + log.log('waiting for mx client to switch to target session...', { + targetSessionId: pending.targetSessionId, + currentUserId: mx.getUserId(), + }); + return; + } + const isSyncing = mx.getSyncState() === SyncState.Syncing; const room = mx.getRoom(pending.roomId); const isJoined = room?.getMyMembership() === 'join'; if (isSyncing && isJoined) { log.log('jumping to:', pending.roomId); - - requestAnimationFrame(() => { - requestAnimationFrame(() => { - navigateRoom(pending.roomId, pending.eventId); - setPending(null); - }); - }); + jumpingRef.current = true; + navigateRoom(pending.roomId, pending.eventId); + setPending(null); + // jumpingRef stays true until pending changes — see effect below. } else { log.log('still waiting for room data...', { isSyncing, @@ -47,27 +59,38 @@ export function NotificationJumper() { } }, [pending, activeSessionId, mx, navigateRoom, setPending, log]); + // Reset the guard only when pending is replaced (new notification or cleared). + useEffect(() => { + jumpingRef.current = false; + }, [pending]); + + // Keep a stable ref to the latest performJump so that the listeners below + // always invoke the current version without adding performJump to their dep + // arrays. Adding performJump as a dep causes the effect to re-run (and call + // performJump again) on every atom change during an account switch — that is + // the second source of repeated navigation. + const performJumpRef = useRef(performJump); + performJumpRef.current = performJump; + useSyncState( mx, - useCallback( - (current) => { - if (current === SyncState.Syncing) performJump(); - }, - [performJump] - ) + // Stable callback — reads from ref, so useSyncState never re-registers. + useCallback((current) => { + if (current === SyncState.Syncing) performJumpRef.current(); + }, []) ); useEffect(() => { if (!pending) return undefined; - const onRoom = () => performJump(); + const onRoom = () => performJumpRef.current(); mx.on(ClientEvent.Room, onRoom); - performJump(); + performJumpRef.current(); return () => { mx.removeListener(ClientEvent.Room, onRoom); }; - }, [pending, mx, performJump]); + }, [pending, mx]); // performJump intentionally omitted — use ref above return null; } diff --git a/src/app/pages/Router.tsx b/src/app/pages/Router.tsx index d8f6471f7..a5891db6a 100644 --- a/src/app/pages/Router.tsx +++ b/src/app/pages/Router.tsx @@ -55,6 +55,7 @@ import { getSpaceLobbyPath, } from './pathUtils'; import { ClientBindAtoms, ClientLayout, ClientRoot } from './client'; +import { HandleNotificationClick, ClientNonUIFeatures } from './client/ClientNonUIFeatures'; import { Home, HomeRouteRoomProvider, HomeSearch } from './client/home'; import { Direct, DirectCreate, DirectRouteRoomProvider } from './client/direct'; import { RouteSpaceProvider, Space, SpaceRouteRoomProvider, SpaceSearch } from './client/space'; @@ -65,7 +66,6 @@ import { WelcomePage } from './client/WelcomePage'; import { SidebarNav } from './client/SidebarNav'; import { MobileFriendlyPageNav, MobileFriendlyClientNav } from './MobileFriendly'; import { ClientInitStorageAtom } from './client/ClientInitStorageAtom'; -import { ClientNonUIFeatures } from './client/ClientNonUIFeatures'; import { AuthRouteThemeManager, UnAuthRouteThemeManager } from './ThemeManager'; import { ClientRoomsNotificationPreferences } from './client/ClientRoomsNotificationPreferences'; import { HomeCreateRoom } from './client/home/CreateRoom'; @@ -141,6 +141,10 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize) }} element={ + {/* HandleNotificationClick must live outside ClientRoot's loading gate so + SW notification-click postMessages are never dropped during client + reloads (e.g., account switches). It only needs navigate + Jotai atoms. */} + diff --git a/src/app/pages/client/BackgroundNotifications.tsx b/src/app/pages/client/BackgroundNotifications.tsx index f0b683e4a..a4f90bc67 100644 --- a/src/app/pages/client/BackgroundNotifications.tsx +++ b/src/app/pages/client/BackgroundNotifications.tsx @@ -10,12 +10,7 @@ import { PushProcessor, } from '$types/matrix-sdk'; import { useAtomValue, useSetAtom } from 'jotai'; -import { - sessionsAtom, - activeSessionIdAtom, - Session, - pendingNotificationAtom, -} from '$state/sessions'; +import { sessionsAtom, activeSessionIdAtom, Session, sessionsHighlightAtom } from '$state/sessions'; import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; import { getMxIdLocalPart, mxcUrlToHttp } from '$utils/matrix'; @@ -29,16 +24,16 @@ import { NotificationType, StateEvent } from '$types/matrix/room'; import { createLogger } from '$utils/debug'; import LogoSVG from '$public/res/svg/cinny.svg'; import { nicknamesAtom } from '$state/nicknames'; -import { useMatrixClient } from '$hooks/useMatrixClient'; import { buildRoomMessageNotification, resolveNotificationPreviewText, } from '$utils/notificationStyle'; -import { mobileOrTablet } from '$utils/user-agent'; import { startClient, stopClient } from '$client/initMatrix'; import { useClientConfig } from '$hooks/useClientConfig'; const log = createLogger('BackgroundNotifications'); +const isClientReadyForNotifications = (state: SyncState | string | null): boolean => + state === SyncState.Prepared || state === SyncState.Syncing || state === SyncState.Catchup; const startBackgroundClient = async ( session: Session, @@ -66,12 +61,12 @@ const startBackgroundClient = async ( const waitForSync = (mx: MatrixClient): Promise => new Promise((resolve) => { const state = mx.getSyncState(); - if (state === SyncState.Syncing) { + if (isClientReadyForNotifications(state)) { resolve(); return; } const onSync = (newState: SyncState) => { - if (newState === SyncState.Syncing) { + if (isClientReadyForNotifications(newState)) { mx.removeListener(ClientEvent.Sync, onSync); resolve(); } @@ -83,7 +78,6 @@ export function BackgroundNotifications() { const clientConfig = useClientConfig(); const sessions = useAtomValue(sessionsAtom); const activeSessionId = useAtomValue(activeSessionIdAtom); - const setActiveSessionId = useSetAtom(activeSessionIdAtom); const [showNotifications] = useSetting(settingsAtom, 'useInAppNotifications'); const [usePushNotifications] = useSetting(settingsAtom, 'usePushNotifications'); const [notificationSound] = useSetting(settingsAtom, 'isNotificationSounds'); @@ -92,14 +86,22 @@ export function BackgroundNotifications() { settingsAtom, 'showMessageContentInEncryptedNotifications' ); - const forcePushOnMobile = usePushNotifications && mobileOrTablet(); - const activeMx = useMatrixClient(); + const shouldRunBackgroundNotifications = showNotifications || usePushNotifications; const nicknames = useAtomValue(nicknamesAtom); const nicknamesRef = useRef(nicknames); nicknamesRef.current = nicknames; + // Refs so handleTimeline callbacks always read current settings without stale closures + const showNotificationsRef = useRef(showNotifications); + showNotificationsRef.current = showNotifications; + const notificationSoundRef = useRef(notificationSound); + notificationSoundRef.current = notificationSound; + const showMessageContentRef = useRef(showMessageContent); + showMessageContentRef.current = showMessageContent; + const showEncryptedMessageContentRef = useRef(showEncryptedMessageContent); + showEncryptedMessageContentRef.current = showEncryptedMessageContent; const clientsRef = useRef>(new Map()); const notifiedEventsRef = useRef>(new Set()); - const setPending = useSetAtom(pendingNotificationAtom); + const setHighlights = useSetAtom(sessionsHighlightAtom); const inactiveSessions = sessions.filter( (s) => s.userId !== (activeSessionId ?? sessions[0]?.userId) @@ -116,36 +118,48 @@ export function BackgroundNotifications() { badge?: string; /** If `true` the notification plays no sound. */ silent?: boolean; - /** Callback when the user taps/clicks the notification. */ - onClick?: () => void; + /** Arbitrary payload attached to the notification. + * Must include { type, room_id, event_id, user_id } so the SW notificationclick + * handler can route the tap through HandleNotificationClick for account switching. */ + data?: unknown; } useEffect(() => { - if (forcePushOnMobile) return undefined; - if (!showNotifications) return undefined; + if (!shouldRunBackgroundNotifications) return undefined; const { current } = clientsRef; const activeIds = new Set(inactiveSessions.map((s) => s.userId)); - async function sendNotification(opts: NotifyOptions): Promise { + async function sendNotification(opts: NotifyOptions): Promise { + // Prefer ServiceWorkerRegistration.showNotification so that taps are handled + // by the SW notificationclick event. This routes through HandleNotificationClick + // (postMessage path) which does the account switch + deep link reliably on all + // platforms including iOS where window.Notification onclick is not fired. + if ('serviceWorker' in navigator) { + try { + const reg = await navigator.serviceWorker.ready; + await reg.showNotification(opts.title, { + body: opts.body, + icon: opts.icon, + badge: opts.badge, + silent: opts.silent ?? false, + data: opts.data, + } as NotificationOptions); + return; + } catch { + // Fall through to window.Notification if SW registration fails. + } + } if ('Notification' in window && window.Notification.permission === 'granted') { - const noti = new window.Notification(opts.title, { + // eslint-disable-next-line no-new + new window.Notification(opts.title, { icon: opts.icon, badge: opts.badge, body: opts.body, silent: opts.silent ?? false, + data: opts.data, }); - if (opts.onClick) { - const cb = opts.onClick; - noti.onclick = () => { - cb(); - noti.close(); - }; - } - return noti; } - - return undefined; } current.forEach((mx, userId) => { @@ -153,6 +167,12 @@ export function BackgroundNotifications() { log.log('stopping background client for', userId); stopClient(mx); current.delete(userId); + // Clear the highlight badge when this session is no longer a background account. + setHighlights((prev) => { + const next = { ...prev }; + delete next[userId]; + return next; + }); } }); @@ -176,18 +196,17 @@ export function BackgroundNotifications() { removed: boolean, data: { liveEvent: boolean } ) => { - if (mx.getSyncState() !== 'SYNCING') return; + if (!isClientReadyForNotifications(mx.getSyncState())) return; if (!room || !data?.liveEvent || room.isSpaceRoom()) return; if (!isNotificationEvent(mEvent)) return; const notifType = getNotificationType(mx, room.roomId); if (notifType === NotificationType.Mute) return; - const activeRoom = activeMx.getRoom(room.roomId); - if (activeRoom?.getMyMembership() === 'join') return; - const eventId = mEvent.getId(); - if (!eventId || notifiedEventsRef.current.has(eventId)) return; + if (!eventId) return; + const dedupeId = `${session.userId}:${eventId}`; + if (notifiedEventsRef.current.has(dedupeId)) return; const sender = mEvent.getSender(); if (!sender || sender === mx.getUserId()) return; @@ -206,28 +225,47 @@ export function BackgroundNotifications() { ? (mxcUrlToHttp(mx, avatarMxc, false, 96, 96, 'crop') ?? undefined) : LogoSVG; - const isHighlight = pushActions.tweaks?.highlight === true; + const loudByRule = Boolean(pushActions.tweaks?.sound); const isEncryptedRoom = !!getStateEvent(room, StateEvent.RoomEncryption); - notifiedEventsRef.current.add(eventId); + notifiedEventsRef.current.add(dedupeId); // Cap the set so it doesn't grow unbounded if (notifiedEventsRef.current.size > 200) { const first = notifiedEventsRef.current.values().next().value; if (first) notifiedEventsRef.current.delete(first); } + // Track highlight count for the account switcher badge. + if (pushActions.tweaks?.highlight) { + setHighlights((prev) => ({ + ...prev, + [session.userId]: (prev[session.userId] ?? 0) + 1, + })); + } + + // This component handles ONLY background (inactive) accounts. + // SW push covers the active account when the app is backgrounded. + // When the page is hidden, iOS suspends JS entirely — nothing to do here. + // Only show an in-app notification when the user is actively looking at the app. + if (document.visibilityState !== 'visible') return; + + // Respect in-app notification setting (read from ref to avoid stale closure) + if (!showNotificationsRef.current) return; + const notificationPayload = buildRoomMessageNotification({ - roomName: room.name ?? 'Unknown', + roomName: room.name ?? room.getCanonicalAlias() ?? room.roomId, roomAvatar, username: senderName, + recipientId: session.userId, previewText: resolveNotificationPreviewText({ content: mEvent.getContent(), eventType: mEvent.getType(), isEncryptedRoom, - showMessageContent, - showEncryptedMessageContent, + showMessageContent: showMessageContentRef.current, + showEncryptedMessageContent: showEncryptedMessageContentRef.current, }), - silent: !notificationSound || !isHighlight, + // Play sound only if the push rule requests it and the user has sounds enabled. + silent: !notificationSoundRef.current || !loudByRule, eventId, data: { type: mEvent.getType(), @@ -243,11 +281,7 @@ export function BackgroundNotifications() { badge: notificationPayload.options.badge, body: notificationPayload.options.body, silent: notificationPayload.options.silent ?? undefined, - onClick: () => { - window.focus(); - setPending({ roomId: room.roomId, eventId, targetSessionId: session.userId }); - if (session.userId !== activeSessionId) setActiveSessionId(session.userId); - }, + data: notificationPayload.options.data, }); }; @@ -262,19 +296,7 @@ export function BackgroundNotifications() { current.forEach((mx) => stopClient(mx)); current.clear(); }; - }, [ - clientConfig.slidingSync, - inactiveSessions, - forcePushOnMobile, - showNotifications, - notificationSound, - showMessageContent, - showEncryptedMessageContent, - activeMx, - activeSessionId, - setActiveSessionId, - setPending, - ]); + }, [clientConfig.slidingSync, inactiveSessions, shouldRunBackgroundNotifications, setHighlights]); return null; } diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index 5c608d374..d8e81e351 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -1,8 +1,8 @@ import { useAtomValue, useSetAtom } from 'jotai'; import { ReactNode, useCallback, useEffect, useRef } from 'react'; import { useNavigate } from 'react-router-dom'; -import { EventType, RoomEvent, RoomEventHandlerMap } from '$types/matrix-sdk'; -import { roomToUnreadAtom, unreadEqual, unreadInfoToUnread } from '$state/room/roomToUnread'; +import { EventType, PushProcessor, RoomEvent, RoomEventHandlerMap } from '$types/matrix-sdk'; +import { roomToUnreadAtom } from '$state/room/roomToUnread'; import LogoSVG from '$public/res/svg/cinny.svg'; import LogoUnreadSVG from '$public/res/svg/cinny-unread.svg'; import LogoHighlightSVG from '$public/res/svg/cinny-highlight.svg'; @@ -19,10 +19,9 @@ import { getMemberDisplayName, getNotificationType, getStateEvent, - getUnreadInfo, isNotificationEvent, } from '$utils/room'; -import { NotificationType, StateEvent, UnreadInfo } from '$types/matrix/room'; +import { NotificationType, StateEvent } from '$types/matrix/room'; import { getMxIdLocalPart, mxcUrlToHttp } from '$utils/matrix'; import { useSelectedRoom } from '$hooks/router/useSelectedRoom'; import { useInboxNotificationsSelected } from '$hooks/router/useInbox'; @@ -89,13 +88,24 @@ function FaviconUpdater() { } try { navigator.setAppBadge(total); - if (usePushNotifications && total === 0) { - registration - .getNotifications() - .then((pushNotifications) => - pushNotifications.forEach((pushNotification) => pushNotification.close()) - ); - navigator.clearAppBadge(); + if (usePushNotifications) { + if (total === 0) { + // All rooms read — clear every notification and the badge. + registration.getNotifications().then((notifs) => notifs.forEach((n) => n.close())); + navigator.clearAppBadge(); + } else { + // Dismiss notifications for individual rooms that are now fully read. + registration.getNotifications().then((notifs) => { + notifs.forEach((n) => { + const notifRoomId = n.data?.room_id; + if (!notifRoomId) return; + const roomUnread = roomToUnread.get(notifRoomId); + if (!roomUnread || (roomUnread.total === 0 && roomUnread.highlight === 0)) { + n.close(); + } + }); + }); + } } } catch { // Likely Firefox/Gecko-based and doesn't support badging API @@ -115,7 +125,6 @@ function InviteNotifications() { const [showNotifications] = useSetting(settingsAtom, 'useInAppNotifications'); const [usePushNotifications] = useSetting(settingsAtom, 'usePushNotifications'); const [notificationSound] = useSetting(settingsAtom, 'isNotificationSounds'); - const forcePushOnMobile = usePushNotifications && mobileOrTablet(); const notify = useCallback( (count: number) => { @@ -140,16 +149,22 @@ function InviteNotifications() { }, []); useEffect(() => { - if (forcePushOnMobile) return; - if (usePushNotifications && document.visibilityState !== 'visible') return; - if (invites.length > perviousInviteLen && mx.getSyncState() === 'SYNCING') { - if (showNotifications && notificationPermission('granted')) { - notify(invites.length - perviousInviteLen); - } + if (invites.length <= perviousInviteLen || mx.getSyncState() !== 'SYNCING') return; - if (notificationSound) { - playSound(); - } + // Page hidden: if push is enabled, SW handles the OS notification. If not, nothing to do. + if (document.visibilityState !== 'visible') return; + + // Page is visible — show in-app experience. + // On mobile with push: iOS-style — play sound only, no OS notification (SW is silent when + // the app is visible on mobile, matching foreground behaviour of native chat apps). + // On desktop with push: SW skipped (saw a visible client), so we show the OS notification. + // Without push: always show OS notification when page is visible. + const isVisibleMobileWithPush = usePushNotifications && mobileOrTablet(); + if (!isVisibleMobileWithPush && showNotifications && notificationPermission('granted')) { + notify(invites.length - perviousInviteLen); + } + if (notificationSound) { + playSound(); } }, [ mx, @@ -157,7 +172,6 @@ function InviteNotifications() { perviousInviteLen, showNotifications, usePushNotifications, - forcePushOnMobile, notificationSound, notify, playSound, @@ -174,7 +188,7 @@ function InviteNotifications() { function MessageNotifications() { const audioRef = useRef(null); const notifRef = useRef(); - const unreadCacheRef = useRef>(new Map()); + const notifiedEventsRef = useRef>(new Set()); const mx = useMatrixClient(); const useAuthentication = useMediaAuthentication(); const [showNotifications] = useSetting(settingsAtom, 'useInAppNotifications'); @@ -185,7 +199,6 @@ function MessageNotifications() { settingsAtom, 'showMessageContentInEncryptedNotifications' ); - const forcePushOnMobile = usePushNotifications && mobileOrTablet(); const nicknames = useAtomValue(nicknamesAtom); const nicknamesRef = useRef(nicknames); nicknamesRef.current = nicknames; @@ -202,6 +215,7 @@ function MessageNotifications() { roomId, eventId, previewText, + silent, }: { roomName: string; roomAvatar?: string; @@ -209,13 +223,14 @@ function MessageNotifications() { roomId: string; eventId: string; previewText: string; + silent: boolean; }) => { const payload = buildRoomMessageNotification({ roomName, roomAvatar, username, previewText, - silent: true, + silent, eventId, }); const noti = new window.Notification(payload.title, payload.options); @@ -240,6 +255,7 @@ function MessageNotifications() { }, []); useEffect(() => { + const pushProcessor = new PushProcessor(mx); const handleTimelineEvent: RoomEventHandlerMap[RoomEvent.Timeline] = ( mEvent, room, @@ -247,9 +263,7 @@ function MessageNotifications() { removed, data ) => { - if (forcePushOnMobile) return; if (mx.getSyncState() !== 'SYNCING') return; - if (usePushNotifications && document.visibilityState !== 'visible') return; if (document.hasFocus() && (selectedRoomId === room?.roomId || notificationSelected)) return; if ( @@ -265,19 +279,28 @@ function MessageNotifications() { const sender = mEvent.getSender(); const eventId = mEvent.getId(); if (!sender || !eventId || mEvent.getSender() === mx.getUserId()) return; - const unreadInfo = getUnreadInfo(room); - const cachedUnreadInfo = unreadCacheRef.current.get(room.roomId); - unreadCacheRef.current.set(room.roomId, unreadInfo); + const pushActions = pushProcessor.actionsForEvent(mEvent); + if (!pushActions?.notify) return; + const loudByRule = Boolean(pushActions.tweaks?.sound); - if (unreadInfo.total === 0) return; - if ( - cachedUnreadInfo && - unreadEqual(unreadInfoToUnread(cachedUnreadInfo), unreadInfoToUnread(unreadInfo)) - ) { - return; + // Deduplicate: never fire the same notification twice for the same event. + if (notifiedEventsRef.current.has(eventId)) return; + notifiedEventsRef.current.add(eventId); + if (notifiedEventsRef.current.size > 200) { + const first = notifiedEventsRef.current.values().next().value; + if (first) notifiedEventsRef.current.delete(first); } - if (showNotifications && notificationPermission('granted')) { + // Page hidden: if push is enabled, SW handles the OS notification. If not, nothing to do. + if (document.visibilityState !== 'visible') return; + + // Page is visible — show in-app experience. + // On mobile with push: iOS-style — play sound only, no OS notification (SW is silent when + // the app is visible on mobile, matching foreground behaviour of native chat apps). + // On desktop with push: SW skipped (saw a visible client), so we show the OS notification. + // Without push: always show OS notification when page is visible. + const isVisibleMobileWithPush = usePushNotifications && mobileOrTablet(); + if (!isVisibleMobileWithPush && showNotifications && notificationPermission('granted')) { const isEncryptedRoom = !!getStateEvent(room, StateEvent.RoomEncryption); const avatarMxc = room.getAvatarFallbackMember()?.getMxcAvatarUrl() ?? room.getMxcAvatarUrl(); @@ -299,10 +322,12 @@ function MessageNotifications() { showMessageContent, showEncryptedMessageContent, }), + // Play sound only if the push rule requests it and the user has sounds enabled. + silent: !notificationSound || !loudByRule, }); } - if (notificationSound) { + if (notificationSound && loudByRule) { playSound(); } }; @@ -318,7 +343,6 @@ function MessageNotifications() { showMessageContent, showEncryptedMessageContent, usePushNotifications, - forcePushOnMobile, playSound, notify, selectedRoomId, @@ -351,15 +375,17 @@ type ClientNonUIFeaturesProps = { children: ReactNode; }; -function HandleNotificationClick() { +export function HandleNotificationClick() { const navigate = useNavigate(); - const activeSessionId = useAtomValue(activeSessionIdAtom); const setActiveSessionId = useSetAtom(activeSessionIdAtom); const setPending = useSetAtom(pendingNotificationAtom); useEffect(() => { const handleNotificationClickEvent = (event: any) => { - if (!event.data || !event.source) return; + if (!event.data) return; + // Note: do NOT guard on event.source — iOS Safari sets it to null for + // SW-to-client postMessages (Webkit divergence from spec). The type check + // below is the correct way to filter unrelated messages. const eventData = event.data; if (!(eventData?.type === 'notificationToRoomEvent')) return; const messageData = eventData?.message; @@ -374,9 +400,9 @@ function HandleNotificationClick() { switch (eventType) { case EventType.RoomMessage: case EventType.RoomMessageEncrypted: - if (targetSessionId && targetSessionId !== activeSessionId) { - setActiveSessionId(targetSessionId); - } + // Always set the target session — jotai ignores no-ops if already active. + // This ensures we never accidentally navigate under the wrong account. + if (targetSessionId) setActiveSessionId(targetSessionId); setPending({ roomId: messageData!.room_id, eventId: messageData!.event_id, @@ -385,9 +411,7 @@ function HandleNotificationClick() { return; case EventType.RoomMember: if (!(messageData?.content?.membership === 'invite')) return; - if (targetSessionId && targetSessionId !== activeSessionId) { - setActiveSessionId(targetSessionId); - } + if (targetSessionId) setActiveSessionId(targetSessionId); navigate(getInboxInvitesPath()); break; default: @@ -399,7 +423,7 @@ function HandleNotificationClick() { return () => { navigator.serviceWorker.removeEventListener('message', handleNotificationClickEvent); }; - }, [activeSessionId, navigate, setActiveSessionId, setPending]); + }, [navigate, setActiveSessionId, setPending]); return null; } @@ -415,7 +439,9 @@ function SyncNotificationSettingsWithServiceWorker() { useEffect(() => { if (!('serviceWorker' in navigator)) return; - const preferPushOnMobile = usePushNotifications && mobileOrTablet(); + // preferPushOnMobile=false: SW skips push when page is visible on all devices. + // The in-app path handles the visible case (sound on mobile, OS notification on desktop). + const preferPushOnMobile = false; const payload = { type: 'setNotificationSettings' as const, notificationSoundEnabled: notificationSound, @@ -443,7 +469,6 @@ export function ClientNonUIFeatures({ children }: ClientNonUIFeaturesProps) { - {children} diff --git a/src/app/pages/client/ToRoomEvent.tsx b/src/app/pages/client/ToRoomEvent.tsx index 41d47b81f..48321e66e 100644 --- a/src/app/pages/client/ToRoomEvent.tsx +++ b/src/app/pages/client/ToRoomEvent.tsx @@ -1,43 +1,35 @@ -import { useEffect, useState, useCallback } from 'react'; -import { useParams } from 'react-router-dom'; -import { useAtomValue } from 'jotai'; -import { SyncState } from '$types/matrix-sdk'; - -import { useRoomNavigate } from '../../hooks/useRoomNavigate'; -import { useMatrixClient } from '../../hooks/useMatrixClient'; -import { useSyncState } from '../../hooks/useSyncState'; -import { roomToParentsAtom } from '../../state/room/roomToParents'; -import { mDirectAtom } from '../../state/mDirectList'; +import { useEffect } from 'react'; +import { useParams, useSearchParams } from 'react-router-dom'; +import { useSetAtom } from 'jotai'; +import { activeSessionIdAtom, pendingNotificationAtom } from '$state/sessions'; +// ToRoomEvent handles the /to/:room_id/:event_id route used by the SW when it +// opens a new window for a push notification (killed-app case) OR by client.navigate() +// on iOS where postMessage is unreliable after focus(). +// +// It does NOT navigate itself. Instead it writes to pendingNotificationAtom so +// that NotificationJumper handles the actual navigation once the correct client +// is synced. This survives the ClientRoot account-switch reload that happens when +// setActiveSessionId() changes the active session: ToRoomEvent unmounts as soon +// as ClientRoot calls navigate(getHomePath()), but the atom value persists and +// NotificationJumper picks it up once the new client is ready. export function ToRoomEvent() { - const mx = useMatrixClient(); - const roomToParents = useAtomValue(roomToParentsAtom); - const mDirects = useAtomValue(mDirectAtom); const { room_id: roomId, event_id: eventId } = useParams(); - const { navigateRoom } = useRoomNavigate(); - const [syncState, setSyncState] = useState(mx?.getSyncState() ?? null); - - useSyncState( - mx, - useCallback((s) => setSyncState(s), []) - ); + const [searchParams] = useSearchParams(); + const targetUserId = searchParams.get('uid') ?? undefined; + const setActiveSessionId = useSetAtom(activeSessionIdAtom); + const setPending = useSetAtom(pendingNotificationAtom); useEffect(() => { - if (!roomId || !mx) { - return; - } - if (syncState !== SyncState.Syncing) { - return; - } - if (!roomToParents.size || !mDirects.size) { - return; - } - + if (!roomId) return; + const rid = roomId; // narrowed to string + if (targetUserId) setActiveSessionId(targetUserId); + setPending({ roomId: rid, eventId, targetSessionId: targetUserId }); + // Push a clean entry onto history so the back button doesn't return to /to/… if (window.history.length <= 2) { window.history.pushState({}, '', '/'); } - navigateRoom(roomId, eventId); - }, [mx, syncState, roomToParents, mDirects, roomId, eventId, navigateRoom]); + }, [roomId, eventId, targetUserId, setActiveSessionId, setPending]); return null; } diff --git a/src/app/utils/notificationStyle.ts b/src/app/utils/notificationStyle.ts index 0bfd85ad4..550a511f7 100644 --- a/src/app/utils/notificationStyle.ts +++ b/src/app/utils/notificationStyle.ts @@ -11,6 +11,10 @@ type RoomMessageNotificationInput = { silent?: boolean; eventId?: string; data?: unknown; + /** Matrix user ID of the account that received the notification. When provided, + * the account's localpart is appended to the title so multi-account users know + * which account the notification is for. */ + recipientId?: string; }; type NotificationPayload = { @@ -62,6 +66,9 @@ export const resolveNotificationPreviewText = ({ return encryptedContext ? ENCRYPTED_MESSAGE_PREVIEW : DEFAULT_MESSAGE_PREVIEW; }; +/** Extracts the localpart (everything between @ and the first :) from a Matrix user ID. */ +const toLocalpart = (userId: string): string => userId.match(/^@([^:]+):/)?.[1] ?? userId; + export const buildRoomMessageNotification = ({ roomName, username, @@ -70,14 +77,16 @@ export const buildRoomMessageNotification = ({ silent, eventId, data, + recipientId, }: RoomMessageNotificationInput): NotificationPayload => { const sender = getString(username, 'Someone'); const room = getString(roomName, 'Unknown'); const message = getString(previewText, DEFAULT_MESSAGE_PREVIEW); const avatar = getString(roomAvatar, DEFAULT_NOTIFICATION_ICON); + const recipientSuffix = recipientId ? ` • ${toLocalpart(recipientId)}` : ''; return { - title: `${sender} in ${room}`, + title: `${sender} in ${room}${recipientSuffix}`, options: { icon: avatar, badge: avatar || DEFAULT_NOTIFICATION_BADGE, diff --git a/src/sw.ts b/src/sw.ts index 51c5124ad..87fbc3488 100644 --- a/src/sw.ts +++ b/src/sw.ts @@ -17,6 +17,47 @@ const { handlePushNotificationPushData } = createPushNotifications(self, () => ( showEncryptedMessageContent, })); +/** Cache key used to persist notification settings across SW restarts (iOS kills the SW frequently). */ +const SW_SETTINGS_CACHE = 'sable-sw-settings-v1'; +const SW_SETTINGS_URL = '/sw-settings-meta'; + +async function persistSettings() { + try { + const cache = await self.caches.open(SW_SETTINGS_CACHE); + await cache.put( + SW_SETTINGS_URL, + new Response( + JSON.stringify({ + notificationSoundEnabled, + preferPushOnMobile, + showMessageContent, + showEncryptedMessageContent, + }), + { headers: { 'Content-Type': 'application/json' } } + ) + ); + } catch { + // Ignore — caches may be unavailable in some environments. + } +} + +async function loadPersistedSettings() { + try { + const cache = await self.caches.open(SW_SETTINGS_CACHE); + const response = await cache.match(SW_SETTINGS_URL); + if (!response) return; + const s = await response.json(); + if (typeof s.notificationSoundEnabled === 'boolean') + notificationSoundEnabled = s.notificationSoundEnabled; + if (typeof s.preferPushOnMobile === 'boolean') preferPushOnMobile = s.preferPushOnMobile; + if (typeof s.showMessageContent === 'boolean') showMessageContent = s.showMessageContent; + if (typeof s.showEncryptedMessageContent === 'boolean') + showEncryptedMessageContent = s.showEncryptedMessageContent; + } catch { + // Ignore — stale or missing cache is fine; we fall back to defaults. + } +} + type SessionInfo = { accessToken: string; baseUrl: string; @@ -138,6 +179,8 @@ self.addEventListener('message', (event: ExtendableMessageEvent) => { showEncryptedMessageContent = (data as { showEncryptedMessageContent: boolean }) .showEncryptedMessageContent; } + // Persist so settings survive SW restart (iOS kills the SW aggressively). + event.waitUntil(persistSettings()); } }); @@ -213,6 +256,10 @@ const onPushNotification = async (event: PushEvent) => { return; } + // The SW may have been restarted by the OS (iOS is aggressive about this), + // so in-memory settings would be at their defaults. Reload from the cache. + await loadPersistedSettings(); + const clients = await self.clients.matchAll({ type: 'window', includeUncontrolled: true }); const hasVisibleClient = clients.some((client) => client.visibilityState === 'visible'); if (hasVisibleClient && !preferPushOnMobile) { @@ -258,8 +305,16 @@ self.addEventListener('notificationclick', (event: NotificationEvent) => { (eventType === EventType.RoomMessage || eventType === EventType.RoomMessageEncrypted) && messageData?.room_id && messageData?.event_id - ) - targetUrl = `${scope}to/${messageData.room_id}/${messageData.event_id}`; + ) { + // Include the target user ID as ?uid= so ToRoomEvent can switch to the + // correct account before navigating. This covers client.navigate() on iOS + // Safari where postMessage is unreliable after focus(). + const uidParam = + typeof messageData?.user_id === 'string' + ? `?uid=${encodeURIComponent(messageData.user_id)}` + : ''; + targetUrl = `${scope}to/${messageData.room_id}/${messageData.event_id}${uidParam}`; + } if (eventType === EventType.RoomMember && messageData?.content?.membership === 'invite') targetUrl = `${scope}inbox/invites/`; @@ -272,13 +327,27 @@ self.addEventListener('notificationclick', (event: NotificationEvent) => { event.waitUntil( self.clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clientList) => { - const focusedClient = clientList.find((client): client is WindowClient => 'focus' in client); + // Prefer a visible (foreground) tab; fall back to any open window client. + const focusedClient = + clientList.find((c) => c.visibilityState === 'visible') ?? + clientList.find((c): c is WindowClient => 'focus' in c); if (focusedClient) { - return focusedClient.focus().then(() => { - postMessageToClient(focusedClient); + return focusedClient.focus().then((wc) => { + // Prefer client.navigate() — draft API, available on Chrome/Chromium + // (all Android PWAs and desktop), unavailable on iOS Safari / Firefox. + const client = wc ?? focusedClient; + if ('navigate' in client && typeof (client as any).navigate === 'function') { + return (client as any).navigate(targetUrl); + } + // navigate() unavailable: use postMessage. The existing client (whether + // it was in the foreground or just minimized) has a live JS context by + // the time focus() resolves. HandleNotificationClick in the page will + // receive the message and dispatch the account-switch + deep link. + postMessageToClient(client); return null; }); } + // No existing client — open a new window. ToRoomEvent handles the route. if (self.clients.openWindow) { return self.clients.openWindow(targetUrl).then(() => null); } diff --git a/src/sw/pushNotification.ts b/src/sw/pushNotification.ts index 1459df547..b83d956fa 100644 --- a/src/sw/pushNotification.ts +++ b/src/sw/pushNotification.ts @@ -16,8 +16,11 @@ export const createPushNotifications = ( self: ServiceWorkerGlobalScope, getNotificationSettings: () => NotificationSettings ) => { - const resolveSilent = (silent: unknown): boolean => { + const resolveSilent = (silent: unknown, tweakSound?: unknown): boolean => { if (typeof silent === 'boolean') return silent; + // If the push rule doesn't request a sound tweak, the notification should be silent + // (no sound), regardless of the user's global sound preference. + if (!tweakSound) return true; return !getNotificationSettings().notificationSoundEnabled; }; @@ -29,14 +32,24 @@ export const createPushNotifications = ( icon?: string, badge?: string ) => { - await self.registration.showNotification(title, { + const roomId: string | undefined = data?.room_id; + // Group by room so new messages in the same room replace the previous + // notification rather than stacking individually. renotify: true ensures + // the user is still alerted when the existing tag is replaced. + const tag = roomId ? `room-${roomId}` : (data?.event_id ?? 'Cinny'); + const renotify = !!roomId; + // `renotify` is a valid Web API property absent from TypeScript's NotificationOptions type. + // Build the options object separately to avoid the excess-property check, then cast. + const notifOptions = { body, icon: icon ?? DEFAULT_NOTIFICATION_ICON, badge: badge ?? DEFAULT_NOTIFICATION_BADGE, - tag: data?.event_id ?? 'Cinny', + tag, + renotify, silent, data, - }); + }; + await self.registration.showNotification(title, notifOptions as NotificationOptions); }; const handleRoomMessageNotification = async (pushData: any) => { @@ -59,8 +72,9 @@ export const createPushNotifications = ( showMessageContent: getNotificationSettings().showMessageContent, showEncryptedMessageContent: getNotificationSettings().showEncryptedMessageContent, }), - silent: resolveSilent(pushData?.silent), + silent: resolveSilent(pushData?.silent, pushData?.tweaks?.sound), eventId: pushData?.event_id, + recipientId: typeof pushData?.user_id === 'string' ? pushData.user_id : undefined, data, }); await showNotificationWithData( @@ -93,8 +107,9 @@ export const createPushNotifications = ( showMessageContent: getNotificationSettings().showMessageContent, showEncryptedMessageContent: getNotificationSettings().showEncryptedMessageContent, }), - silent: resolveSilent(pushData?.silent), + silent: resolveSilent(pushData?.silent, pushData?.tweaks?.sound), eventId: pushData?.event_id, + recipientId: typeof pushData?.user_id === 'string' ? pushData.user_id : undefined, data, }); await showNotificationWithData( @@ -128,27 +143,6 @@ export const createPushNotifications = ( await showNotificationWithData('New Invitation', body, data, resolveSilent(pushData?.silent)); }; - const fallbackNotification = async (pushData: any) => { - const body = pushData?.content?.body; - let title; - if (body) { - title = pushData?.sender_display_name - ? `${pushData.sender_display_name}${pushData?.room_name ? ` in ${pushData.room_name}` : ''}` - : 'New Notification'; - } else { - title = 'You have a new Notification'; - } - const data = { - type: pushData?.type, - room_id: pushData?.room_id, - event_id: pushData?.event_id, - user_id: pushData?.user_id, - timestamp: Date.now(), - ...pushData.data, - }; - await showNotificationWithData(title, body, data, resolveSilent(pushData?.silent)); - }; - const handlePushNotificationPushData = async (pushData: any) => { const eventType = pushData?.type as EventType | undefined; if (!eventType) { @@ -158,19 +152,19 @@ export const createPushNotifications = ( switch (eventType) { case EventType.RoomMessage: case EventType.Sticker: - return handleRoomMessageNotification(pushData); + await handleRoomMessageNotification(pushData); + break; case EventType.RoomMessageEncrypted: - return handleEncryptedMessageNotification(pushData); + await handleEncryptedMessageNotification(pushData); + break; case EventType.RoomMember: if (!(pushData?.content?.membership === 'invite')) break; - return handleInvitationNotification(pushData); - + await handleInvitationNotification(pushData); + break; default: // no voip support in app anyway break; } - - return fallbackNotification(pushData); }; return { handlePushNotificationPushData }; From c2a43ec43a55fa14afb51b9bca3dcd80403475ab Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 22:15:26 -0500 Subject: [PATCH 26/67] fix(badges): improve unread count calculation and background session highlight badges - getUnreadInfo: guard stale-count clamp with roomHaveUnread; exclude own messages from clamp trigger; walk live timeline to compute real fallback counts using PushProcessor instead of hard-coding dot badge - roomToUnreadAtom: remove mDirectAtom dependency for DM parent filtering; add ClientEvent.Room handler to seed badge state when rooms join - sessionsHighlightAtom added to track highlight counts per inactive session - AccountSwitcherTab: show UnreadBadge on inactive session rows and sidebar icon --- .../client/sidebar/AccountSwitcherTab.tsx | 34 ++++++++++++-- src/app/state/room/roomToUnread.ts | 36 +++++++++++---- src/app/state/sessions.ts | 9 +++- src/app/utils/room.ts | 46 ++++++++++++++----- 4 files changed, 100 insertions(+), 25 deletions(-) diff --git a/src/app/pages/client/sidebar/AccountSwitcherTab.tsx b/src/app/pages/client/sidebar/AccountSwitcherTab.tsx index 866055157..50ff707a6 100644 --- a/src/app/pages/client/sidebar/AccountSwitcherTab.tsx +++ b/src/app/pages/client/sidebar/AccountSwitcherTab.tsx @@ -17,8 +17,14 @@ import { import FocusTrap from 'focus-trap-react'; import { useAtom, useAtomValue, useSetAtom } from 'jotai'; import { useNavigate } from 'react-router-dom'; -import { sessionsAtom, activeSessionIdAtom, Session } from '$state/sessions'; -import { SidebarItem, SidebarItemTooltip, SidebarAvatar } from '$components/sidebar'; +import { sessionsAtom, activeSessionIdAtom, Session, sessionsHighlightAtom } from '$state/sessions'; +import { + SidebarItem, + SidebarItemTooltip, + SidebarAvatar, + SidebarItemBadge, +} from '$components/sidebar'; +import { UnreadBadge } from '$components/unread-badge'; import { UserAvatar } from '$components/user-avatar'; import { nameInitials } from '$utils/common'; import { getMxIdLocalPart, mxcUrlToHttp } from '$utils/matrix'; @@ -42,6 +48,7 @@ function AccountRow({ displayName, avatarUrl, isBusy, + highlightCount, onSwitch, onSignOut, }: { @@ -50,6 +57,7 @@ function AccountRow({ displayName?: string; avatarUrl?: string; isBusy?: boolean; + highlightCount?: number; onSwitch: (session: Session) => void; onSignOut: (session: Session) => void; }) { @@ -77,6 +85,9 @@ function AccountRow({ } after={ + {!isActive && highlightCount != null && highlightCount > 0 && ( + + )} {isActive && ( )} @@ -126,6 +137,7 @@ export function AccountSwitcherTab() { const sessions = useAtomValue(sessionsAtom); const [activeSessionId, setActiveSessionId] = useAtom(activeSessionIdAtom); const setSessions = useSetAtom(sessionsAtom); + const [sessionHighlights, setSessionHighlights] = useAtom(sessionsHighlightAtom); const useAuthentication = useMediaAuthentication(); const [menuAnchor, setMenuAnchor] = useState(); @@ -161,8 +173,14 @@ export function AccountSwitcherTab() { setMenuAnchor(undefined); navigate(getHomePath(), { replace: true }); setActiveSessionId(session.userId); + // Clear the highlight badge for the account we're switching to. + setSessionHighlights((prev) => { + const next = { ...prev }; + delete next[session.userId]; + return next; + }); }, - [navigate, setActiveSessionId] + [navigate, setActiveSessionId, setSessionHighlights] ); const handleSignOut = useCallback( @@ -219,6 +237,10 @@ export function AccountSwitcherTab() { getMxIdLocalPart(activeSession?.userId ?? '') ?? activeSession?.userId ?? ''; const label = activeDisplayName ?? activeLocalPart; + const inactiveHighlightTotal = sessions + .filter((s) => s.userId !== (activeSessionId ?? sessions[0]?.userId)) + .reduce((sum, s) => sum + (sessionHighlights[s.userId] ?? 0), 0); + if (!activeSession) return null; return ( @@ -240,6 +262,11 @@ export function AccountSwitcherTab() { )} + {inactiveHighlightTotal > 0 && ( + + + + )} diff --git a/src/app/state/room/roomToUnread.ts b/src/app/state/room/roomToUnread.ts index 706b4bd7f..cf0064380 100644 --- a/src/app/state/room/roomToUnread.ts +++ b/src/app/state/room/roomToUnread.ts @@ -10,6 +10,7 @@ import { ReceiptContent, ReceiptType, EventType, + ClientEvent, } from '$types/matrix-sdk'; import { useCallback, useEffect, useRef } from 'react'; import { @@ -32,7 +33,6 @@ import { useSyncState } from '$hooks/useSyncState'; import { useRoomsNotificationPreferencesContext } from '$hooks/useRoomsNotificationPreferences'; import { getClientSyncDiagnostics } from '$client/initMatrix'; import { roomToParentsAtom } from './roomToParents'; -import { mDirectAtom } from '../mDirectList'; export type RoomToUnreadAction = | { @@ -123,14 +123,13 @@ const baseRoomToUnread = atom(new Map()); export const roomToUnreadAtom = atom( (get) => get(baseRoomToUnread), (get, set, action) => { - const dmRoomIds = get(mDirectAtom); - const getEffectiveParents = (roomId: string): Set => - dmRoomIds.has(roomId) ? new Set() : getAllParents(get(roomToParentsAtom), roomId); + const allParentsOf = (roomId: string): Set => + getAllParents(get(roomToParentsAtom), roomId); if (action.type === 'RESET') { const draftRoomToUnread: RoomToUnread = new Map(); action.unreadInfos.forEach((unreadInfo) => { - putUnreadInfo(draftRoomToUnread, getEffectiveParents(unreadInfo.roomId), unreadInfo); + putUnreadInfo(draftRoomToUnread, allParentsOf(unreadInfo.roomId), unreadInfo); }); set(baseRoomToUnread, draftRoomToUnread); return; @@ -144,7 +143,7 @@ export const roomToUnreadAtom = atom deleteUnreadInfo( draftRoomToUnread, - getEffectiveParents(unreadInfo.roomId), + allParentsOf(unreadInfo.roomId), unreadInfo.roomId ) ) @@ -154,14 +153,14 @@ export const roomToUnreadAtom = atom - putUnreadInfo(draftRoomToUnread, getEffectiveParents(unreadInfo.roomId), unreadInfo) + putUnreadInfo(draftRoomToUnread, allParentsOf(unreadInfo.roomId), unreadInfo) ) ); return; @@ -170,7 +169,7 @@ export const roomToUnreadAtom = atom - deleteUnreadInfo(draftRoomToUnread, getEffectiveParents(action.roomId), action.roomId) + deleteUnreadInfo(draftRoomToUnread, allParentsOf(action.roomId), action.roomId) ) ); } @@ -329,6 +328,25 @@ export const useBindRoomToUnreadAtom = (mx: MatrixClient, unreadAtom: typeof roo }; }, [mx, setUnreadAtom]); + // Seed badge state immediately when a room is first registered with the client + // (e.g. after joining or receiving an invite that gets auto-accepted). + // This avoids the brief window after refresh where badges are invisible until + // the next timeline event arrives. Notifications are NOT triggered here — + // ClientNonUIFeatures handles live notification pop-ups via its own listener. + useEffect(() => { + const handleRoomAdded = (room: Room) => { + if (room.isSpaceRoom() || room.getMyMembership() !== Membership.Join) return; + const unreadInfo = getUnreadInfo(room, { applyFixup: shouldApplyUnreadFixup() }); + if (unreadInfo.total > 0 || unreadInfo.highlight > 0) { + setUnreadAtom({ type: 'PUT', unreadInfo }); + } + }; + mx.on(ClientEvent.Room, handleRoomAdded as (room: Room) => void); + return () => { + mx.removeListener(ClientEvent.Room, handleRoomAdded as (room: Room) => void); + }; + }, [mx, setUnreadAtom, shouldApplyUnreadFixup]); + useEffect( () => () => { if (spaceChildResetTimerRef.current !== null) { diff --git a/src/app/state/sessions.ts b/src/app/state/sessions.ts index 5b02e8410..fc833c332 100644 --- a/src/app/state/sessions.ts +++ b/src/app/state/sessions.ts @@ -165,8 +165,15 @@ export const activeSessionIdAtom = atom(null); + +/** + * Tracks the count of highlight-level (mention/keyword) notifications received + * by each background (inactive) session. Keyed by userId. + * Cleared when a session becomes active or is signed out. + */ +export const sessionsHighlightAtom = atom>({}); diff --git a/src/app/utils/room.ts b/src/app/utils/room.ts index aed17e84b..495774219 100644 --- a/src/app/utils/room.ts +++ b/src/app/utils/room.ts @@ -13,6 +13,7 @@ import { MatrixEvent, MsgType, NotificationCountType, + PushProcessor, RelationType, Room, RoomMember, @@ -240,18 +241,24 @@ export const getUnreadInfo = (room: Room, options?: UnreadInfoOptions): UnreadIn } let total = room.getUnreadNotificationCount(NotificationCountType.Total); - let highlight = room.getUnreadNotificationCount(NotificationCountType.Highlight); - let syntheticDotUnread = false; + const highlight = room.getUnreadNotificationCount(NotificationCountType.Highlight); // If our latest main-timeline notification event is confirmed read, clamp its stale count. // Only apply to the room (non-thread) portion so thread reply counts are preserved. - if (userId && total > 0 && highlight === 0) { + // Guard: only clamp when the room has NO receipt-confirmed unread events; if roomHaveUnread + // is true then there genuinely are unread messages and the SDK count is not fully stale. + if (userId && total > 0 && highlight === 0 && !roomHaveUnread(room.client, room)) { const roomTotal = room.getRoomUnreadNotificationCount(NotificationCountType.Total); if (roomTotal > 0) { const liveEvents = room.getLiveTimeline().getEvents(); + // Exclude the user's own messages: own sent events are always "read" (hasUserReadEvent + // returns true for them), which would cause the clamp to fire incorrectly. const latestNotification = [...liveEvents] .reverse() - .find((event) => !event.isSending() && isNotificationEvent(event)); + .find( + (event) => + !event.isSending() && event.getSender() !== userId && isNotificationEvent(event) + ); const latestNotificationId = latestNotification?.getId(); if (latestNotificationId && room.hasUserReadEvent(userId, latestNotificationId)) { // Subtract only the stale main-timeline count; thread totals remain intact. @@ -260,19 +267,34 @@ export const getUnreadInfo = (room: Room, options?: UnreadInfoOptions): UnreadIn } } - // Fallback for cases where SDK counters are stale/zero but unread-by-receipt state still exists. - // Represent as a dot badge (count=0) rather than a numeric badge. - if (total === 0 && highlight === 0 && roomHaveUnread(room.client, room)) { - highlight = 1; - syntheticDotUnread = true; + // Fallback: SDK counters are stale/zero but there are receipt-confirmed unread + // messages. Walk the live timeline to compute real counts so the badge number + // and highlight colour reflect actual state rather than a hard-coded stub. + if (total === 0 && highlight === 0 && userId && roomHaveUnread(room.client, room)) { + const readUpToId = room.getEventReadUpTo(userId); + const liveEvents = room.getLiveTimeline().getEvents(); + let fallbackTotal = 0; + let fallbackHighlight = 0; + const pushProcessor = new PushProcessor(room.client); + for (let i = liveEvents.length - 1; i >= 0; i -= 1) { + const event = liveEvents[i]; + if (!event) break; + if (event.getId() === readUpToId) break; + if (isNotificationEvent(event) && event.getSender() !== userId) { + fallbackTotal += 1; + const pushActions = pushProcessor.actionsForEvent(event); + if (pushActions?.tweaks?.highlight) fallbackHighlight += 1; + } + } + if (fallbackTotal > 0) { + return { roomId: room.roomId, highlight: fallbackHighlight, total: fallbackTotal }; + } } - const resolvedTotal = syntheticDotUnread ? total : Math.max(total, highlight); - return { roomId: room.roomId, highlight, - total: resolvedTotal, + total: Math.max(total, highlight), }; }; From 3a4961e7745ab83a9fe2e975cdbaa980f81bc30b Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 22:15:32 -0500 Subject: [PATCH 27/67] feat(settings): add Show Unread Counts toggle to Visual Tweaks Hides numeric counts on room and sidebar badges while keeping the dot indicator active. Defaults to on. Exposed in both Appearance and Cosmetics settings panels. --- src/app/components/unread-badge/UnreadBadge.tsx | 8 ++++++-- src/app/features/settings/cosmetics/Cosmetics.tsx | 10 ++++++++++ src/app/features/settings/cosmetics/Themes.tsx | 10 ++++++++++ src/app/state/settings.ts | 2 ++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/app/components/unread-badge/UnreadBadge.tsx b/src/app/components/unread-badge/UnreadBadge.tsx index 6a62642a3..9029cc9b7 100644 --- a/src/app/components/unread-badge/UnreadBadge.tsx +++ b/src/app/components/unread-badge/UnreadBadge.tsx @@ -1,6 +1,8 @@ import { CSSProperties, ReactNode } from 'react'; import { Box, Badge, toRem, Text } from 'folds'; import { millify } from '$plugins/millify'; +import { useSetting } from '$state/hooks/settings'; +import { settingsAtom } from '$state/settings'; type UnreadBadgeProps = { highlight?: boolean; @@ -18,15 +20,17 @@ export function UnreadBadgeCenter({ children }: { children: ReactNode }) { } export function UnreadBadge({ highlight, count }: UnreadBadgeProps) { + const [showCounts] = useSetting(settingsAtom, 'showUnreadCounts'); + const showNumber = showCounts && count > 0; return ( 0 ? '400' : '200'} + size={showNumber ? '400' : '200'} fill="Solid" radii="Pill" outlined={false} > - {count > 0 && ( + {showNumber && ( {millify(count)} diff --git a/src/app/features/settings/cosmetics/Cosmetics.tsx b/src/app/features/settings/cosmetics/Cosmetics.tsx index 722d501c6..7a21588d0 100644 --- a/src/app/features/settings/cosmetics/Cosmetics.tsx +++ b/src/app/features/settings/cosmetics/Cosmetics.tsx @@ -171,6 +171,7 @@ function IdentityCosmetics() { ); const [uniformIcons, setUniformIcons] = useSetting(settingsAtom, 'uniformIcons'); const [rightBubbles, setRightBubbles] = useSetting(settingsAtom, 'useRightBubbles'); + const [showUnreadCounts, setShowUnreadCounts] = useSetting(settingsAtom, 'showUnreadCounts'); return ( @@ -218,6 +219,15 @@ function IdentityCosmetics() { after={} /> + + + } + /> + ); } diff --git a/src/app/features/settings/cosmetics/Themes.tsx b/src/app/features/settings/cosmetics/Themes.tsx index ac666bdca..1440ae602 100644 --- a/src/app/features/settings/cosmetics/Themes.tsx +++ b/src/app/features/settings/cosmetics/Themes.tsx @@ -327,6 +327,7 @@ function PageZoomInput() { } export function Appearance() { const [twitterEmoji, setTwitterEmoji] = useSetting(settingsAtom, 'twitterEmoji'); + const [showUnreadCounts, setShowUnreadCounts] = useSetting(settingsAtom, 'showUnreadCounts'); return ( @@ -346,6 +347,15 @@ export function Appearance() { } /> + + + } + /> + ); diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index a68f8dfc5..64dfe3d27 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -67,6 +67,7 @@ export interface Settings { rightSwipeAction: RightSwipeAction; hideMembershipInReadOnly: boolean; useRightBubbles: boolean; + showUnreadCounts: boolean; } const defaultSettings: Settings = { @@ -120,6 +121,7 @@ const defaultSettings: Settings = { rightSwipeAction: RightSwipeAction.Reply, hideMembershipInReadOnly: true, useRightBubbles: false, + showUnreadCounts: true, }; export const getSettings = () => { From 5c60536afeb29e49b1e60f1bfb17d8dad613d589 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 22:09:39 -0500 Subject: [PATCH 28/67] feat(emoji): cache image packs in localStorage to reduce sliding-sync dependency --- src/app/hooks/useImagePacks.ts | 93 ++++++++++++- .../plugins/custom-emoji/imagePackCache.ts | 125 ++++++++++++++++++ src/app/plugins/custom-emoji/index.ts | 1 + 3 files changed, 213 insertions(+), 6 deletions(-) create mode 100644 src/app/plugins/custom-emoji/imagePackCache.ts diff --git a/src/app/hooks/useImagePacks.ts b/src/app/hooks/useImagePacks.ts index 6f38e376a..391543284 100644 --- a/src/app/hooks/useImagePacks.ts +++ b/src/app/hooks/useImagePacks.ts @@ -1,5 +1,5 @@ import { Room } from '$types/matrix-sdk'; -import { useCallback, useMemo, useState } from 'react'; +import { useCallback, useEffect, useMemo, useState } from 'react'; import { AccountDataEvent } from '$types/matrix/accountData'; import { StateEvent } from '$types/matrix/room'; import { @@ -7,8 +7,15 @@ import { getRoomImagePack, getRoomImagePacks, getUserImagePack, + globalPacksScope, ImagePack, ImageUsage, + readCachedPack, + readCachedPacks, + roomPacksScope, + userPackScope, + writeCachedPack, + writeCachedPacks, } from '$plugins/custom-emoji'; import { useMatrixClient } from './useMatrixClient'; import { useAccountDataCallback } from './useAccountDataCallback'; @@ -48,7 +55,17 @@ const imagePackListEqual = (a: ImagePack[], b: ImagePack[]): boolean => { export const useUserImagePack = (): ImagePack | undefined => { const mx = useMatrixClient(); - const [userPack, setUserPack] = useState(() => getUserImagePack(mx)); + const [userPack, setUserPack] = useState(() => { + const live = getUserImagePack(mx); + if (live) return live; + const userId = mx.getUserId(); + return userId ? readCachedPack(userId, userPackScope()) : undefined; + }); + + useEffect(() => { + const userId = mx.getUserId(); + if (userId) writeCachedPack(userId, userPackScope(), userPack); + }, [mx, userPack]); useAccountDataCallback( mx, @@ -70,7 +87,17 @@ export const useUserImagePack = (): ImagePack | undefined => { export const useGlobalImagePacks = (): ImagePack[] => { const mx = useMatrixClient(); - const [globalPacks, setGlobalPacks] = useState(() => getGlobalImagePacks(mx)); + const [globalPacks, setGlobalPacks] = useState(() => { + const live = getGlobalImagePacks(mx); + if (live.length > 0) return live; + const userId = mx.getUserId(); + return userId ? readCachedPacks(userId, globalPacksScope()) : []; + }); + + useEffect(() => { + const userId = mx.getUserId(); + if (userId) writeCachedPacks(userId, globalPacksScope(), globalPacks); + }, [mx, globalPacks]); useAccountDataCallback( mx, @@ -115,7 +142,24 @@ export const useGlobalImagePacks = (): ImagePack[] => { export const useRoomImagePack = (room: Room, stateKey: string): ImagePack | undefined => { const mx = useMatrixClient(); - const [roomPack, setRoomPack] = useState(() => getRoomImagePack(room, stateKey)); + const [roomPack, setRoomPack] = useState(() => { + const live = getRoomImagePack(room, stateKey); + if (live) return live; + const userId = mx.getUserId(); + if (!userId) return undefined; + // Find a matching cached pack by roomId + stateKey + return readCachedPacks(userId, roomPacksScope(room.roomId)).find( + (p) => p.address?.stateKey === stateKey + ); + }); + + useEffect(() => { + const userId = mx.getUserId(); + if (!userId) return; + // Persist all packs for this room whenever this single-pack state changes + const scope = roomPacksScope(room.roomId); + writeCachedPack(userId, scope, roomPack); + }, [mx, room.roomId, roomPack]); useStateEventCallback( mx, @@ -141,7 +185,17 @@ export const useRoomImagePack = (room: Room, stateKey: string): ImagePack | unde export const useRoomImagePacks = (room: Room): ImagePack[] => { const mx = useMatrixClient(); - const [roomPacks, setRoomPacks] = useState(() => getRoomImagePacks(room)); + const [roomPacks, setRoomPacks] = useState(() => { + const live = getRoomImagePacks(room); + if (live.length > 0) return live; + const userId = mx.getUserId(); + return userId ? readCachedPacks(userId, roomPacksScope(room.roomId)) : []; + }); + + useEffect(() => { + const userId = mx.getUserId(); + if (userId) writeCachedPacks(userId, roomPacksScope(room.roomId), roomPacks); + }, [mx, room.roomId, roomPacks]); useStateEventCallback( mx, @@ -166,7 +220,34 @@ export const useRoomImagePacks = (room: Room): ImagePack[] => { export const useRoomsImagePacks = (rooms: Room[]) => { const mx = useMatrixClient(); - const [roomPacks, setRoomPacks] = useState(() => rooms.flatMap(getRoomImagePacks)); + const [roomPacks, setRoomPacks] = useState(() => { + const live = rooms.flatMap(getRoomImagePacks); + if (live.length > 0) return live; + const userId = mx.getUserId(); + if (!userId) return []; + // Seed from cache for each room that has no live packs + return rooms.flatMap((room) => { + const livePacks = getRoomImagePacks(room); + if (livePacks.length > 0) return livePacks; + return readCachedPacks(userId, roomPacksScope(room.roomId)); + }); + }); + + useEffect(() => { + const userId = mx.getUserId(); + if (!userId) return; + // Persist per-room — group packs by roomId and write each bucket + const byRoom = new Map(); + roomPacks.forEach((pack) => { + if (!pack.address) return; + const bucket = byRoom.get(pack.address.roomId) ?? []; + bucket.push(pack); + byRoom.set(pack.address.roomId, bucket); + }); + byRoom.forEach((packs, roomId) => { + writeCachedPacks(userId, roomPacksScope(roomId), packs); + }); + }, [mx, roomPacks]); useStateEventCallback( mx, diff --git a/src/app/plugins/custom-emoji/imagePackCache.ts b/src/app/plugins/custom-emoji/imagePackCache.ts new file mode 100644 index 000000000..f15f1fba0 --- /dev/null +++ b/src/app/plugins/custom-emoji/imagePackCache.ts @@ -0,0 +1,125 @@ +/** + * Persistent localStorage cache for image packs (emoji / stickers). + * + * Sliding Sync may not deliver `im.ponies.room_emotes` state events for rooms + * that aren't actively subscribed, so previously-seen packs would silently + * disappear on the next session. This cache persists the serialised pack + * content keyed by (userId, scope) so the UI can show stale-but-usable packs + * while the live state catches up. + * + * Scopes + * 'user' – the user's own im.ponies.user_emotes account-data pack + * 'global' – all globally-enabled room packs via im.ponies.emote_rooms + * 'room:' – packs local to a specific room + */ + +import { PackAddress } from './PackAddress'; +import { ImagePack } from './ImagePack'; +import { PackContent, PackImages } from './types'; + +// -------------------------------------------------------------------------- +// Types stored in localStorage +// -------------------------------------------------------------------------- + +type CachedAddress = { roomId: string; stateKey: string }; + +type CachedPackEntry = { + id: string; + content: PackContent; + address?: CachedAddress; +}; + +// -------------------------------------------------------------------------- +// Constants +// -------------------------------------------------------------------------- + +const STORAGE_KEY_PREFIX = 'sable:imgpk:v1'; + +// -------------------------------------------------------------------------- +// Helpers +// -------------------------------------------------------------------------- + +function storageKey(userId: string, scope: string): string { + return `${STORAGE_KEY_PREFIX}:${userId}:${scope}`; +} + +/** Reconstruct a plain `PackContent` from a live `ImagePack` instance. */ +function toPackContent(pack: ImagePack): PackContent { + const rawImages: PackImages = {}; + pack.images.collection.forEach((img, shortcode) => { + rawImages[shortcode] = img.content; + }); + return { + pack: pack.meta.content, + images: rawImages, + }; +} + +function deserializePacks(entries: CachedPackEntry[]): ImagePack[] { + return entries.map(({ id, content, address }) => { + const addr = address ? new PackAddress(address.roomId, address.stateKey) : undefined; + return new ImagePack(id, content, addr); + }); +} + +function serializePacks(packs: ImagePack[]): CachedPackEntry[] { + return packs + .filter((pack) => !pack.deleted) + .map((pack) => ({ + id: pack.id, + content: toPackContent(pack), + address: pack.address + ? { roomId: pack.address.roomId, stateKey: pack.address.stateKey } + : undefined, + })); +} + +// -------------------------------------------------------------------------- +// Public API +// -------------------------------------------------------------------------- + +/** Read cached packs for the given scope. Returns an empty array on any error. */ +export function readCachedPacks(userId: string, scope: string): ImagePack[] { + try { + const raw = localStorage.getItem(storageKey(userId, scope)); + if (!raw) return []; + const entries = JSON.parse(raw); + if (!Array.isArray(entries)) return []; + return deserializePacks(entries as CachedPackEntry[]); + } catch { + return []; + } +} + +/** Read a single cached pack for the given scope. Returns undefined on any error or miss. */ +export function readCachedPack(userId: string, scope: string): ImagePack | undefined { + return readCachedPacks(userId, scope)[0]; +} + +/** Persist packs for the given scope. Silently ignores storage errors. */ +export function writeCachedPacks(userId: string, scope: string, packs: ImagePack[]): void { + try { + const entries = serializePacks(packs); + if (entries.length === 0) { + localStorage.removeItem(storageKey(userId, scope)); + } else { + localStorage.setItem(storageKey(userId, scope), JSON.stringify(entries)); + } + } catch { + // private browsing / storage quota – silently ignore + } +} + +/** Persist a single pack, or remove the entry when undefined. */ +export function writeCachedPack(userId: string, scope: string, pack: ImagePack | undefined): void { + writeCachedPacks(userId, scope, pack ? [pack] : []); +} + +/** Scope string for the user's own pack. */ +export const userPackScope = () => 'user'; + +/** Scope string for the global pack list. */ +export const globalPacksScope = () => 'global'; + +/** Scope string for a specific room's packs. */ +export const roomPacksScope = (roomId: string) => `room:${roomId}`; diff --git a/src/app/plugins/custom-emoji/index.ts b/src/app/plugins/custom-emoji/index.ts index f833fa5bd..6a9c4e3b2 100644 --- a/src/app/plugins/custom-emoji/index.ts +++ b/src/app/plugins/custom-emoji/index.ts @@ -5,3 +5,4 @@ export * from './PackImagesReader'; export * from './ImagePack'; export * from './types'; export * from './utils'; +export * from './imagePackCache'; From 6dcaea6bd84e6f038de34869d82fa3e848e93c4f Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Wed, 4 Mar 2026 22:09:43 -0500 Subject: [PATCH 29/67] fix(sliding-sync): prevent edit leakage, add required_state, re-render on Replace events, guard empty getContent() --- src/app/features/room/RoomTimeline.tsx | 56 ++++++++++++++++++++++---- src/app/utils/room.ts | 15 +++++-- src/client/slidingSync.ts | 4 ++ 3 files changed, 65 insertions(+), 10 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 0ebbcaf6f..b8e5911de 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -23,6 +23,7 @@ import { IRoomTimelineData, MatrixClient, MatrixEvent, + RelationType, Room, RoomEvent, RoomEventHandlerMap, @@ -451,6 +452,30 @@ const useLiveEventArrive = (room: Room, onArrive: (mEvent: MatrixEvent) => void) }, [room, onArrive]); }; +const useRelationUpdate = (room: Room, onRelation: () => void) => { + useEffect(() => { + const handleTimelineEvent: EventTimelineSetHandlerMap[RoomEvent.Timeline] = ( + mEvent: MatrixEvent, + eventRoom: Room | undefined, + _toStartOfTimeline: boolean | undefined, + _removed: boolean, + data: IRoomTimelineData + ) => { + // Live Replace events are handled by useLiveEventArrive re-render. + // Non-live Replace events (bundled/historical edits from sliding sync) + // also need to trigger a re-render so makeReplaced state is reflected. + if (eventRoom?.roomId !== room.roomId || data.liveEvent) return; + if (mEvent.getRelation()?.rel_type === RelationType.Replace) { + onRelation(); + } + }; + room.on(RoomEvent.Timeline, handleTimelineEvent); + return () => { + room.removeListener(RoomEvent.Timeline, handleTimelineEvent); + }; + }, [room, onRelation]); +}; + const useLiveTimelineRefresh = (room: Room, onRefresh: () => void) => { useEffect(() => { const handleTimelineRefresh: RoomEventHandlerMap[RoomEvent.TimelineRefresh] = (r: Room) => { @@ -786,6 +811,15 @@ export function RoomTimeline({ }, [room, liveTimelineLinked, timeline.linkedTimelines.length]) ); + // Re-render when non-live Replace relations arrive (bundled/historical edits + // from sliding sync that wouldn't otherwise trigger a timeline update). + useRelationUpdate( + room, + useCallback(() => { + setTimeline((ct) => ({ ...ct })); + }, []) + ); + // Recover from transient empty timeline state when the live timeline // already has events (can happen when opening by event id, then fallbacking). useEffect(() => { @@ -1226,8 +1260,14 @@ export function RoomTimeline({ const highlighted = focusItem?.index === item && focusItem.highlight; const editedEvent = getEditedEvent(mEventId, mEvent, timelineSet); - const getContent = (() => - editedEvent?.getContent()['m.new_content'] ?? mEvent.getContent()) as GetContentCallback; + const editedNewContent = editedEvent?.getContent()['m.new_content']; + // If makeReplaced was called with a stripped edit (no m.new_content), + // mEvent.getContent() returns {}. Fall back to getOriginalContent() so + // the message renders with its original content instead of breaking. + const baseContent = mEvent.getContent(); + const safeContent = + Object.keys(baseContent).length > 0 ? baseContent : mEvent.getOriginalContent(); + const getContent = (() => editedNewContent ?? safeContent) as GetContentCallback; const senderId = mEvent.getSender() ?? ''; const senderDisplayName = @@ -1295,7 +1335,7 @@ export function RoomTimeline({ ) : ( - editedEvent?.getContent()['m.new_content'] ?? - mEvent.getContent()) as GetContentCallback; + const editedNewContent = editedEvent?.getContent()['m.new_content']; + const baseContent = mEvent.getContent(); + const safeContent = + Object.keys(baseContent).length > 0 ? baseContent : mEvent.getOriginalContent(); + const getContent = (() => editedNewContent ?? safeContent) as GetContentCallback; return ( - mEvent.getRelation()?.rel_type === RelationType.Annotation || - mEvent.getRelation()?.rel_type === RelationType.Replace; +export const reactionOrEditEvent = (mEvent: MatrixEvent): boolean => { + const relType = mEvent.getRelation()?.rel_type; + if (relType === RelationType.Annotation || relType === RelationType.Replace) return true; + + // Sliding sync proxies may omit m.relates_to on the initial delivery of timeline + // events. Detect edit events by the presence of m.new_content in the event + // content even when the relation metadata is absent, so they are filtered from + // the rendered timeline rather than falling through as unsupported messages. + if (mEvent.getContent()['m.new_content'] !== undefined) return true; + + return false; +}; export const getMentionContent = (userIds: string[], room: boolean): IMentions => { const mMentions: IMentions = {}; diff --git a/src/client/slidingSync.ts b/src/client/slidingSync.ts index c94888439..0c8cf98e3 100644 --- a/src/client/slidingSync.ts +++ b/src/client/slidingSync.ts @@ -136,11 +136,15 @@ const buildDefaultSubscription = (timelineLimit: number): MSC3575RoomSubscriptio [EventType.RoomTombstone, ''], [EventType.RoomJoinRules, ''], [EventType.RoomHistoryVisibility, ''], + [EventType.RoomPowerLevels, ''], [StateEvent.PoniesRoomEmotes, '*'], [StateEvent.RoomWidget, '*'], [StateEvent.GroupCallPrefix, '*'], [EventType.SpaceChild, '*'], [EventType.SpaceParent, '*'], + [StateEvent.RoomCosmeticsColor, '*'], + [StateEvent.RoomCosmeticsFont, '*'], + [StateEvent.RoomCosmeticsPronouns, '*'], ], }); From ede8bd2d659f252de2ec692297ea54a45b577e83 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 21:34:45 -0600 Subject: [PATCH 30/67] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ea225f9..d4f380fcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix view source scroll bar ([#125](https://github.com/7w1/sable/pull/125)) - Added back Cinny Light theme as an option ([#80](https://github.com/7w1/sable/issues/80), [#126](https://github.com/7w1/sable/pull/126)) - Fix auto capitalization in login screen ([#131](https://github.com/7w1/sable/pull/131)) - [Rose](https://github.com/dozro) +- Automated deployments with Cloudflare Workers IaC ([#116](https://github.com/7w1/sable/pull/116)) ## 1.3.2 - 3/3/2026 From 0f86f8e9c00adeb2bb98ec2c9a98cf14853c9b98 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 22:01:59 -0600 Subject: [PATCH 31/67] Change trigger from dev branch to version tags --- .github/workflows/cloudflare-web-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cloudflare-web-deploy.yml b/.github/workflows/cloudflare-web-deploy.yml index bfd9ef931..552574c46 100644 --- a/.github/workflows/cloudflare-web-deploy.yml +++ b/.github/workflows/cloudflare-web-deploy.yml @@ -8,8 +8,8 @@ on: - '.github/actions/prepare-tofu/**' - '.github/actions/setup/**' push: - branches: - - dev + tags: + - 'v*' workflow_dispatch: env: @@ -57,7 +57,7 @@ jobs: label: production apply: - if: (github.event_name == 'push' && github.ref_name == 'dev') || github.event_name == 'workflow_dispatch' + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: read From 9b53c86f9445b679f75c94d33919322425621b57 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 22:03:03 -0600 Subject: [PATCH 32/67] Update Docker publish workflow tag pattern --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7183dccd9..d2c92fc93 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -4,7 +4,7 @@ on: push: branches: [dev] tags: - - '*.*.*' + - 'v*' env: REGISTRY: ghcr.io From 42c012be65aeccc178b8e5d281093d57ff1007d7 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 22:15:59 -0600 Subject: [PATCH 33/67] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4f380fcd..91644786f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Sable Client Changelog -## 1.3.3 +## 1.3.3 - 3/4/2026 - Fix unread counts and dot badges for muted rooms ([#118](https://github.com/7w1/sable/pull/118)) - [Evie Gauthier](https://github.com/Just-Insane) - /raw, /rawmsg, /rawacc, /delacc, /setext, /delext for modifying arbitrary data in various places. Do not use them if you don't know what they mean. It can break things. Locked behind developer tools settings. ([#120](https://github.com/7w1/sable/pull/120)) @@ -12,7 +12,9 @@ - Fix view source scroll bar ([#125](https://github.com/7w1/sable/pull/125)) - Added back Cinny Light theme as an option ([#80](https://github.com/7w1/sable/issues/80), [#126](https://github.com/7w1/sable/pull/126)) - Fix auto capitalization in login screen ([#131](https://github.com/7w1/sable/pull/131)) - [Rose](https://github.com/dozro) -- Automated deployments with Cloudflare Workers IaC ([#116](https://github.com/7w1/sable/pull/116)) +- Automated deployments with Cloudflare Workers IaC ([#116](https://github.com/7w1/sable/pull/116)) - [haz](https://github.com/hazre) +- Notification delivery, account switching, and unread count toggle fixes ([#127](https://github.com/7w1/sable/pull/127)) - [Evie Gauthier](https://github.com/Just-Insane) +- More sliding sync fixes: cache emoji packs and fix edit message rendering ([#134](https://github.com/7w1/sable/pull/134)) - [Evie Gauthier](https://github.com/Just-Insane) ## 1.3.2 - 3/3/2026 From 40665ede84425f04125a38f4dd619af0e071986c Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 4 Mar 2026 22:31:20 -0600 Subject: [PATCH 34/67] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91644786f..be2cf9671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Add /discardsession command to force discard e2ee session in current room ([#119](https://github.com/7w1/sable/issues/119), [#123](https://github.com/7w1/sable/pull/123)) - Fix consistency of nicknames in dm rooms ([#122](https://github.com/7w1/sable/pull/122)) - [Rose](https://github.com/dozro) - Message sending improvements, color change instead of "Sending..." message. ([#128](https://github.com/7w1/sable/pull/128)) - [Evie Gauthier](https://github.com/Just-Insane) -- Fix view source scroll bar ([#125](https://github.com/7w1/sable/pull/125)) +- Fix view source scroll bar. ([#125](https://github.com/7w1/sable/pull/125)) - Added back Cinny Light theme as an option ([#80](https://github.com/7w1/sable/issues/80), [#126](https://github.com/7w1/sable/pull/126)) - Fix auto capitalization in login screen ([#131](https://github.com/7w1/sable/pull/131)) - [Rose](https://github.com/dozro) - Automated deployments with Cloudflare Workers IaC ([#116](https://github.com/7w1/sable/pull/116)) - [haz](https://github.com/hazre) From 5372e36153e177ad1ce5c6476f6d1710ebcf378c Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Thu, 5 Mar 2026 00:51:02 -0500 Subject: [PATCH 35/67] feat(notifications): in-app notification banner, account unread counts, and Discord-style floating pill --- .vscode/settings.json | 3 + .../NotificationBanner.css.ts | 154 +++++++++++++++ .../NotificationBanner.tsx | 181 ++++++++++++++++++ .../components/notification-banner/index.ts | 1 + .../pages/client/BackgroundNotifications.tsx | 113 ++++++++--- src/app/pages/client/ClientNonUIFeatures.tsx | 135 +++++++------ .../client/sidebar/AccountSwitcherTab.tsx | 46 +++-- src/app/state/sessions.ts | 35 +++- 8 files changed, 565 insertions(+), 103 deletions(-) create mode 100644 src/app/components/notification-banner/NotificationBanner.css.ts create mode 100644 src/app/components/notification-banner/NotificationBanner.tsx create mode 100644 src/app/components/notification-banner/index.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 29e56e92a..7984494d1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,8 @@ }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "chat.tools.terminal.autoApprove": { + "npx tsc": true } } diff --git a/src/app/components/notification-banner/NotificationBanner.css.ts b/src/app/components/notification-banner/NotificationBanner.css.ts new file mode 100644 index 000000000..80c3617fa --- /dev/null +++ b/src/app/components/notification-banner/NotificationBanner.css.ts @@ -0,0 +1,154 @@ +import { keyframes, style } from '@vanilla-extract/css'; +import { color, config, toRem } from 'folds'; + +const slideIn = keyframes({ + from: { + opacity: 0, + transform: 'translateY(-100%)', + }, + to: { + opacity: 1, + transform: 'translateY(0)', + }, +}); + +const slideOut = keyframes({ + from: { + opacity: 1, + transform: 'translateY(0)', + }, + to: { + opacity: 0, + transform: 'translateY(-100%)', + }, +}); + +// Floats at the top of the chat area, starting after the icon sidebar. +export const BannerContainer = style({ + position: 'fixed', + top: 0, + // 66px = sidebar icon strip width — overridden to 0 on mobile below + left: toRem(66), + right: 0, + zIndex: 9999, + display: 'flex', + flexDirection: 'column', + gap: config.space.S200, + padding: config.space.S400, + pointerEvents: 'none', + alignItems: 'stretch', + + '@media': { + // On narrow screens the sidebar collapses, so span the full width. + '(max-width: 768px)': { + left: 0, + }, + }, +}); + +export const Banner = style({ + position: 'relative', + overflow: 'hidden', + pointerEvents: 'all', + display: 'flex', + alignItems: 'center', + gap: config.space.S300, + backgroundColor: color.Surface.Container, + color: color.Surface.OnContainer, + border: `${config.borderWidth.B300} solid ${color.Surface.ContainerLine}`, + borderRadius: toRem(16), + padding: `${config.space.S300} ${config.space.S400}`, + boxShadow: `0 ${toRem(8)} ${toRem(32)} rgba(0, 0, 0, 0.45), 0 ${toRem(2)} ${toRem(8)} rgba(0, 0, 0, 0.3)`, + cursor: 'pointer', + width: '100%', + animationName: slideIn, + animationDuration: '260ms', + animationTimingFunction: 'cubic-bezier(0.22, 0.8, 0.6, 1)', + animationFillMode: 'both', + + selectors: { + '&:hover': { + backgroundColor: color.Surface.ContainerHover, + }, + '&[data-dismissing=true]': { + animationName: slideOut, + animationDuration: '200ms', + animationTimingFunction: 'cubic-bezier(0.4, 0, 1, 1)', + animationFillMode: 'both', + }, + }, +}); + +export const BannerIcon = style({ + width: toRem(44), + height: toRem(44), + objectFit: 'cover', + borderRadius: config.radii.R300, + flexShrink: 0, +}); + +export const BannerContent = style({ + flex: 1, + minWidth: 0, + display: 'flex', + flexDirection: 'column', + gap: toRem(2), +}); + +export const BannerTitle = style({ + fontWeight: 700, +}); + +export const BannerSubtitle = style({ + fontWeight: 400, + opacity: 0.7, +}); + +export const BannerRoomName = style({ + color: color.Primary.Main, + fontWeight: 600, +}); + +// Caps tall previews and fades the bottom edge when content overflows. +export const BannerBody = style({ + position: 'relative', + maxHeight: toRem(56), + overflow: 'hidden', + + selectors: { + '&[data-overflow=true]::after': { + content: '""', + position: 'absolute', + bottom: 0, + left: 0, + right: 0, + height: toRem(28), + background: `linear-gradient(to bottom, transparent, ${color.Surface.Container})`, + pointerEvents: 'none', + }, + '&[data-overflow=true][data-hovered=true]::after': { + background: `linear-gradient(to bottom, transparent, ${color.Surface.ContainerHover})`, + }, + }, +}); + +export const ProgressBar = style({ + position: 'absolute', + bottom: 0, + left: 0, + height: toRem(3), + borderBottomLeftRadius: toRem(16), + backgroundColor: color.Primary.Main, + animationName: keyframes({ + from: { width: '100%' }, + to: { width: '0%' }, + }), + animationTimingFunction: 'linear', + animationFillMode: 'both', + + selectors: { + '&[data-paused=true]': { + animationPlayState: 'paused', + }, + }, +}); diff --git a/src/app/components/notification-banner/NotificationBanner.tsx b/src/app/components/notification-banner/NotificationBanner.tsx new file mode 100644 index 000000000..6732a1fed --- /dev/null +++ b/src/app/components/notification-banner/NotificationBanner.tsx @@ -0,0 +1,181 @@ +import { useAtom } from 'jotai'; +import { useCallback, useEffect, useRef, useState } from 'react'; +import { Box, Icon, IconButton, Icons, Text } from 'folds'; +import { inAppBannerAtom, InAppBannerNotification } from '$state/sessions'; +import * as css from './NotificationBanner.css'; + +const BANNER_DURATION_MS = 5000; + +// Renders body text capped at a max height with a gradient fade when it overflows. +function BodyText({ text, hovered }: { text: string; hovered: boolean }) { + const ref = useRef(null); + const [overflow, setOverflow] = useState(false); + + useEffect(() => { + const el = ref.current; + if (!el) return; + setOverflow(el.scrollHeight > el.clientHeight); + }, [text]); + + return ( +
+ + {text} + +
+ ); +} + +type BannerItemProps = { + notification: InAppBannerNotification; + onDismiss: (id: string) => void; +}; + +function BannerItem({ notification, onDismiss }: BannerItemProps) { + const [dismissing, setDismissing] = useState(false); + const [paused, setPaused] = useState(false); + const dismissedRef = useRef(false); + const dismissAnimTimerRef = useRef | null>(null); + const elapsedRef = useRef(0); + + // Use a ref to guard against double-dismiss without creating a new callback identity. + const dismiss = useCallback(() => { + if (dismissedRef.current) return; + dismissedRef.current = true; + setDismissing(true); + dismissAnimTimerRef.current = setTimeout(() => onDismiss(notification.id), 200); + }, [notification.id, onDismiss]); + + // Auto-dismiss timer — only runs when not paused. + useEffect(() => { + if (paused) return undefined; + const remaining = BANNER_DURATION_MS - elapsedRef.current; + if (remaining <= 0) { + dismiss(); + return undefined; + } + const startedAt = Date.now(); + const t = setTimeout(dismiss, remaining); + return () => { + clearTimeout(t); + // Accumulate time spent un-paused so we can resume from the right point. + elapsedRef.current += Date.now() - startedAt; + }; + }, [paused, dismiss]); + + useEffect( + () => () => { + if (dismissAnimTimerRef.current) clearTimeout(dismissAnimTimerRef.current); + }, + [] + ); + + const handleClick = () => { + notification.onClick(); + dismiss(); + }; + + // When hovering, pause the auto-dismiss timer. + const handleMouseEnter = () => setPaused(true); + const handleMouseLeave = () => setPaused(false); + + return ( +
{ + if (e.key === 'Enter' || e.key === ' ') handleClick(); + if (e.key === 'Escape') dismiss(); + }} + onMouseEnter={handleMouseEnter} + onMouseLeave={handleMouseLeave} + > + {notification.icon && ( + { + (e.currentTarget as HTMLImageElement).style.display = 'none'; + }} + /> + )} +
+ + {notification.senderName ?? notification.title} + {(notification.roomName || notification.serverName) && ( + + {' (​'} + {notification.roomName && `#${notification.roomName}`} + {notification.roomName && notification.serverName && ', '} + {notification.serverName} + {')'} + + )} + + {notification.body && } +
+ + { + e.stopPropagation(); + dismiss(); + }} + aria-label="Dismiss notification" + > + + + +
+
+ ); +} + +/** + * Renders the in-app notification banner stack. + * Mount this once near the root of the client layout. + */ +export function NotificationBanner() { + // We store an array locally so multiple rapid notifications stack briefly. + const [banner, setBanner] = useAtom(inAppBannerAtom); + const [queue, setQueue] = useState([]); + + // Push new notifications into the local queue. + useEffect(() => { + if (!banner) return; + setQueue((prev) => { + // De-duplicate by id + if (prev.some((n) => n.id === banner.id)) return prev; + // Keep at most 3 visible at once — drop the oldest if over limit. + const next = [...prev, banner]; + return next.length > 3 ? next.slice(next.length - 3) : next; + }); + // Clear the atom so the same notification doesn't re-enqueue on re-render. + setBanner(null); + }, [banner, setBanner]); + + const handleDismiss = (id: string) => { + setQueue((prev) => prev.filter((n) => n.id !== id)); + }; + + if (queue.length === 0) return null; + + return ( +
+ {queue.map((n) => ( + + ))} +
+ ); +} diff --git a/src/app/components/notification-banner/index.ts b/src/app/components/notification-banner/index.ts new file mode 100644 index 000000000..75a031d63 --- /dev/null +++ b/src/app/components/notification-banner/index.ts @@ -0,0 +1 @@ +export { NotificationBanner } from './NotificationBanner'; diff --git a/src/app/pages/client/BackgroundNotifications.tsx b/src/app/pages/client/BackgroundNotifications.tsx index a4f90bc67..1b1f89ec5 100644 --- a/src/app/pages/client/BackgroundNotifications.tsx +++ b/src/app/pages/client/BackgroundNotifications.tsx @@ -9,8 +9,15 @@ import { SyncState, PushProcessor, } from '$types/matrix-sdk'; -import { useAtomValue, useSetAtom } from 'jotai'; -import { sessionsAtom, activeSessionIdAtom, Session, sessionsHighlightAtom } from '$state/sessions'; +import { useAtom, useAtomValue, useSetAtom } from 'jotai'; +import { + sessionsAtom, + activeSessionIdAtom, + Session, + pendingNotificationAtom, + backgroundUnreadCountsAtom, + inAppBannerAtom, +} from '$state/sessions'; import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; import { getMxIdLocalPart, mxcUrlToHttp } from '$utils/matrix'; @@ -77,7 +84,7 @@ const waitForSync = (mx: MatrixClient): Promise => export function BackgroundNotifications() { const clientConfig = useClientConfig(); const sessions = useAtomValue(sessionsAtom); - const activeSessionId = useAtomValue(activeSessionIdAtom); + const [activeSessionId, setActiveSessionId] = useAtom(activeSessionIdAtom); const [showNotifications] = useSetting(settingsAtom, 'useInAppNotifications'); const [usePushNotifications] = useSetting(settingsAtom, 'usePushNotifications'); const [notificationSound] = useSetting(settingsAtom, 'isNotificationSounds'); @@ -101,7 +108,14 @@ export function BackgroundNotifications() { showEncryptedMessageContentRef.current = showEncryptedMessageContent; const clientsRef = useRef>(new Map()); const notifiedEventsRef = useRef>(new Set()); - const setHighlights = useSetAtom(sessionsHighlightAtom); + const setPending = useSetAtom(pendingNotificationAtom); + const setBackgroundUnreads = useSetAtom(backgroundUnreadCountsAtom); + const setInAppBanner = useSetAtom(inAppBannerAtom); + // Stable setter refs so async handleTimeline closures never go stale. + const setBackgroundUnreadsRef = useRef(setBackgroundUnreads); + setBackgroundUnreadsRef.current = setBackgroundUnreads; + const setInAppBannerRef = useRef(setInAppBanner); + setInAppBannerRef.current = setInAppBanner; const inactiveSessions = sessions.filter( (s) => s.userId !== (activeSessionId ?? sessions[0]?.userId) @@ -122,6 +136,9 @@ export function BackgroundNotifications() { * Must include { type, room_id, event_id, user_id } so the SW notificationclick * handler can route the tap through HandleNotificationClick for account switching. */ data?: unknown; + /** Optional callback invoked when the user clicks the notification (window.Notification + * fallback path only; the SW path routes via its own notificationclick handler). */ + onClick?: () => void; } useEffect(() => { @@ -151,14 +168,19 @@ export function BackgroundNotifications() { } } if ('Notification' in window && window.Notification.permission === 'granted') { - // eslint-disable-next-line no-new - new window.Notification(opts.title, { + const noti = new window.Notification(opts.title, { icon: opts.icon, badge: opts.badge, body: opts.body, silent: opts.silent ?? false, data: opts.data, }); + if (opts.onClick) { + noti.onclick = () => { + opts.onClick?.(); + noti.close(); + }; + } } } @@ -167,8 +189,8 @@ export function BackgroundNotifications() { log.log('stopping background client for', userId); stopClient(mx); current.delete(userId); - // Clear the highlight badge when this session is no longer a background account. - setHighlights((prev) => { + // Clear the background unread badge when this session is no longer a background account. + setBackgroundUnreads((prev) => { const next = { ...prev }; delete next[userId]; return next; @@ -226,6 +248,23 @@ export function BackgroundNotifications() { : LogoSVG; const loudByRule = Boolean(pushActions.tweaks?.sound); + + // Track background unread count for every notifiable event (loud or silent). + const isHighlight = Boolean(pushActions.tweaks?.highlight); + setBackgroundUnreadsRef.current((prev) => { + const cur = prev[session.userId] ?? { total: 0, highlight: 0 }; + return { + ...prev, + [session.userId]: { + total: cur.total + 1, + highlight: isHighlight ? cur.highlight + 1 : cur.highlight, + }, + }; + }); + + // Silent-rule events: unread badge updated above; no OS notification or sound. + if (!loudByRule && !isHighlight) return; + const isEncryptedRoom = !!getStateEvent(room, StateEvent.RoomEncryption); notifiedEventsRef.current.add(dedupeId); @@ -235,14 +274,6 @@ export function BackgroundNotifications() { if (first) notifiedEventsRef.current.delete(first); } - // Track highlight count for the account switcher badge. - if (pushActions.tweaks?.highlight) { - setHighlights((prev) => ({ - ...prev, - [session.userId]: (prev[session.userId] ?? 0) + 1, - })); - } - // This component handles ONLY background (inactive) accounts. // SW push covers the active account when the app is backgrounded. // When the page is hidden, iOS suspends JS entirely — nothing to do here. @@ -275,14 +306,38 @@ export function BackgroundNotifications() { }, }); - sendNotification({ - title: notificationPayload.title, - icon: notificationPayload.options.icon, - badge: notificationPayload.options.badge, - body: notificationPayload.options.body, - silent: notificationPayload.options.silent ?? undefined, - data: notificationPayload.options.data, - }); + const notifOnClick = () => { + window.focus(); + // Always switch to the background account – jotai ignores no-op updates + setActiveSessionId(session.userId); + setPending({ roomId: room.roomId, eventId, targetSessionId: session.userId }); + }; + + if (document.visibilityState === 'visible') { + // App is in the foreground on a different account — show the themed in-app banner. + setInAppBannerRef.current({ + id: dedupeId, + title: notificationPayload.title, + roomName: room.name ?? room.getCanonicalAlias() ?? undefined, + senderName, + body: notificationPayload.options.body, + icon: notificationPayload.options.icon, + onClick: notifOnClick, + }); + } else if (loudByRule) { + // App is backgrounded — fire an OS notification only for loud (sound-tweak) rules. + // Highlight-only events are silently counted in the badge; OS noise is left to the + // user's own push rules for that account. + sendNotification({ + title: notificationPayload.title, + icon: notificationPayload.options.icon, + badge: notificationPayload.options.badge, + body: notificationPayload.options.body, + silent: notificationPayload.options.silent ?? undefined, + data: notificationPayload.options.data, + onClick: notifOnClick, + }); + } }; mx.on(RoomEvent.Timeline, handleTimeline as unknown as (...args: unknown[]) => void); @@ -296,7 +351,15 @@ export function BackgroundNotifications() { current.forEach((mx) => stopClient(mx)); current.clear(); }; - }, [clientConfig.slidingSync, inactiveSessions, shouldRunBackgroundNotifications, setHighlights]); + }, [ + clientConfig.slidingSync, + inactiveSessions, + shouldRunBackgroundNotifications, + setActiveSessionId, + setPending, + setBackgroundUnreads, + setInAppBanner, + ]); return null; } diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index d8e81e351..e067c2ce8 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -4,6 +4,7 @@ import { useNavigate } from 'react-router-dom'; import { EventType, PushProcessor, RoomEvent, RoomEventHandlerMap } from '$types/matrix-sdk'; import { roomToUnreadAtom } from '$state/room/roomToUnread'; import LogoSVG from '$public/res/svg/cinny.svg'; +import { NotificationBanner } from '$components/notification-banner'; import LogoUnreadSVG from '$public/res/svg/cinny-unread.svg'; import LogoHighlightSVG from '$public/res/svg/cinny-highlight.svg'; import NotificationSound from '$public/sound/notification.ogg'; @@ -27,7 +28,7 @@ import { useSelectedRoom } from '$hooks/router/useSelectedRoom'; import { useInboxNotificationsSelected } from '$hooks/router/useInbox'; import { useMediaAuthentication } from '$hooks/useMediaAuthentication'; import { registrationAtom } from '$state/serviceWorkerRegistration'; -import { activeSessionIdAtom, pendingNotificationAtom } from '$state/sessions'; +import { activeSessionIdAtom, pendingNotificationAtom, inAppBannerAtom } from '$state/sessions'; import { buildRoomMessageNotification, resolveNotificationPreviewText, @@ -187,7 +188,6 @@ function InviteNotifications() { function MessageNotifications() { const audioRef = useRef(null); - const notifRef = useRef(); const notifiedEventsRef = useRef>(new Set()); const mx = useMatrixClient(); const useAuthentication = useMediaAuthentication(); @@ -204,51 +204,10 @@ function MessageNotifications() { nicknamesRef.current = nicknames; const setPending = useSetAtom(pendingNotificationAtom); + const setInAppBanner = useSetAtom(inAppBannerAtom); const selectedRoomId = useSelectedRoom(); const notificationSelected = useInboxNotificationsSelected(); - const notify = useCallback( - ({ - roomName, - roomAvatar, - username, - roomId, - eventId, - previewText, - silent, - }: { - roomName: string; - roomAvatar?: string; - username: string; - roomId: string; - eventId: string; - previewText: string; - silent: boolean; - }) => { - const payload = buildRoomMessageNotification({ - roomName, - roomAvatar, - username, - previewText, - silent, - eventId, - }); - const noti = new window.Notification(payload.title, payload.options); - - noti.onclick = () => { - window.focus(); - setPending({ roomId, eventId, targetSessionId: mx.getUserId() ?? undefined }); - - noti.close(); - notifRef.current = undefined; - }; - - notifRef.current?.close(); - notifRef.current = noti; - }, - [mx, setPending] - ); - const playSound = useCallback(() => { const audioElement = audioRef.current; audioElement?.play(); @@ -279,32 +238,86 @@ function MessageNotifications() { const sender = mEvent.getSender(); const eventId = mEvent.getId(); if (!sender || !eventId || mEvent.getSender() === mx.getUserId()) return; + + // Deduplicate: don't show a second banner if this event fires twice + // (e.g., decrypted events re-emitted by the SDK). + if (notifiedEventsRef.current.has(eventId)) return; + const pushActions = pushProcessor.actionsForEvent(mEvent); if (!pushActions?.notify) return; const loudByRule = Boolean(pushActions.tweaks?.sound); + const isHighlightByRule = Boolean(pushActions.tweaks?.highlight); - // Deduplicate: never fire the same notification twice for the same event. - if (notifiedEventsRef.current.has(eventId)) return; + // If neither a loud nor a highlight rule matches, nothing to show. + if (!isHighlightByRule && !loudByRule) return; + + // Page hidden: SW (push) handles the OS notification. Nothing to do in-app. + if (document.visibilityState !== 'visible') return; + + // Record as notified to prevent duplicate banners (e.g. re-emitted decrypted events). notifiedEventsRef.current.add(eventId); if (notifiedEventsRef.current.size > 200) { const first = notifiedEventsRef.current.values().next().value; if (first) notifiedEventsRef.current.delete(first); } - // Page hidden: if push is enabled, SW handles the OS notification. If not, nothing to do. - if (document.visibilityState !== 'visible') return; + // Page is visible — show the themed in-app notification banner for any + // highlighted message (mention / keyword) or loud push rule. + if ((isHighlightByRule || loudByRule) && showNotifications) { + const isEncryptedRoom = !!getStateEvent(room, StateEvent.RoomEncryption); + const avatarMxc = + room.getAvatarFallbackMember()?.getMxcAvatarUrl() ?? room.getMxcAvatarUrl(); + const roomAvatar = avatarMxc + ? (mxcUrlToHttp(mx, avatarMxc, useAuthentication, 96, 96, 'crop') ?? undefined) + : undefined; + const resolvedSenderName = + getMemberDisplayName(room, sender, nicknamesRef.current) ?? + getMxIdLocalPart(sender) ?? + sender; + const previewText = resolveNotificationPreviewText({ + content: mEvent.getContent(), + eventType: mEvent.getType(), + isEncryptedRoom, + showMessageContent, + showEncryptedMessageContent, + }); + const payload = buildRoomMessageNotification({ + roomName: room.name ?? 'Unknown', + roomAvatar, + username: resolvedSenderName, + previewText, + silent: !notificationSound, + eventId, + }); + const { roomId } = room; + const capturedEventId = eventId; + const capturedUserId = mx.getUserId() ?? undefined; + const canonicalAlias = room.getCanonicalAlias(); + const serverName = + canonicalAlias?.split(':')[1] ?? room.roomId.split(':')[1] ?? undefined; + setInAppBanner({ + id: eventId, + title: payload.title, + roomName: room.name ?? undefined, + serverName, + senderName: resolvedSenderName, + body: previewText, + icon: roomAvatar, + onClick: () => { + window.focus(); + setPending({ roomId, eventId: capturedEventId, targetSessionId: capturedUserId }); + }, + }); + } - // Page is visible — show in-app experience. - // On mobile with push: iOS-style — play sound only, no OS notification (SW is silent when - // the app is visible on mobile, matching foreground behaviour of native chat apps). - // On desktop with push: SW skipped (saw a visible client), so we show the OS notification. - // Without push: always show OS notification when page is visible. + // On desktop without push: also fire an OS notification as a secondary fallback + // so the user is alerted even if the browser window is minimised. const isVisibleMobileWithPush = usePushNotifications && mobileOrTablet(); if (!isVisibleMobileWithPush && showNotifications && notificationPermission('granted')) { const isEncryptedRoom = !!getStateEvent(room, StateEvent.RoomEncryption); const avatarMxc = room.getAvatarFallbackMember()?.getMxcAvatarUrl() ?? room.getMxcAvatarUrl(); - notify({ + const osPayload = buildRoomMessageNotification({ roomName: room.name ?? 'Unknown', roomAvatar: avatarMxc ? (mxcUrlToHttp(mx, avatarMxc, useAuthentication, 96, 96, 'crop') ?? undefined) @@ -313,8 +326,6 @@ function MessageNotifications() { getMemberDisplayName(room, sender, nicknamesRef.current) ?? getMxIdLocalPart(sender) ?? sender, - roomId: room.roomId, - eventId, previewText: resolveNotificationPreviewText({ content: mEvent.getContent(), eventType: mEvent.getType(), @@ -324,7 +335,15 @@ function MessageNotifications() { }), // Play sound only if the push rule requests it and the user has sounds enabled. silent: !notificationSound || !loudByRule, + eventId, }); + const noti = new window.Notification(osPayload.title, osPayload.options); + const { roomId } = room; + noti.onclick = () => { + window.focus(); + setPending({ roomId, eventId, targetSessionId: mx.getUserId() ?? undefined }); + noti.close(); + }; } if (notificationSound && loudByRule) { @@ -344,7 +363,8 @@ function MessageNotifications() { showEncryptedMessageContent, usePushNotifications, playSound, - notify, + setInAppBanner, + setPending, selectedRoomId, useAuthentication, ]); @@ -470,6 +490,7 @@ export function ClientNonUIFeatures({ children }: ClientNonUIFeaturesProps) { + {children} ); diff --git a/src/app/pages/client/sidebar/AccountSwitcherTab.tsx b/src/app/pages/client/sidebar/AccountSwitcherTab.tsx index 50ff707a6..61058d95c 100644 --- a/src/app/pages/client/sidebar/AccountSwitcherTab.tsx +++ b/src/app/pages/client/sidebar/AccountSwitcherTab.tsx @@ -17,14 +17,18 @@ import { import FocusTrap from 'focus-trap-react'; import { useAtom, useAtomValue, useSetAtom } from 'jotai'; import { useNavigate } from 'react-router-dom'; -import { sessionsAtom, activeSessionIdAtom, Session, sessionsHighlightAtom } from '$state/sessions'; +import { + sessionsAtom, + activeSessionIdAtom, + Session, + backgroundUnreadCountsAtom, +} from '$state/sessions'; import { SidebarItem, SidebarItemTooltip, SidebarAvatar, SidebarItemBadge, } from '$components/sidebar'; -import { UnreadBadge } from '$components/unread-badge'; import { UserAvatar } from '$components/user-avatar'; import { nameInitials } from '$utils/common'; import { getMxIdLocalPart, mxcUrlToHttp } from '$utils/matrix'; @@ -39,6 +43,7 @@ import { Settings } from '$features/settings'; import { Modal500 } from '$components/Modal500'; import { createLogger } from '$utils/debug'; import { useClientConfig } from '$hooks/useClientConfig'; +import { UnreadBadge, UnreadBadgeCenter } from '$components/unread-badge'; const log = createLogger('AccountSwitcherTab'); @@ -48,7 +53,7 @@ function AccountRow({ displayName, avatarUrl, isBusy, - highlightCount, + unread, onSwitch, onSignOut, }: { @@ -57,7 +62,7 @@ function AccountRow({ displayName?: string; avatarUrl?: string; isBusy?: boolean; - highlightCount?: number; + unread?: { total: number; highlight: number }; onSwitch: (session: Session) => void; onSignOut: (session: Session) => void; }) { @@ -85,8 +90,10 @@ function AccountRow({ } after={ - {!isActive && highlightCount != null && highlightCount > 0 && ( - + {!isActive && unread && unread.total > 0 && ( + + 0} count={unread.total} /> + )} {isActive && ( @@ -137,8 +144,17 @@ export function AccountSwitcherTab() { const sessions = useAtomValue(sessionsAtom); const [activeSessionId, setActiveSessionId] = useAtom(activeSessionIdAtom); const setSessions = useSetAtom(sessionsAtom); - const [sessionHighlights, setSessionHighlights] = useAtom(sessionsHighlightAtom); const useAuthentication = useMediaAuthentication(); + const backgroundUnreads = useAtomValue(backgroundUnreadCountsAtom); + const setBackgroundUnreads = useSetAtom(backgroundUnreadCountsAtom); + + // Total unread count across all background sessions (for the sidebar badge). + const totalBackgroundUnread = Object.entries(backgroundUnreads) + .filter(([uid]) => uid !== (activeSessionId ?? sessions[0]?.userId)) + .reduce((acc, [, u]) => acc + u.total, 0); + const anyBackgroundHighlight = Object.entries(backgroundUnreads) + .filter(([uid]) => uid !== (activeSessionId ?? sessions[0]?.userId)) + .some(([, u]) => u.highlight > 0); const [menuAnchor, setMenuAnchor] = useState(); const [busyUserIds, setBusyUserIds] = useState>(new Set()); @@ -173,14 +189,14 @@ export function AccountSwitcherTab() { setMenuAnchor(undefined); navigate(getHomePath(), { replace: true }); setActiveSessionId(session.userId); - // Clear the highlight badge for the account we're switching to. - setSessionHighlights((prev) => { + // Clear the unread badge for the account we're now switching into. + setBackgroundUnreads((prev) => { const next = { ...prev }; delete next[session.userId]; return next; }); }, - [navigate, setActiveSessionId, setSessionHighlights] + [navigate, setActiveSessionId, setBackgroundUnreads] ); const handleSignOut = useCallback( @@ -237,10 +253,6 @@ export function AccountSwitcherTab() { getMxIdLocalPart(activeSession?.userId ?? '') ?? activeSession?.userId ?? ''; const label = activeDisplayName ?? activeLocalPart; - const inactiveHighlightTotal = sessions - .filter((s) => s.userId !== (activeSessionId ?? sessions[0]?.userId)) - .reduce((sum, s) => sum + (sessionHighlights[s.userId] ?? 0), 0); - if (!activeSession) return null; return ( @@ -262,9 +274,9 @@ export function AccountSwitcherTab() { )} - {inactiveHighlightTotal > 0 && ( + {totalBackgroundUnread > 0 && ( - + )} @@ -310,7 +322,7 @@ export function AccountSwitcherTab() { displayName={rowDisplayName} avatarUrl={rowAvatarUrl} isBusy={busyUserIds.has(session.userId)} - highlightCount={sessionHighlights[session.userId]} + unread={!isActive ? backgroundUnreads[session.userId] : undefined} onSwitch={handleSwitch} onSignOut={handleSignOut} /> diff --git a/src/app/state/sessions.ts b/src/app/state/sessions.ts index fc833c332..10a4ff3b0 100644 --- a/src/app/state/sessions.ts +++ b/src/app/state/sessions.ts @@ -171,9 +171,36 @@ export type PendingNotification = { export const pendingNotificationAtom = atom(null); +// ─── In-app notification banner ──────────────────────────────────────────── + +export type InAppBannerNotification = { + /** Unique id; used to deduplicate rapid-fire events. */ + id: string; + /** Primary title line – kept for backwards-compat (background accounts). */ + title: string; + /** Room display name (used as the #channel part of the subtitle). */ + roomName?: string; + /** Homeserver extracted from the canonical alias or room ID (e.g. matrix.org). */ + serverName?: string; + /** Display name of the sender. */ + senderName?: string; + body?: string; + /** URL of an avatar or room icon to display inside the banner. */ + icon?: string; + onClick: () => void; +}; + +export const inAppBannerAtom = atom(null); + +// ─── Per-background-account unread counts ────────────────────────────────── + +export type BackgroundUnread = { + total: number; + highlight: number; +}; + /** - * Tracks the count of highlight-level (mention/keyword) notifications received - * by each background (inactive) session. Keyed by userId. - * Cleared when a session becomes active or is signed out. + * Keyed by userId. Counts accumulate while a session is in the background + * and are cleared when the user switches to that account. */ -export const sessionsHighlightAtom = atom>({}); +export const backgroundUnreadCountsAtom = atom>({}); From 12cc25e49d1a2db81f7b4d444e7f14baab9a09ef Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Thu, 5 Mar 2026 00:53:16 -0500 Subject: [PATCH 36/67] revert settings changes --- .vscode/settings.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7984494d1..29e56e92a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,8 +7,5 @@ }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "chat.tools.terminal.autoApprove": { - "npx tsc": true } } From f6cf0d13b7a2655dc7e81df874fdf3f2b5899384 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Thu, 5 Mar 2026 00:57:08 -0500 Subject: [PATCH 37/67] fix: resolve lint and formatting issues for quality checks --- src/app/components/notification-banner/NotificationBanner.tsx | 3 +-- src/app/pages/client/ClientNonUIFeatures.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/components/notification-banner/NotificationBanner.tsx b/src/app/components/notification-banner/NotificationBanner.tsx index 6732a1fed..ad0ba026d 100644 --- a/src/app/components/notification-banner/NotificationBanner.tsx +++ b/src/app/components/notification-banner/NotificationBanner.tsx @@ -111,8 +111,7 @@ function BannerItem({ notification, onDismiss }: BannerItemProps) { {' (​'} {notification.roomName && `#${notification.roomName}`} {notification.roomName && notification.serverName && ', '} - {notification.serverName} - {')'} + {notification.serverName}) )} diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index e067c2ce8..f3bbfb26b 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -293,8 +293,7 @@ function MessageNotifications() { const capturedEventId = eventId; const capturedUserId = mx.getUserId() ?? undefined; const canonicalAlias = room.getCanonicalAlias(); - const serverName = - canonicalAlias?.split(':')[1] ?? room.roomId.split(':')[1] ?? undefined; + const serverName = canonicalAlias?.split(':')[1] ?? room.roomId.split(':')[1] ?? undefined; setInAppBanner({ id: eventId, title: payload.title, From c68ac282514ac4c4b84694a33f7f8e716bbdd4a1 Mon Sep 17 00:00:00 2001 From: hazre Date: Thu, 5 Mar 2026 09:11:34 +0100 Subject: [PATCH 38/67] chore: add knope configuration --- knope.toml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 knope.toml diff --git a/knope.toml b/knope.toml new file mode 100644 index 000000000..16cb05fd1 --- /dev/null +++ b/knope.toml @@ -0,0 +1,50 @@ + +[package.sable] +versioned_files = ["package.json", "package-lock.json"] +changelog = "CHANGELOG.md" +tag_prefix = "sable/" +# assets = "marker for GitHub bot" // TODO: add this later once we have assets + +[changes] +ignore_conventional_commits = true + +[package] +extra_changelog_sections = [ + { name = "Documentation", types = ["docs"] }, + { name = "Notes", types = ["note"] } +] + +[[workflows]] +name = "release" +help_text = "Prepare and create a new release (update changelog, bump version, create release)" + +[[workflows.steps]] +type = "PrepareRelease" + +[[workflows.steps]] +type = "Command" +command = 'git commit -m "chore: prepare release $version"' + +[[workflows.steps]] +type = "Command" +command = "git push" + +[[workflows.steps]] +type = "Release" + +[[workflows]] +name = "document-change" +help_text = "Create a new change file to be included in the next release" + +[[workflows.steps]] +type = "CreateChangeFile" + +[github] +owner = "7w1" +repo = "sable" + +[bot.releases] +enabled = true + +[bot.checks] +skip_labels = ["internal"] From aa50c07088451cb56db3148bc048d6b61533089f Mon Sep 17 00:00:00 2001 From: hazre Date: Thu, 5 Mar 2026 09:11:34 +0100 Subject: [PATCH 39/67] ci: update workflows to work with knope monorepo style tags --- .github/workflows/cloudflare-web-deploy.yml | 4 ++-- .github/workflows/docker-publish.yml | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cloudflare-web-deploy.yml b/.github/workflows/cloudflare-web-deploy.yml index 552574c46..819851b05 100644 --- a/.github/workflows/cloudflare-web-deploy.yml +++ b/.github/workflows/cloudflare-web-deploy.yml @@ -9,7 +9,7 @@ on: - '.github/actions/setup/**' push: tags: - - 'v*' + - 'sable/v*' workflow_dispatch: env: @@ -57,7 +57,7 @@ jobs: label: production apply: - if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event_name == 'workflow_dispatch' + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/sable/v')) || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d2c92fc93..c25e47d94 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -4,7 +4,7 @@ on: push: branches: [dev] tags: - - 'v*' + - 'sable/v*' env: REGISTRY: ghcr.io @@ -33,6 +33,18 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Resolve release tag value + id: release_tag + shell: bash + run: | + if [[ "${GITHUB_REF}" == refs/tags/sable/v* ]]; then + echo "value=${GITHUB_REF#refs/tags/sable/}" >> "$GITHUB_OUTPUT" + echo "is_release=true" >> "$GITHUB_OUTPUT" + else + echo "value=" >> "$GITHUB_OUTPUT" + echo "is_release=false" >> "$GITHUB_OUTPUT" + fi + - name: Extract metadata id: meta uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 @@ -46,9 +58,9 @@ jobs: type=raw,value=latest,enable=${{ github.ref == 'refs/heads/dev' }} # git tags: semver breakdown - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/0.') }} + type=semver,pattern={{version}},value=${{ steps.release_tag.outputs.value }},enable=${{ steps.release_tag.outputs.is_release == 'true' }} + type=semver,pattern={{major}}.{{minor}},value=${{ steps.release_tag.outputs.value }},enable=${{ steps.release_tag.outputs.is_release == 'true' }} + type=semver,pattern={{major}},value=${{ steps.release_tag.outputs.value }},enable=${{ steps.release_tag.outputs.is_release == 'true' && !startsWith(steps.release_tag.outputs.value, 'v0.') }} - name: Set up QEMU uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 From 9b895929ce5f943a9eea21f892ac82065a2031a1 Mon Sep 17 00:00:00 2001 From: hazre Date: Thu, 5 Mar 2026 09:11:34 +0100 Subject: [PATCH 40/67] chore: add knope postinstall installer --- knip.json | 1 + package-lock.json | 1 + package.json | 5 +- scripts/install-knope.js | 191 +++++++++++++++++++++++++++++++++ scripts/normalize-imports.js | 28 ++--- scripts/utils/console-style.js | 55 ++++++++++ 6 files changed, 258 insertions(+), 23 deletions(-) create mode 100644 scripts/install-knope.js create mode 100644 scripts/utils/console-style.js diff --git a/knip.json b/knip.json index 108c62ecd..8fec7f863 100644 --- a/knip.json +++ b/knip.json @@ -6,6 +6,7 @@ "type": true }, "ignoreDependencies": ["buffer", "@element-hq/element-call-embedded", "workbox-precaching"], + "ignoreBinaries": ["knope"], "rules": { "exports": "off", "types": "off", diff --git a/package-lock.json b/package-lock.json index 4b6a5bb00..811f037dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "sable", "version": "1.3.3", + "hasInstallScript": true, "license": "AGPL-3.0-only", "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "^1.7.7", diff --git a/package.json b/package.json index ba32c23f9..7be46b1a8 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,10 @@ "fmt": "prettier --write .", "fmt:check": "prettier --check .", "typecheck": "tsc", - "knip": "knip" + "knip": "knip", + "knope": "knope", + "document-change": "knope document-change", + "postinstall": "node scripts/install-knope.js" }, "keywords": [], "author": "7w1", diff --git a/scripts/install-knope.js b/scripts/install-knope.js new file mode 100644 index 000000000..5557c42c6 --- /dev/null +++ b/scripts/install-knope.js @@ -0,0 +1,191 @@ +#!/usr/bin/env node +import { spawnSync } from 'node:child_process'; +import process from 'node:process'; +import { chmodSync, existsSync, mkdirSync, realpathSync, writeFileSync } from 'node:fs'; +import { join, dirname, resolve, sep } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { Buffer } from 'node:buffer'; +import { gunzipSync } from 'node:zlib'; +import { PrefixedLogger, createTextHelpers } from './utils/console-style.js'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +const VERSION = '0.22.3'; +const TARGETS = { + 'linux-x64': 'x86_64-unknown-linux-musl', + 'linux-arm64': 'aarch64-unknown-linux-musl', + 'darwin-x64': 'x86_64-apple-darwin', + 'darwin-arm64': 'aarch64-apple-darwin', + 'win32-x64': 'x86_64-pc-windows-msvc', +}; + +function parseKnopeVersion(output) { + const version = output?.trim().replace(/^knope\s+/, ''); + return version || null; +} + +function getKnopeVersion(command) { + const result = spawnSync(command, ['--version'], { encoding: 'utf8' }); + if (result.status !== 0) { + return null; + } + return parseKnopeVersion(result.stdout); +} + +function readNullTerminatedString(buffer) { + const nulIndex = buffer.indexOf(0); + const end = nulIndex === -1 ? buffer.length : nulIndex; + return buffer.toString('utf8', 0, end); +} + +function getTarBasename(entryName) { + const segments = entryName.split('/').filter(Boolean); + return segments.at(-1) ?? ''; +} + +function extractRegularFileFromTar(tarBuffer, expectedBasename) { + let offset = 0; + const regularEntries = []; + + while (offset + 512 <= tarBuffer.length) { + const header = tarBuffer.subarray(offset, offset + 512); + if (header.every((byte) => byte === 0)) { + break; + } + + const name = readNullTerminatedString(header.subarray(0, 100)); + const prefix = readNullTerminatedString(header.subarray(345, 500)); + const fullName = prefix ? `${prefix}/${name}` : name; + const sizeOctal = readNullTerminatedString(header.subarray(124, 136)).trim(); + const size = sizeOctal ? Number.parseInt(sizeOctal, 8) : 0; + const typeflag = header[156]; + const isRegular = typeflag === 0 || typeflag === 48; + + if (!Number.isFinite(size) || size < 0) { + throw new Error(`Invalid tar entry size for ${fullName || ''}`); + } + + const dataStart = offset + 512; + const dataEnd = dataStart + size; + if (dataEnd > tarBuffer.length) { + throw new Error('Corrupt tarball: entry exceeds archive size'); + } + + if (isRegular && fullName) { + regularEntries.push(fullName); + if (getTarBasename(fullName) === expectedBasename) { + return Buffer.from(tarBuffer.subarray(dataStart, dataEnd)); + } + } + + const alignedSize = Math.ceil(size / 512) * 512; + offset = dataStart + alignedSize; + } + + throw new Error( + `Expected "${expectedBasename}" in tarball; found: ${regularEntries.join(', ') || 'none'}` + ); +} + +function getSystemKnopePath() { + const which = spawnSync(process.platform === 'win32' ? 'where' : 'which', ['knope'], { + encoding: 'utf8', + }); + if (which.status !== 0) { + return null; + } + return ( + which.stdout + .split(/\r?\n/) + .map((line) => line.trim()) + .find(Boolean) ?? null + ); +} + +function isPathWithin(candidatePath, rootPath) { + const toComparablePath = (value) => { + const resolved = resolve(value); + return process.platform === 'win32' ? resolved.toLowerCase() : resolved; + }; + const candidate = toComparablePath(candidatePath); + const root = toComparablePath(rootPath); + return candidate === root || candidate.startsWith(`${root}${sep}`); +} + +const logger = new PrefixedLogger('[postinstall:knope]'); +const { dim, red, green } = createTextHelpers({ useColor: logger.useColor }); + +const target = TARGETS[`${process.platform}-${process.arch}`]; +if (!target) { + const supported = Object.keys(TARGETS).join(', '); + logger.error( + `${dim('Unsupported platform: ')}${red(`${process.platform}-${process.arch}`)}${dim('. Supported targets: ')}${supported}` + ); + process.exit(1); +} + +const bin = join( + __dirname, + `../node_modules/.bin/knope${process.platform === 'win32' ? '.exe' : ''}` +); +const localBinDir = join(__dirname, '../node_modules/.bin'); +mkdirSync(dirname(bin), { recursive: true }); + +if (existsSync(bin)) { + const installed = getKnopeVersion(bin); + if (installed === VERSION) { + logger.info(`${dim('knope ')}${green(`v${VERSION}`)}${dim(' already installed')}`); + process.exit(0); + } + logger.info( + `${dim('Updating knope ')}${red(`v${installed ?? 'unknown'}`)}${dim(' -> ')}${green(`v${VERSION}`)}` + ); +} + +const systemKnopePath = getSystemKnopePath(); +if (systemKnopePath) { + const resolvedPath = (() => { + try { + return realpathSync(systemKnopePath); + } catch { + return systemKnopePath; + } + })(); + + if (!isPathWithin(resolvedPath, localBinDir)) { + const installed = getKnopeVersion(systemKnopePath); + if (installed === VERSION) { + logger.info( + `${dim('Using system knope ')}${green(`v${installed}`)}${dim(', skipping download')}` + ); + process.exit(0); + } + if (installed) { + logger.info( + `${dim('Found system knope ')}${red(`v${installed}`)}${dim('; installing pinned ')}${green(`v${VERSION}`)}${dim('. Consider updating your system knope.')}` + ); + } + } +} + +const url = `https://github.com/knope-dev/knope/releases/download/knope%2Fv${VERSION}/knope-${target}.tgz`; +logger.info( + `${dim('Downloading knope ')}${green(`v${VERSION}`)}${dim(' for ')}${target}${dim('...')}` +); +const response = await fetch(url); +if (!response.ok) { + throw new Error(`Failed to download knope: ${response.status} ${response.statusText}`); +} +const gzipBytes = Buffer.from(await response.arrayBuffer()); +const tarBytes = gunzipSync(gzipBytes); +const expectedBinaryName = process.platform === 'win32' ? 'knope.exe' : 'knope'; +const knopeBinary = extractRegularFileFromTar(tarBytes, expectedBinaryName); +writeFileSync(bin, knopeBinary); +chmodSync(bin, 0o755); +const installed = getKnopeVersion(bin); +if (installed !== VERSION) { + throw new Error( + `Installed knope version mismatch: expected ${VERSION}, got ${installed ?? 'unknown'}` + ); +} +logger.info(`${dim('Installed knope ')}${green(`v${installed}`)}`); diff --git a/scripts/normalize-imports.js b/scripts/normalize-imports.js index dd803af3c..74f9c4a91 100644 --- a/scripts/normalize-imports.js +++ b/scripts/normalize-imports.js @@ -5,6 +5,7 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import process from 'node:process'; import ts from 'typescript'; +import { createTextHelpers } from './utils/console-style.js'; const DEFAULT_ROOTS = ['src']; const SKIP_DIRS = new Set(['.git', '.hg', '.svn', 'node_modules', 'dist', 'coverage']); @@ -13,23 +14,6 @@ const MATRIX_IMPORT_BOUNDARY_FILES = new Set([ path.normalize('src/types/matrix-sdk.ts'), path.normalize('src/types/matrix-sdk-events.d.ts'), ]); -const ANSI = { - reset: '\x1b[0m', - red: '\x1b[31m', - green: '\x1b[32m', - dim: '\x1b[2m', -}; - -function shouldUseColor() { - if (process.env.NO_COLOR !== undefined) return false; - if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== '0') return true; - return Boolean(process.stdout.isTTY); -} - -function styleText(text, color, enabled) { - if (!enabled) return text; - return `${color}${text}${ANSI.reset}`; -} function toPosix(inputPath) { return inputPath.split(path.sep).join('/'); @@ -251,7 +235,7 @@ async function main() { const projectRoot = process.cwd(); const { write, roots } = parseArgs(process.argv.slice(2)); const aliases = await loadAliasMap(path.join(projectRoot, 'vite.config.ts'), projectRoot); - const useColor = shouldUseColor(); + const { dim, red, green } = createTextHelpers(); if (aliases.length === 0) { throw new Error('No aliases found in vite.config.ts'); @@ -311,10 +295,10 @@ async function main() { a.file === b.file ? a.from.localeCompare(b.from) : a.file.localeCompare(b.file) ); displayRows.forEach((row) => { - const fileLabel = styleText(row.file, ANSI.dim, useColor); - const fromLabel = styleText(`"${row.from}"`, ANSI.red, useColor); - const arrowLabel = styleText(' -> ', ANSI.dim, useColor); - const toLabel = styleText(`"${row.to}"`, ANSI.green, useColor); + const fileLabel = dim(row.file); + const fromLabel = red(`"${row.from}"`); + const arrowLabel = dim(' -> '); + const toLabel = green(`"${row.to}"`); console.log(`${fileLabel}: ${fromLabel}${arrowLabel}${toLabel}`); }); diff --git a/scripts/utils/console-style.js b/scripts/utils/console-style.js new file mode 100644 index 000000000..96ed5bf3e --- /dev/null +++ b/scripts/utils/console-style.js @@ -0,0 +1,55 @@ +/* eslint-disable no-console */ +import process from 'node:process'; + +export const ANSI = { + reset: '\x1b[0m', + red: '\x1b[31m', + green: '\x1b[32m', + dim: '\x1b[2m', +}; + +export function shouldUseColor() { + if (process.env.NO_COLOR !== undefined) return false; + if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== '0') return true; + return Boolean(process.stdout.isTTY); +} + +export function styleText(text, color, enabled) { + if (!enabled) return text; + return `${color}${text}${ANSI.reset}`; +} + +export function createTextHelpers(options = {}) { + const useColor = options.useColor ?? shouldUseColor(); + const style = (text, color) => styleText(text, color, useColor); + const dim = (text) => styleText(text, ANSI.dim, useColor); + const red = (text) => styleText(text, ANSI.red, useColor); + const green = (text) => styleText(text, ANSI.green, useColor); + return { + useColor, + style, + dim, + red, + green, + }; +} + +export class PrefixedLogger { + constructor(prefix, options = {}) { + this.prefix = prefix; + this.useColor = options.useColor ?? shouldUseColor(); + this.prefixColor = options.prefixColor ?? ANSI.dim; + } + + withPrefix(message) { + return `${styleText(this.prefix, this.prefixColor, this.useColor)} ${message}`; + } + + info(message) { + console.log(this.withPrefix(message)); + } + + error(message) { + console.error(this.withPrefix(message)); + } +} From d53d04954402259253d4250849d4da6f487ca242 Mon Sep 17 00:00:00 2001 From: hazre Date: Thu, 5 Mar 2026 09:11:34 +0100 Subject: [PATCH 41/67] docs: add knope documentation --- CONTRIBUTING.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62a493253..7e2ad4563 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,68 @@ Also, we use [ESLint](https://eslint.org/) for clean and stylistically consisten - `npm run typecheck` - `npm run knip` +## Release notes and versioning (Knope) + +We use [Knope](https://knope.tech/) with the Knope GitHub Bot to manage change documentation and releases. The workflow configuration lives in [`knope.toml`](./knope.toml). + +If you have used [Changesets](https://github.com/changesets/changesets) before, Knope should feel very similar. The main difference is scope: Changesets is typically used for JavaScript repositories because it relies on `package.json`, while Knope is multi-language. + +If you prefer, you can install the Knope CLI yourself using the [official installation guide](https://knope.tech/installation/). This repo also exposes the CLI through npm scripts, so you can run `npm run knope -- ` (for example: `npm run knope -- document-change`). Otherwise, this repo installs Knope for you via `postinstall`, so running `npm i` is enough. + +### Documenting a change + +A changeset is a Markdown file (usually in `.changeset/`) that captures intent to change: the semver bump (`major`, `minor`, `patch`) and the user-facing release note text. Knope later combines all pending changesets to decide version bumps and generate changelog entries. + +For user-facing pull requests, add one before requesting review. + +CLI paths: + +- `npm run document-change` +- `npm run knope -- document-change` +- `knope document-change` (if Knope is installed locally) + +All commands open an interactive prompt; fill in the package, change type, and short summary, then commit the generated change file in your PR. + +Alternatively, you can document the change manually by creating a change file: + +1. Create a file named `.changeset/fix-room-timeline-pagination.md` (or another descriptive file name). +2. Copy and paste this Markdown into the file: + +```md +--- +sable: patch +--- + +Short user-facing summary of the change. +``` + +3. Replace `patch` with one of: `major`, `minor`, `patch`, `docs`, or `note`. +4. Edit the summary so it describes user-facing impact (not maintainer-only details). + +In this repo, the `internal` label skips Knope's documentation check (`[bot.checks].skip_labels`). + +Further reading: + +- https://github.com/knope-dev/changesets?tab=readme-ov-file#what-is-a-changeset +- https://github.com/changesets/changesets/blob/main/docs/detailed-explanation.md + +### Release flow (GitHub Bot) + +Releases are driven by Knope Bot (`[bot.releases].enabled = true`): + +- The bot keeps an up-to-date release PR from `knope/release`. +- Merging that bot release PR publishes the GitHub release. + +### Local validation and dry-run (optional) + +Maintainers can preview behavior without changing files: + +- `npm run knope -- release --dry-run` + +You can also validate the local Knope config with: + +- `npm run knope -- --validate` + **For any query or design discussion, join our [Matrix room](https://matrix.to/#/#sable:sable.moe).** ## Helpful links From 7ed0eb3958b0cc18c0241fde4e98c6fdc2e0e207 Mon Sep 17 00:00:00 2001 From: Didi Date: Thu, 5 Mar 2026 22:21:26 +1030 Subject: [PATCH 42/67] Fix typo in CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62a493253..c95ceef36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ All types of contributions are encouraged and valued. Please make sure to read t > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: > > - Star the project -> - Talk abot it! +> - Talk about it! > - Refer this project in your project's readme > - Mention the project at local meetups and tell your friends/colleagues From 72955ffcbf9c72fb352a87f11d76fa9186ad8cc2 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 17:19:50 +0100 Subject: [PATCH 43/67] feat: language specific pronouns setting in experimental tab --- .../settings/experimental/Experimental.tsx | 5 +- .../general/LanguageSpecificPronouns.tsx | 120 ++++++++++++++++++ src/app/features/settings/general/index.ts | 1 + src/app/hooks/useClientConfig.ts | 5 + 4 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 src/app/features/settings/general/LanguageSpecificPronouns.tsx diff --git a/src/app/features/settings/experimental/Experimental.tsx b/src/app/features/settings/experimental/Experimental.tsx index 8148c92ed..f7962cc4d 100644 --- a/src/app/features/settings/experimental/Experimental.tsx +++ b/src/app/features/settings/experimental/Experimental.tsx @@ -1,7 +1,7 @@ import { Box, Text, IconButton, Icon, Icons, Scroll } from 'folds'; import { Page, PageContent, PageHeader } from '$components/page'; import { InfoCard } from '$components/info-card'; -import { Sync } from '../general'; +import { Sync, LanguageSpecificPronouns } from '../general'; type ExperimentalProps = { requestClose: () => void; @@ -42,6 +42,9 @@ export function Experimental({ requestClose }: ExperimentalProps) { + + + diff --git a/src/app/features/settings/general/LanguageSpecificPronouns.tsx b/src/app/features/settings/general/LanguageSpecificPronouns.tsx new file mode 100644 index 000000000..0458136c6 --- /dev/null +++ b/src/app/features/settings/general/LanguageSpecificPronouns.tsx @@ -0,0 +1,120 @@ +import { Box, Input, Switch, Text } from 'folds'; +import { SettingTile } from '$components/setting-tile'; +import { SequenceCard } from '$components/sequence-card'; +import { useClientConfig } from '$hooks/useClientConfig'; +import { useEffect, useState } from 'react'; +import { SequenceCardStyle } from '../styles.css'; + +// type definition for the language specific pronouns configuration, which can be stored in the client config +export type LanguageSpecificPronounsConfig = { + enabled?: boolean | string; + languages?: string[]; +}; + +export const resolveLanguageSpecificPronounsEnabled = ( + enabled: LanguageSpecificPronounsConfig['enabled'] +): boolean => { + if (enabled === undefined) return false; + if (typeof enabled === 'boolean') return enabled; + const normalized = String(enabled).trim().toLowerCase(); + if (normalized === 'false' || normalized === '0' || normalized === 'off' || normalized === 'no') + return false; + if (normalized === 'true' || normalized === '1' || normalized === 'on' || normalized === 'yes') + return true; + return false; +}; + +// utility function to split a comma separated list of languages and trim whitespace +function splitAndTrimLanguages(languages: string): string[] { + return languages + .split(',') + .map((lang) => lang.trim()) + .filter((lang) => lang.length > 0); +} + +export function LanguageSpecificPronouns() { + const clientConfig = useClientConfig(); + + const [useLanguageSpecificPronouns, setEnabled] = useState(false); + const [languageList, setLanguageList] = useState(''); + + // common handler for saving changes to the language specific pronouns settings + const handleSave = (enabled: boolean, languages: string) => { + clientConfig.languageSpecificPronouns = { + ...clientConfig.languageSpecificPronouns, + enabled, + }; + clientConfig.languageSpecificPronouns = { + ...clientConfig.languageSpecificPronouns, + languages: splitAndTrimLanguages(languages), + }; + }; + + // handler for when the language list input changes + const handleLanguageListChange = (e: React.ChangeEvent) => { + const val = e.target.value.trim(); + setLanguageList(val); + // save the new language list to the client config, keeping the enabled state unchanged + handleSave(clientConfig.languageSpecificPronouns?.enabled ?? false, val); + }; + + useEffect(() => { + setEnabled( + resolveLanguageSpecificPronounsEnabled(clientConfig.languageSpecificPronouns?.enabled) + ); + setLanguageList(clientConfig.languageSpecificPronouns?.languages?.join(',') || ''); + }, [ + clientConfig.languageSpecificPronouns?.enabled, + clientConfig.languageSpecificPronouns?.languages, + ]); + + // handler for toggling the enabled state of language specific pronouns + const handleSetEnabled = (enabled: boolean) => { + console.debug('Updating language specific pronouns enabled to', enabled); + handleSave(enabled, clientConfig.languageSpecificPronouns?.languages?.join(',') || ''); + setEnabled(enabled); + }; + + return ( + + Language Specific Pronouns + + + } + /> + {useLanguageSpecificPronouns && ( + + } + /> + )} + + + ); +} diff --git a/src/app/features/settings/general/index.ts b/src/app/features/settings/general/index.ts index 0ab02c523..abb53556e 100644 --- a/src/app/features/settings/general/index.ts +++ b/src/app/features/settings/general/index.ts @@ -1 +1,2 @@ export * from './General'; +export * from './LanguageSpecificPronouns'; \ No newline at end of file diff --git a/src/app/hooks/useClientConfig.ts b/src/app/hooks/useClientConfig.ts index deaf6dc18..04593ad65 100644 --- a/src/app/hooks/useClientConfig.ts +++ b/src/app/hooks/useClientConfig.ts @@ -13,6 +13,11 @@ export type ClientConfig = { disableAccountSwitcher?: boolean; + languageSpecificPronouns?: { + enabled?: boolean; + languages?: string[]; + }; + pushNotificationDetails?: { pushNotifyUrl?: string; vapidPublicKey?: string; From 0297c85e3143d704fd1c9fd4aa3667002bd440fd Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 18:13:08 +0100 Subject: [PATCH 44/67] refactor language specific pronouns handling with new settings structure --- .../general/LanguageSpecificPronouns.tsx | 32 +++++++------------ src/app/hooks/useClientConfig.ts | 5 --- src/app/state/settings.ts | 2 ++ 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/app/features/settings/general/LanguageSpecificPronouns.tsx b/src/app/features/settings/general/LanguageSpecificPronouns.tsx index 0458136c6..5132eecd7 100644 --- a/src/app/features/settings/general/LanguageSpecificPronouns.tsx +++ b/src/app/features/settings/general/LanguageSpecificPronouns.tsx @@ -1,11 +1,10 @@ import { Box, Input, Switch, Text } from 'folds'; import { SettingTile } from '$components/setting-tile'; import { SequenceCard } from '$components/sequence-card'; -import { useClientConfig } from '$hooks/useClientConfig'; import { useEffect, useState } from 'react'; +import { getSettings, setSettings, Settings } from '$state/settings'; import { SequenceCardStyle } from '../styles.css'; -// type definition for the language specific pronouns configuration, which can be stored in the client config export type LanguageSpecificPronounsConfig = { enabled?: boolean | string; languages?: string[]; @@ -33,21 +32,17 @@ function splitAndTrimLanguages(languages: string): string[] { } export function LanguageSpecificPronouns() { - const clientConfig = useClientConfig(); - const [useLanguageSpecificPronouns, setEnabled] = useState(false); const [languageList, setLanguageList] = useState(''); // common handler for saving changes to the language specific pronouns settings const handleSave = (enabled: boolean, languages: string) => { - clientConfig.languageSpecificPronouns = { - ...clientConfig.languageSpecificPronouns, - enabled, - }; - clientConfig.languageSpecificPronouns = { - ...clientConfig.languageSpecificPronouns, - languages: splitAndTrimLanguages(languages), - }; + const currentSettings = getSettings(); + setSettings({ + ...currentSettings, + languageSpecificPronounsEnabled: enabled, + languageSpecificPronounsLanguages: splitAndTrimLanguages(languages), + }); }; // handler for when the language list input changes @@ -55,23 +50,20 @@ export function LanguageSpecificPronouns() { const val = e.target.value.trim(); setLanguageList(val); // save the new language list to the client config, keeping the enabled state unchanged - handleSave(clientConfig.languageSpecificPronouns?.enabled ?? false, val); + handleSave(getSettings().languageSpecificPronounsEnabled ?? false, val); }; useEffect(() => { setEnabled( - resolveLanguageSpecificPronounsEnabled(clientConfig.languageSpecificPronouns?.enabled) + resolveLanguageSpecificPronounsEnabled(getSettings().languageSpecificPronounsEnabled ?? false) ); - setLanguageList(clientConfig.languageSpecificPronouns?.languages?.join(',') || ''); - }, [ - clientConfig.languageSpecificPronouns?.enabled, - clientConfig.languageSpecificPronouns?.languages, - ]); + setLanguageList(getSettings().languageSpecificPronounsLanguages?.join(',') || ''); + }, []); // handler for toggling the enabled state of language specific pronouns const handleSetEnabled = (enabled: boolean) => { console.debug('Updating language specific pronouns enabled to', enabled); - handleSave(enabled, clientConfig.languageSpecificPronouns?.languages?.join(',') || ''); + handleSave(enabled, getSettings().languageSpecificPronounsLanguages?.join(',') || ''); setEnabled(enabled); }; diff --git a/src/app/hooks/useClientConfig.ts b/src/app/hooks/useClientConfig.ts index 04593ad65..deaf6dc18 100644 --- a/src/app/hooks/useClientConfig.ts +++ b/src/app/hooks/useClientConfig.ts @@ -13,11 +13,6 @@ export type ClientConfig = { disableAccountSwitcher?: boolean; - languageSpecificPronouns?: { - enabled?: boolean; - languages?: string[]; - }; - pushNotificationDetails?: { pushNotifyUrl?: string; vapidPublicKey?: string; diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index a68f8dfc5..6e9d0cc99 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -61,6 +61,8 @@ export interface Settings { privacyBlurEmotes: boolean; showPronouns: boolean; renderGlobalNameColors: boolean; + languageSpecificPronounsEnabled?: boolean; + languageSpecificPronounsLanguages?: string[]; // Sable features! mobileGestures: boolean; From 5152627fa94d0d2086c4e8a0e6a5d4ab9c4ab9e7 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 18:14:04 +0100 Subject: [PATCH 45/67] removed unused import and console output --- src/app/features/settings/general/LanguageSpecificPronouns.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/features/settings/general/LanguageSpecificPronouns.tsx b/src/app/features/settings/general/LanguageSpecificPronouns.tsx index 5132eecd7..0b1c36175 100644 --- a/src/app/features/settings/general/LanguageSpecificPronouns.tsx +++ b/src/app/features/settings/general/LanguageSpecificPronouns.tsx @@ -2,7 +2,7 @@ import { Box, Input, Switch, Text } from 'folds'; import { SettingTile } from '$components/setting-tile'; import { SequenceCard } from '$components/sequence-card'; import { useEffect, useState } from 'react'; -import { getSettings, setSettings, Settings } from '$state/settings'; +import { getSettings, setSettings } from '$state/settings'; import { SequenceCardStyle } from '../styles.css'; export type LanguageSpecificPronounsConfig = { @@ -62,7 +62,6 @@ export function LanguageSpecificPronouns() { // handler for toggling the enabled state of language specific pronouns const handleSetEnabled = (enabled: boolean) => { - console.debug('Updating language specific pronouns enabled to', enabled); handleSave(enabled, getSettings().languageSpecificPronounsLanguages?.join(',') || ''); setEnabled(enabled); }; From e71ab94d15974de69586c85526d1276a2d511a29 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 11:18:14 -0600 Subject: [PATCH 46/67] Update MessageDelete.tsx --- src/app/components/message/modals/MessageDelete.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/components/message/modals/MessageDelete.tsx b/src/app/components/message/modals/MessageDelete.tsx index b91bad7f8..6637c97b6 100644 --- a/src/app/components/message/modals/MessageDelete.tsx +++ b/src/app/components/message/modals/MessageDelete.tsx @@ -1,4 +1,4 @@ -import { FormEventHandler, MouseEvent, useCallback } from 'react'; +import { FormEventHandler, MouseEvent, useCallback, useEffect } from 'react'; import { Room, MatrixEvent } from '$types/matrix-sdk'; import { useSetAtom } from 'jotai'; import { @@ -65,6 +65,12 @@ export function MessageDeleteInternal({ room, mEvent, onClose }: MessageDeleteIn ) ); + useEffect(() => { + if (deleteState.status === AsyncStatus.Success) { + onClose(); + } + }, [deleteState.status, onClose]); + const handleSubmit: FormEventHandler = (evt) => { evt.preventDefault(); const eventId = mEvent.getId(); From cf5540ff565c0c70fd6d78ad1988d68c89a8e43b Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 11:22:48 -0600 Subject: [PATCH 47/67] plz work --- ...ide_delete_modal_after_message_deletion.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .changeset/hide_delete_modal_after_message_deletion.md diff --git a/.changeset/hide_delete_modal_after_message_deletion.md b/.changeset/hide_delete_modal_after_message_deletion.md new file mode 100644 index 000000000..4c9a58276 --- /dev/null +++ b/.changeset/hide_delete_modal_after_message_deletion.md @@ -0,0 +1,32 @@ +--- +default: patch +--- + +# Hide delete modal after message deletion + +#151 by @7w1 + + + +### Description + + + +Hides the delete modal by properly calling onClose() after a successful deletion. + +Fixes #150 + +#### Type of change + +- [x] Bug fix (non-breaking change which fixes an issue) +- [ ] 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 +- [ ] 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 From 39b64387ffe7409dc553eefefa6f2d99f3f04ac4 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 11:25:54 -0600 Subject: [PATCH 48/67] i think this is how its supposed to be done... --- ...ide_delete_modal_after_message_deletion.md | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.changeset/hide_delete_modal_after_message_deletion.md b/.changeset/hide_delete_modal_after_message_deletion.md index 4c9a58276..3f59f4963 100644 --- a/.changeset/hide_delete_modal_after_message_deletion.md +++ b/.changeset/hide_delete_modal_after_message_deletion.md @@ -2,31 +2,4 @@ default: patch --- -# Hide delete modal after message deletion - -#151 by @7w1 - - - -### Description - - - -Hides the delete modal by properly calling onClose() after a successful deletion. - -Fixes #150 - -#### Type of change - -- [x] Bug fix (non-breaking change which fixes an issue) -- [ ] 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 -- [ ] 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 +Hide delete modal after successfully deleting a message. From 3d30bd23c2c2c6f8f253736860cd00ba059aece3 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 18:43:54 +0100 Subject: [PATCH 49/67] allow setting multi language pronouns --- src/app/features/settings/account/PronounEditor.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/features/settings/account/PronounEditor.tsx b/src/app/features/settings/account/PronounEditor.tsx index 9edfd1c9b..4c3ffd722 100644 --- a/src/app/features/settings/account/PronounEditor.tsx +++ b/src/app/features/settings/account/PronounEditor.tsx @@ -14,7 +14,9 @@ type PronounEditorProps = { }; export function PronounEditor({ current, onSave }: PronounEditorProps) { - const initialString = current.map((p) => p.summary).join(', '); + const initialString = current + .map((p) => `${p.language ? `${p.language}:` : ''}${p.summary}`) + .join(', '); const [val, setVal] = useState(initialString); useEffect(() => setVal(initialString), [initialString]); @@ -26,7 +28,10 @@ export function PronounEditor({ current, onSave }: PronounEditorProps) { .split(',') .map((s) => s.trim()) .filter(Boolean) - .map((s) => ({ summary: s.slice(0, 16), language: 'en' })); + .map((s) => { + const [language, summary] = s.split(':'); + return { summary: summary.slice(0, 16), language: language || 'en' }; + }); onSave(next); }; @@ -37,7 +42,9 @@ export function PronounEditor({ current, onSave }: PronounEditorProps) { return ( Date: Thu, 5 Mar 2026 18:47:17 +0100 Subject: [PATCH 50/67] Option for filtering pronouns based on language --- src/app/features/room/message/Message.tsx | 32 +++++++++++++++++-- .../general/LanguageSpecificPronouns.tsx | 5 +-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index cbf854009..acf5d8152 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -50,7 +50,7 @@ import { } from '$components/message'; import { canEditEvent, getMemberAvatarMxc } from '$utils/room'; import { mxcUrlToHttp } from '$utils/matrix'; -import { MessageLayout, MessageSpacing, settingsAtom } from '$state/settings'; +import { getSettings, MessageLayout, MessageSpacing, settingsAtom } from '$state/settings'; import { nicknamesAtom, setNicknameAtom } from '$state/nicknames'; import { useMatrixClient } from '$hooks/useMatrixClient'; import { useRecentEmoji } from '$hooks/useRecentEmoji'; @@ -78,6 +78,7 @@ import { MessageDeleteItem } from '$components/message/modals/MessageDelete'; import { MessageReportItem } from '$components/message/modals/MessageReport'; import { MessageEditor } from './MessageEditor'; import * as css from './styles.css'; +import { useClientConfig } from '$hooks/useClientConfig'; export type ReactionHandler = (keyOrMxc: string, shortcode: string) => void; @@ -260,17 +261,42 @@ const Pronouns = as< >(({ as: AsPronouns = 'span', pronouns, tagColor, ...props }, ref) => { if (!pronouns || pronouns.length === 0) return null; + const languageFilterEnabled = Boolean(getSettings().languageSpecificPronounsEnabled ?? false); + // if no language is given use english + const selectedLanguages = (getSettings().languageSpecificPronounsLanguages ?? ['en']) + .map((lang) => lang.trim().toLowerCase()) + .filter(Boolean); + + const visiblePronouns = languageFilterEnabled + ? pronouns.filter((p) => { + const lang = String(p?.language ?? 'en') + .trim() + .toLowerCase(); + return selectedLanguages.some( + (selected) => + lang === selected || + lang.startsWith(`${selected}-`) || // e.g. en-US matches en + selected.startsWith(`${lang}-`) // e.g. en matches en-US (if reversed) + ); + }) + : pronouns; + const clamp = (str: string, len: number) => (str.length > len ? `${str.slice(0, len)}...` : str); const limit = mobileOrTablet() ? 1 : 3; + // if language specific pronouns can't be found matching the filter return unfiltered + if (visiblePronouns.length === 0) { + visiblePronouns.push(...pronouns); + } + return ( - {pronouns.slice(0, limit).map((p) => ( + {visiblePronouns.slice(0, limit).map((p) => ( {clamp(p.summary, 16)} ))} - {pronouns.length > limit && ...} + {visiblePronouns.length > limit && ...} ); }); diff --git a/src/app/features/settings/general/LanguageSpecificPronouns.tsx b/src/app/features/settings/general/LanguageSpecificPronouns.tsx index 0b1c36175..22fbba4d3 100644 --- a/src/app/features/settings/general/LanguageSpecificPronouns.tsx +++ b/src/app/features/settings/general/LanguageSpecificPronouns.tsx @@ -31,6 +31,7 @@ function splitAndTrimLanguages(languages: string): string[] { .filter((lang) => lang.length > 0); } +// MSC4247 allows users to set pronouns in different languages export function LanguageSpecificPronouns() { const [useLanguageSpecificPronouns, setEnabled] = useState(false); const [languageList, setLanguageList] = useState(''); @@ -77,7 +78,7 @@ export function LanguageSpecificPronouns() { > Date: Thu, 5 Mar 2026 19:11:09 +0100 Subject: [PATCH 51/67] feat: add parsePronounsInput utility function and refactor pronoun handling in commands --- src/app/features/room/message/Message.tsx | 1 - .../settings/account/PronounEditor.tsx | 10 ++----- src/app/hooks/useCommands.ts | 29 ++++++++++--------- src/app/utils/pronouns.ts | 11 +++++++ 4 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 src/app/utils/pronouns.ts diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index acf5d8152..97af5642f 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -78,7 +78,6 @@ import { MessageDeleteItem } from '$components/message/modals/MessageDelete'; import { MessageReportItem } from '$components/message/modals/MessageReport'; import { MessageEditor } from './MessageEditor'; import * as css from './styles.css'; -import { useClientConfig } from '$hooks/useClientConfig'; export type ReactionHandler = (keyOrMxc: string, shortcode: string) => void; diff --git a/src/app/features/settings/account/PronounEditor.tsx b/src/app/features/settings/account/PronounEditor.tsx index 4c3ffd722..29ee9467e 100644 --- a/src/app/features/settings/account/PronounEditor.tsx +++ b/src/app/features/settings/account/PronounEditor.tsx @@ -1,6 +1,7 @@ import { useState, useEffect, ChangeEvent } from 'react'; import { Input } from 'folds'; import { SettingTile } from '$components/setting-tile'; +import { parsePronounsInput } from '$utils/pronouns'; type PronounSet = { summary: string; @@ -24,14 +25,7 @@ export function PronounEditor({ current, onSave }: PronounEditorProps) { const handleSave = () => { if (val === initialString) return; const safeVal = val.slice(0, 128); - const next = safeVal - .split(',') - .map((s) => s.trim()) - .filter(Boolean) - .map((s) => { - const [language, summary] = s.split(':'); - return { summary: summary.slice(0, 16), language: language || 'en' }; - }); + const next = parsePronounsInput(safeVal); onSave(next); }; diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index 4322c62b5..903acdc97 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -30,6 +30,7 @@ import { splitWithSpace } from '$utils/common'; import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; import { createRoomEncryptionState } from '$components/create-room'; +import { parsePronounsInput } from '$utils/pronouns'; import { useRoomNavigate } from './useRoomNavigate'; import { enrichWidgetUrl } from './useRoomWidgets'; @@ -888,7 +889,7 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { [Command.Pronoun]: { name: Command.Pronoun, description: - 'Set your pronouns for this room. Example: /pronoun "they/them, it/its" | /pronoun reset', + 'Set your pronouns for this room. Example: /pronoun "en:they/them, de:sie/ihr" | /pronoun reset', exe: async (payload) => { const match = payload.trim().match(/^"(.*)"$/); const rawInput = match ? match[1].trim() : payload.trim(); @@ -917,11 +918,7 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { return; } - const pronounsArray = rawInput - .split(',') - .map((p) => p.trim()) - .filter((p) => p.length > 0) - .map((p) => ({ summary: p })); + const pronounsArray = parsePronounsInput(rawInput); await mx.sendStateEvent( room.roomId, @@ -929,7 +926,12 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { { pronouns: pronounsArray }, userId ); - sendFeedback(`Room pronouns set: ${rawInput}`); + + const feedbackString = pronounsArray + .map((p) => (p.language ? `for ${p.language} "${p.summary}" was set` : p.summary)) + .join(', '); + + sendFeedback(`Room pronouns set: ${feedbackString}`); } catch (e: any) { if (e.errcode === 'M_FORBIDDEN') { sendFeedback('Permission Denied. Could not update room pronouns.'); @@ -977,11 +979,7 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { return; } - const pronounsArray = rawInput - .split(',') - .map((p) => p.trim()) - .filter((p) => p.length > 0) - .map((p) => ({ summary: p })); + const pronounsArray = parsePronounsInput(rawInput); await mx.sendStateEvent( targetSpaceId as any, @@ -989,7 +987,12 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { { pronouns: pronounsArray }, userId ); - sendFeedback(`Global space pronouns set: ${rawInput}`); + + const feedbackString = pronounsArray + .map((p) => (p.language ? `for ${p.language} "${p.summary}" was set` : p.summary)) + .join(', '); + + sendFeedback(`Global space pronouns set: ${feedbackString}`); } catch (e: any) { if (e.errcode === 'M_FORBIDDEN') { sendFeedback('Permission Denied. Could not update space pronouns.'); diff --git a/src/app/utils/pronouns.ts b/src/app/utils/pronouns.ts new file mode 100644 index 000000000..b95ff485d --- /dev/null +++ b/src/app/utils/pronouns.ts @@ -0,0 +1,11 @@ +// helper function to convert a comma-separated pronouns string into an array of objects with summary and optional language +export function parsePronounsInput(pronouns: string): { summary: string; language?: string }[] { + return pronouns + .split(',') + .map((s) => s.trim()) + .filter(Boolean) + .map((s) => { + const [language, summary] = s.split(':'); + return { summary: summary.slice(0, 16), language: language || 'en' }; + }); +} From 368124c294d38442e692b4ea9d0a7fff9067f576 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Thu, 5 Mar 2026 13:18:09 -0500 Subject: [PATCH 52/67] Document change --- .changeset/notification_pull_unread_background_badge.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/notification_pull_unread_background_badge.md diff --git a/.changeset/notification_pull_unread_background_badge.md b/.changeset/notification_pull_unread_background_badge.md new file mode 100644 index 000000000..0559d03a9 --- /dev/null +++ b/.changeset/notification_pull_unread_background_badge.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Adds a new message pill and background app highlighted unread count. From 504b73753b4af22e8eced31bbdaae0b9127d8d86 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 19:19:53 +0100 Subject: [PATCH 53/67] refactored LanguageSpecificPronouns --- .../{general => cosmetics}/LanguageSpecificPronouns.tsx | 0 src/app/features/settings/experimental/Experimental.tsx | 3 ++- src/app/features/settings/general/index.ts | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) rename src/app/features/settings/{general => cosmetics}/LanguageSpecificPronouns.tsx (100%) diff --git a/src/app/features/settings/general/LanguageSpecificPronouns.tsx b/src/app/features/settings/cosmetics/LanguageSpecificPronouns.tsx similarity index 100% rename from src/app/features/settings/general/LanguageSpecificPronouns.tsx rename to src/app/features/settings/cosmetics/LanguageSpecificPronouns.tsx diff --git a/src/app/features/settings/experimental/Experimental.tsx b/src/app/features/settings/experimental/Experimental.tsx index f7962cc4d..b97193577 100644 --- a/src/app/features/settings/experimental/Experimental.tsx +++ b/src/app/features/settings/experimental/Experimental.tsx @@ -1,7 +1,8 @@ import { Box, Text, IconButton, Icon, Icons, Scroll } from 'folds'; import { Page, PageContent, PageHeader } from '$components/page'; import { InfoCard } from '$components/info-card'; -import { Sync, LanguageSpecificPronouns } from '../general'; +import { LanguageSpecificPronouns } from '../cosmetics/LanguageSpecificPronouns'; +import { Sync } from '../general'; type ExperimentalProps = { requestClose: () => void; diff --git a/src/app/features/settings/general/index.ts b/src/app/features/settings/general/index.ts index abb53556e..0ab02c523 100644 --- a/src/app/features/settings/general/index.ts +++ b/src/app/features/settings/general/index.ts @@ -1,2 +1 @@ export * from './General'; -export * from './LanguageSpecificPronouns'; \ No newline at end of file From d93b409837ccb2b92240b1d3d21c4278eb8fefd9 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 12:40:19 -0600 Subject: [PATCH 54/67] Modify npm ci command to ignore scripts --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d2c1f603..863b2ba7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG VITE_BUILD_HASH ENV VITE_BUILD_HASH=$VITE_BUILD_HASH COPY .npmrc package.json package-lock.json /src/ -RUN npm ci +RUN npm ci --ignore-scripts COPY . /src/ ENV NODE_OPTIONS=--max_old_space_size=4096 RUN npm run build From 46a61fe4eb8b51d1e1fd6e04921a56e48e1af752 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 12:48:53 -0600 Subject: [PATCH 55/67] fix my changeset --- .changeset/hide_delete_modal_after_message_deletion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/hide_delete_modal_after_message_deletion.md b/.changeset/hide_delete_modal_after_message_deletion.md index 3f59f4963..d62f7a38d 100644 --- a/.changeset/hide_delete_modal_after_message_deletion.md +++ b/.changeset/hide_delete_modal_after_message_deletion.md @@ -1,5 +1,5 @@ --- -default: patch +sable: patch --- Hide delete modal after successfully deleting a message. From 2401e34873575303613b9508b3a41a72ab03ae13 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 19:54:43 +0100 Subject: [PATCH 56/67] language-based filtering for pronouns in a users room profile and message view --- .../user-profile/UserRoomProfile.tsx | 13 ++++++++++- src/app/features/room/message/Message.tsx | 23 +++++++------------ .../cosmetics/LanguageSpecificPronouns.tsx | 12 +++++----- src/app/state/settings.ts | 4 ++-- src/app/utils/pronouns.ts | 17 ++++++++++++++ 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index 688126986..c43d03c74 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -36,6 +36,8 @@ import { UserInviteAlert, UserBanAlert, UserModeration, UserKickAlert } from './ import { PowerChip } from './PowerChip'; import { IgnoredUserAlert, MutualRoomsChip, OptionsChip, ServerChip, ShareChip } from './UserChips'; import { UserHero, UserHeroName } from './UserHero'; +import { getSettings } from '$state/settings'; +import { filterPronounsByLanguage } from '$utils/pronouns'; const KNOWN_KEYS = [ 'moe.sable.app.bio', @@ -74,7 +76,16 @@ function UserExtendedSection({ return String(val); }; - const pronouns = profile.pronouns?.map((p: any) => clamp(p.summary, 16)).join(', '); + const languageFilterEnabled = getSettings().filterPronounsBasedOnLanguage ?? false; + const languagesToFilterFor = getSettings().filterPronounsLanguages ?? ['en']; + + const pronouns = filterPronounsByLanguage( + profile.pronouns!, + languageFilterEnabled, + languagesToFilterFor + ) + .map((p) => p.summary) + .join(', '); const localTime = useMemo(() => { if (!profile.timezone) return null; diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index 97af5642f..b5ab95601 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -76,6 +76,7 @@ import { MessageReadReceiptItem } from '$components/message/modals/MessageReadRe import { MessageSourceCodeItem } from '$components/message/modals/MessageSource'; import { MessageDeleteItem } from '$components/message/modals/MessageDelete'; import { MessageReportItem } from '$components/message/modals/MessageReport'; +import { filterPronounsByLanguage } from '$utils/pronouns'; import { MessageEditor } from './MessageEditor'; import * as css from './styles.css'; @@ -260,25 +261,17 @@ const Pronouns = as< >(({ as: AsPronouns = 'span', pronouns, tagColor, ...props }, ref) => { if (!pronouns || pronouns.length === 0) return null; - const languageFilterEnabled = Boolean(getSettings().languageSpecificPronounsEnabled ?? false); + const languageFilterEnabled = Boolean(getSettings().filterPronounsBasedOnLanguage ?? false); // if no language is given use english - const selectedLanguages = (getSettings().languageSpecificPronounsLanguages ?? ['en']) + const selectedLanguages = (getSettings().filterPronounsLanguages ?? ['en']) .map((lang) => lang.trim().toLowerCase()) .filter(Boolean); - const visiblePronouns = languageFilterEnabled - ? pronouns.filter((p) => { - const lang = String(p?.language ?? 'en') - .trim() - .toLowerCase(); - return selectedLanguages.some( - (selected) => - lang === selected || - lang.startsWith(`${selected}-`) || // e.g. en-US matches en - selected.startsWith(`${lang}-`) // e.g. en matches en-US (if reversed) - ); - }) - : pronouns; + const visiblePronouns = filterPronounsByLanguage( + pronouns, + languageFilterEnabled, + selectedLanguages + ); const clamp = (str: string, len: number) => (str.length > len ? `${str.slice(0, len)}...` : str); const limit = mobileOrTablet() ? 1 : 3; diff --git a/src/app/features/settings/cosmetics/LanguageSpecificPronouns.tsx b/src/app/features/settings/cosmetics/LanguageSpecificPronouns.tsx index 22fbba4d3..32c57e59a 100644 --- a/src/app/features/settings/cosmetics/LanguageSpecificPronouns.tsx +++ b/src/app/features/settings/cosmetics/LanguageSpecificPronouns.tsx @@ -41,8 +41,8 @@ export function LanguageSpecificPronouns() { const currentSettings = getSettings(); setSettings({ ...currentSettings, - languageSpecificPronounsEnabled: enabled, - languageSpecificPronounsLanguages: splitAndTrimLanguages(languages), + filterPronounsBasedOnLanguage: enabled, + filterPronounsLanguages: splitAndTrimLanguages(languages), }); }; @@ -51,19 +51,19 @@ export function LanguageSpecificPronouns() { const val = e.target.value.trim(); setLanguageList(val); // save the new language list to the client config, keeping the enabled state unchanged - handleSave(getSettings().languageSpecificPronounsEnabled ?? false, val); + handleSave(getSettings().filterPronounsBasedOnLanguage ?? false, val); }; useEffect(() => { setEnabled( - resolveLanguageSpecificPronounsEnabled(getSettings().languageSpecificPronounsEnabled ?? false) + resolveLanguageSpecificPronounsEnabled(getSettings().filterPronounsBasedOnLanguage ?? false) ); - setLanguageList(getSettings().languageSpecificPronounsLanguages?.join(',') || ''); + setLanguageList(getSettings().filterPronounsLanguages?.join(',') || ''); }, []); // handler for toggling the enabled state of language specific pronouns const handleSetEnabled = (enabled: boolean) => { - handleSave(enabled, getSettings().languageSpecificPronounsLanguages?.join(',') || ''); + handleSave(enabled, getSettings().filterPronounsLanguages?.join(',') || ''); setEnabled(enabled); }; diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index 6e9d0cc99..e8071ae50 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -61,8 +61,8 @@ export interface Settings { privacyBlurEmotes: boolean; showPronouns: boolean; renderGlobalNameColors: boolean; - languageSpecificPronounsEnabled?: boolean; - languageSpecificPronounsLanguages?: string[]; + filterPronounsBasedOnLanguage?: boolean; + filterPronounsLanguages?: string[]; // Sable features! mobileGestures: boolean; diff --git a/src/app/utils/pronouns.ts b/src/app/utils/pronouns.ts index b95ff485d..96a29f197 100644 --- a/src/app/utils/pronouns.ts +++ b/src/app/utils/pronouns.ts @@ -9,3 +9,20 @@ export function parsePronounsInput(pronouns: string): { summary: string; languag return { summary: summary.slice(0, 16), language: language || 'en' }; }); } + +// helper function to filter a list of pronouns based on the user's language settings +export function filterPronounsByLanguage( + pronouns: { summary: string; language?: string }[], + enabled: boolean, + languages: string[] +): { summary: string; language?: string }[] { + if (!enabled) return pronouns; + const normalizedLanguages = languages.map((lang) => lang.trim().toLowerCase()); + const filteredPronouns = pronouns.filter((p) => + normalizedLanguages.includes((p.language || 'en').trim().toLowerCase()) + ); + if (filteredPronouns.length === 0) { + return pronouns; + } + return filteredPronouns; +} From 985567cc9d61ae2ce79087479e78d80bd3aa1b03 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 19:56:39 +0100 Subject: [PATCH 57/67] adjusted example for the GPronoun command --- src/app/hooks/useCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index 903acdc97..ed2ad8cf5 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -942,7 +942,7 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { [Command.GPronoun]: { name: Command.GPronoun, description: - 'Set your global pronouns for this space. Example: /gpronoun "they/them, it/its" | /gpronoun reset', + 'Set your global pronouns for this space. Example: /gpronoun "en:they/them, de:sie/ihr" | /gpronoun reset', exe: async (payload) => { const match = payload.trim().match(/^"(.*)"$/); const rawInput = match ? match[1].trim() : payload.trim(); From 6beb784a907cfaa56b9f64cc89c5eb3e14417130 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 20:05:20 +0100 Subject: [PATCH 58/67] fixed import order --- src/app/components/user-profile/UserRoomProfile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index c43d03c74..0031943dc 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -31,13 +31,13 @@ import { } from '$plugins/react-custom-html-parser'; import { useSpoilerClickHandler } from '$hooks/useSpoilerClickHandler'; import { RenderBody } from '$components/message'; +import { getSettings } from '$state/settings'; +import { filterPronounsByLanguage } from '$utils/pronouns'; import { CreatorChip } from './CreatorChip'; import { UserInviteAlert, UserBanAlert, UserModeration, UserKickAlert } from './UserModeration'; import { PowerChip } from './PowerChip'; import { IgnoredUserAlert, MutualRoomsChip, OptionsChip, ServerChip, ShareChip } from './UserChips'; import { UserHero, UserHeroName } from './UserHero'; -import { getSettings } from '$state/settings'; -import { filterPronounsByLanguage } from '$utils/pronouns'; const KNOWN_KEYS = [ 'moe.sable.app.bio', From abf95e7b82694bb54d6431c589638ebd97eea062 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 20:20:04 +0100 Subject: [PATCH 59/67] fixed issue where it wouldn't accept "weird" string pronouns as pronouns --- src/app/utils/pronouns.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app/utils/pronouns.ts b/src/app/utils/pronouns.ts index 96a29f197..a306543c6 100644 --- a/src/app/utils/pronouns.ts +++ b/src/app/utils/pronouns.ts @@ -5,8 +5,21 @@ export function parsePronounsInput(pronouns: string): { summary: string; languag .map((s) => s.trim()) .filter(Boolean) .map((s) => { - const [language, summary] = s.split(':'); - return { summary: summary.slice(0, 16), language: language || 'en' }; + const parts = s.split(':'); + + if (parts.length === 1) { + return { + summary: parts[0].slice(0, 16), + language: 'en', + }; + } + + const [language, summary] = parts; + + return { + language: language || 'en', + summary: summary.slice(0, 16), + }; }); } From ca17eeebc185ae80dbf887d49647a16d9588cb2f Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 20:28:06 +0100 Subject: [PATCH 60/67] added changeset --- ...pronouns_based_on_the_pronouns_language.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md diff --git a/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md b/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md new file mode 100644 index 000000000..a62b1c079 --- /dev/null +++ b/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md @@ -0,0 +1,28 @@ +--- +default: minor +--- + +# Add option to filter user pronouns based on the pronouns language + +#154 by git@itsrye.dev + +## Description + +the MSC4247 (which we are using in its unstable form) states: + +> All fields within m.pronouns are optional, excluding "language" and "summary" + +Therefore it would be useful to have a possibility to set the language of a pronoun set. + +This can be done by optionally (default: english, so not to cause unexpected behaviour) specifying the language, e.g. `en:she/her`. + +In this case it's equivalent to just entering `she/her` + +Also a way to filter the shown pronouns based on a specified language was introduced. This will find it's home under experimental features for the time being. + +It also accepts "*weird*" string inputs as pronoun, for example setting your pronouns just to `meow` will internally be transformed to `en:meow`. + +There are multiple ways to set your pronouns: + +1. The UI like before but with optional language specifier +2. The `/Pronoun` and `/GPronoun` commands with their behaviour unchanged besides the language based transformation. From 0b75031f1a0aeb1409f38466a5a46de75e30fc01 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 20:32:56 +0100 Subject: [PATCH 61/67] formatting with fmt --- ...on_to_filter_user_pronouns_based_on_the_pronouns_language.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md b/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md index a62b1c079..80a52dcb3 100644 --- a/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md +++ b/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md @@ -20,7 +20,7 @@ In this case it's equivalent to just entering `she/her` Also a way to filter the shown pronouns based on a specified language was introduced. This will find it's home under experimental features for the time being. -It also accepts "*weird*" string inputs as pronoun, for example setting your pronouns just to `meow` will internally be transformed to `en:meow`. +It also accepts "_weird_" string inputs as pronoun, for example setting your pronouns just to `meow` will internally be transformed to `en:meow`. There are multiple ways to set your pronouns: From 81344c32ae41bbafb851ce58311bfbd28f1f8090 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 13:43:26 -0600 Subject: [PATCH 62/67] Comment out tag_prefix in knope.toml Comment out the tag_prefix line in knope.toml. --- knope.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knope.toml b/knope.toml index 16cb05fd1..ce4d35055 100644 --- a/knope.toml +++ b/knope.toml @@ -2,7 +2,7 @@ [package.sable] versioned_files = ["package.json", "package-lock.json"] changelog = "CHANGELOG.md" -tag_prefix = "sable/" +# tag_prefix = "sable/" # assets = "marker for GitHub bot" // TODO: add this later once we have assets [changes] From 88c49fc8e9c53d63c62aec31ed0ec4752a36be36 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 5 Mar 2026 21:00:39 +0100 Subject: [PATCH 63/67] simplify description for filtering user pronouns by language --- ...pronouns_based_on_the_pronouns_language.md | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md b/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md index 80a52dcb3..390e3a434 100644 --- a/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md +++ b/.changeset/add_option_to_filter_user_pronouns_based_on_the_pronouns_language.md @@ -1,28 +1,5 @@ --- -default: minor +sable: minor --- -# Add option to filter user pronouns based on the pronouns language - -#154 by git@itsrye.dev - -## Description - -the MSC4247 (which we are using in its unstable form) states: - -> All fields within m.pronouns are optional, excluding "language" and "summary" - -Therefore it would be useful to have a possibility to set the language of a pronoun set. - -This can be done by optionally (default: english, so not to cause unexpected behaviour) specifying the language, e.g. `en:she/her`. - -In this case it's equivalent to just entering `she/her` - -Also a way to filter the shown pronouns based on a specified language was introduced. This will find it's home under experimental features for the time being. - -It also accepts "_weird_" string inputs as pronoun, for example setting your pronouns just to `meow` will internally be transformed to `en:meow`. - -There are multiple ways to set your pronouns: - -1. The UI like before but with optional language specifier -2. The `/Pronoun` and `/GPronoun` commands with their behaviour unchanged besides the language based transformation. +Add option to filter user pronouns based on the pronouns language From 271c9070a81745a6eef8e5474d6feae0bfaa9d6f Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 14:34:05 -0600 Subject: [PATCH 64/67] add toggles for rendering room font and colors --- .../features/settings/cosmetics/Cosmetics.tsx | 18 +++++++ src/app/hooks/useUserProfile.ts | 48 ++++++++++++++----- src/app/state/settings.ts | 4 ++ 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/src/app/features/settings/cosmetics/Cosmetics.tsx b/src/app/features/settings/cosmetics/Cosmetics.tsx index 7a21588d0..731c247d9 100644 --- a/src/app/features/settings/cosmetics/Cosmetics.tsx +++ b/src/app/features/settings/cosmetics/Cosmetics.tsx @@ -169,6 +169,8 @@ function IdentityCosmetics() { settingsAtom, 'renderGlobalNameColors' ); + const [renderRoomColors, setRenderRoomColors] = useSetting(settingsAtom, 'renderRoomColors'); + const [renderRoomFonts, setRenderRoomFonts] = useSetting(settingsAtom, 'renderRoomFonts'); const [uniformIcons, setUniformIcons] = useSetting(settingsAtom, 'uniformIcons'); const [rightBubbles, setRightBubbles] = useSetting(settingsAtom, 'useRightBubbles'); const [showUnreadCounts, setShowUnreadCounts] = useSetting(settingsAtom, 'showUnreadCounts'); @@ -205,6 +207,22 @@ function IdentityCosmetics() { } /> + + + } + /> + + + } + /> + selectAtom(profilesCacheAtom, (db) => db[userId]), [userId]); @@ -137,15 +139,20 @@ export const useUserProfile = ( let spaceFont; let spacePronouns; - if (room) { + if (room && (renderRoomColors || renderRoomFonts)) { const state = room.getLiveTimeline().getState(EventTimeline.FORWARDS); - const localEvent = state?.getStateEvents(StateEvent.RoomCosmeticsColor, userId); - localColor = (Array.isArray(localEvent) ? localEvent[0] : localEvent)?.getContent()?.color; + if (renderRoomColors) { + const localEvent = state?.getStateEvents(StateEvent.RoomCosmeticsColor, userId); + localColor = (Array.isArray(localEvent) ? localEvent[0] : localEvent)?.getContent()?.color; + } - const localFontEvent = state?.getStateEvents(StateEvent.RoomCosmeticsFont, userId); - localFont = (Array.isArray(localFontEvent) ? localFontEvent[0] : localFontEvent)?.getContent() - ?.font; + if (renderRoomFonts) { + const localFontEvent = state?.getStateEvents(StateEvent.RoomCosmeticsFont, userId); + localFont = ( + Array.isArray(localFontEvent) ? localFontEvent[0] : localFontEvent + )?.getContent()?.font; + } const localPronounEvent = state?.getStateEvents( StateEvent.RoomCosmeticsPronouns as string, @@ -160,13 +167,18 @@ export const useUserProfile = ( const parentSpace = mx.getRoom(parents[0].getStateKey()); const pState = parentSpace?.getLiveTimeline().getState(EventTimeline.FORWARDS); - const spaceEvent = pState?.getStateEvents(StateEvent.RoomCosmeticsColor, userId); - spaceColor = (Array.isArray(spaceEvent) ? spaceEvent[0] : spaceEvent)?.getContent()?.color; + if (renderRoomColors) { + const spaceEvent = pState?.getStateEvents(StateEvent.RoomCosmeticsColor, userId); + spaceColor = (Array.isArray(spaceEvent) ? spaceEvent[0] : spaceEvent)?.getContent() + ?.color; + } - const spaceFontEvent = pState?.getStateEvents(StateEvent.RoomCosmeticsFont, userId); - spaceFont = ( - Array.isArray(spaceFontEvent) ? spaceFontEvent[0] : spaceFontEvent - )?.getContent()?.font; + if (renderRoomFonts) { + const spaceFontEvent = pState?.getStateEvents(StateEvent.RoomCosmeticsFont, userId); + spaceFont = ( + Array.isArray(spaceFontEvent) ? spaceFontEvent[0] : spaceFontEvent + )?.getContent()?.font; + } } } const validGlobalVal = isValidHex(data?.nameColor); @@ -203,5 +215,15 @@ export const useUserProfile = ( resolvedPronouns, pronouns: resolvedPronouns, }; - }, [cached, userId, room, mx, legacyUsernameColor, renderGlobalColors, initialProfile]); + }, [ + cached, + userId, + room, + mx, + legacyUsernameColor, + renderGlobalColors, + initialProfile, + renderRoomColors, + renderRoomFonts, + ]); }; diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index 64dfe3d27..68e3eca80 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -61,6 +61,8 @@ export interface Settings { privacyBlurEmotes: boolean; showPronouns: boolean; renderGlobalNameColors: boolean; + renderRoomColors: boolean; + renderRoomFonts: boolean; // Sable features! mobileGestures: boolean; @@ -115,6 +117,8 @@ const defaultSettings: Settings = { privacyBlurEmotes: false, showPronouns: true, renderGlobalNameColors: true, + renderRoomColors: true, + renderRoomFonts: true, // Sable features! mobileGestures: true, From 5adcb308d29fcfae719133027827c62a09723c56 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 14:36:46 -0600 Subject: [PATCH 65/67] Create room_font_and_color_toggles.md --- .changeset/room_font_and_color_toggles.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/room_font_and_color_toggles.md diff --git a/.changeset/room_font_and_color_toggles.md b/.changeset/room_font_and_color_toggles.md new file mode 100644 index 000000000..5130aebf7 --- /dev/null +++ b/.changeset/room_font_and_color_toggles.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Added two toggles in Settings > Appearance > Identity for disabling rendering room/space fonts and colors. From ceeb54e29b5634c03e953a414f930148a8bced12 Mon Sep 17 00:00:00 2001 From: hazre Date: Thu, 5 Mar 2026 21:58:59 +0100 Subject: [PATCH 66/67] fix: knope misconfiguration --- knope.toml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/knope.toml b/knope.toml index ce4d35055..d0d8bfc8d 100644 --- a/knope.toml +++ b/knope.toml @@ -1,18 +1,15 @@ -[package.sable] +[packages.sable] versioned_files = ["package.json", "package-lock.json"] changelog = "CHANGELOG.md" -# tag_prefix = "sable/" -# assets = "marker for GitHub bot" // TODO: add this later once we have assets - -[changes] -ignore_conventional_commits = true - -[package] extra_changelog_sections = [ { name = "Documentation", types = ["docs"] }, { name = "Notes", types = ["note"] } ] +# assets = "marker for GitHub bot" // TODO: add this later once we have assets + +[changes] +ignore_conventional_commits = true [[workflows]] name = "release" From 854f2758e68f5811dca64014c697fc93957aae4d Mon Sep 17 00:00:00 2001 From: 7w1 Date: Thu, 5 Mar 2026 15:09:34 -0600 Subject: [PATCH 67/67] Refactor settings.ts to resolve merge conflicts Remove conflicting lines and clean up settings. --- src/app/state/settings.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index 09ceba441..835984b3f 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -61,13 +61,10 @@ export interface Settings { privacyBlurEmotes: boolean; showPronouns: boolean; renderGlobalNameColors: boolean; -<<<<<<< feat-honor-language-of-pronouns filterPronounsBasedOnLanguage?: boolean; filterPronounsLanguages?: string[]; -======= renderRoomColors: boolean; renderRoomFonts: boolean; ->>>>>>> dev // Sable features! mobileGestures: boolean;