Commit Graph

1664 Commits

Author SHA1 Message Date
Lotus Bot e547248681 fix: prettier formatting in index.tsx (single quotes) 2026-05-22 10:46:55 -04:00
Lotus Bot ea2155c635 fix: auto-reload on stale chunk load failure (vite:preloadError)
When a new deploy lands while a tab is open, lazy-loaded chunks (like
GifPicker) disappear because their content-hash filename changes. Vite
dispatches a vite:preloadError event in this case. We reload once and
clear the flag on successful load so future deploys can trigger again.
2026-05-22 02:31:54 -04:00
Lotus Bot b6e1a0eea9 fix: use Icons.Setting (singular) - folds v2.6.2 has no Icons.Settings
Icons.Settings is undefined in folds v2.6.2; only Icons.Setting exists.
This caused TypeError: i is not a function when rendering m.room.join_rules
or m.room.guest_access state events in the room timeline, crashing DMs with
those events visible in the initial view.
2026-05-22 02:23:17 -04:00
Lotus Bot a5e5b3c413 fix: remove manual encodeURIComponent from pathUtils (react-router v7 encodes automatically)
react-router v7's generatePath() now calls encodeURIComponent() on all
path params. pathUtils.ts was also calling encodeURIComponent() before
passing to generatePath, resulting in double-encoding (e.g. '#' became
'%2523' instead of '%23').

This caused spaces/rooms with alias paths to receive double-encoded
room IDs from useParams(), which were then re-encoded by matrix-sdk
when making HTTP requests (400 Bad Request from Synapse).

Remove the manual encodeURIComponent() calls -- generatePath handles it.
2026-05-22 01:59:00 -04:00
Lotus Bot 7168b11323 fix: prettier formatting, viteStaticCopy paths, HydrateFallback warning
- Fix prettier formatting in useCall.ts and initMatrix.ts (unblocks CI)
- Fix viteStaticCopy stripBase so manifest.json and public/locales/ land
  at correct output paths (was getting extra 'public/' prefix from v4 path
  preservation behavior)
- Silence react-router v7 HydrateFallback warning on root route (SPA has
  no SSR hydration, null is intentional)
2026-05-22 00:36:30 -04:00
Lotus Bot e74426cc86 fix: upgrade matrix-js-sdk 38.2.0 -> 41.5.0 with API compat fixes
- sessionMembershipsForRoom() removed in v41 (was synchronous, static)
- Replacement: read session.memberships directly (always up-to-date, sync)
  - useCall.ts: useCallMembers reads session.memberships
  - useCallEmbed.ts: createCallEmbed reads rtcSession.memberships
  - CallEmbedProvider.tsx: inline check on session.memberships
- Remove unused MatrixRTCSession import from CallEmbedProvider
- clearLoginData: also unregisters service workers and clears SW caches
2026-05-22 00:19:11 -04:00
Lotus Bot 7284132432 fix: upgrade @giphy/react-components 1.6.0 -> 5.9.4
1.6.0 did not export SearchContextManager/SearchContext/SearchBar,
causing React error #130 (element type undefined) when opening GifPicker.
5.9.4 uses @emotion (not styled-components), supports React 16-18, and
exports all required components. Downgrade @giphy/js-fetch-api to 4.2.2
to match the peer dep range.
2026-05-21 23:53:58 -04:00
Lotus Bot 337d5e2b78 fix: graceful recovery for IDB schema version conflict
When matrix-sdk is briefly upgraded then reverted, the local IndexedDB
schema version is higher than the SDK expects. Detect the VersionError
DOMException and show a clear 'Clear local data and reload' button
instead of a cryptic error message.
2026-05-21 23:50:24 -04:00
Lotus Bot 005f081f27 fix: revert matrix-js-sdk 41.5.0 -> 38.2.0 (sessionMembershipsForRoom API removed)
v41 renamed sessionMembershipsForRoom to sessionMembershipsForSlot (now async).
Reverting until calling code is updated.
2026-05-21 23:42:53 -04:00
Lotus Bot 4e39ea79ff chore: upgrade matrix-js-sdk 38.2.0 -> 41.5.0
3 major versions of SDK updates, build verified clean.
2026-05-21 23:38:29 -04:00
Lotus Bot 61a1f008d0 chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17
- i18next 23->26 + react-i18next 15->17
- prettier 2->3, reformat all files
- replace @fontsource/inter with @fontsource-variable/inter 5, update import path
- domhandler 5->6 (aligns with transitive deps)
- lint-staged 16->17
2026-05-21 23:30:50 -04:00
Lotus Bot b3666fa876 fix: revert giphy 10.x (styled-components API break), clean WelcomePage
@giphy/react-components@10.x calls styled-components internals
(mergeAttributes) that do not exist in styled-components v6 — crashes
on open. Reverted to 1.6.0 until giphy publishes a v6-compatible release.

WelcomePage: remove Sentry test button (verified working), rename
Support -> Lotus Matrix Guide.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 23:09:13 -04:00
Lotus Bot d32055ee3d chore: bulk dependency updates + fix immer v11 default import + sentry test
Package updates (safe minor/major bumps, all build-verified):
- @tanstack/react-query 5.24->5.100, react-virtual 3.2->3.13
- jotai 2.6->2.20, immer 9->11, dayjs, chroma-js, classnames, blurhash
- slate/slate-dom/slate-react 0.123->0.124
- focus-trap-react 10->12, react-error-boundary 4->6
- html-dom-parser 4->7, html-react-parser 4->6
- pdfjs-dist 4->5, ua-parser-js 1->2
- i18next-http-backend 3->4, i18next-browser-languagedetector 8.0->8.2
- react-aria 3.29->3.48, matrix-widget-api 1.16->1.17
- @atlaskit/pragmatic-drag-and-drop* minor bumps
- @rollup/plugin-inject 5.0.3->5.0.5, @rollup/plugin-wasm 6.1->6.2
- @element-hq/element-call-embedded 0.19.3->0.19.4
- @types/* patches, eslint-plugin-* minors

Breaking change fix:
- immer v11 removed default export; updated 11 files to named import

Temporary: add Sentry test button to WelcomePage for verification.
Remove after confirming errors reach the dashboard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 22:23:19 -04:00
Lotus Bot 922f03a4f1 chore: upgrade @giphy/react-components 1.6.0->10.1.2
All newly flagged high-severity packages (lodash, js-cookie) are either
in dev-only tools (commitizen) or tree-shaken out of the deployed bundle
(react-use/js-cookie is unused). Zero deployed-bundle impact confirmed.
Being 9 major versions behind accumulates migration debt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 22:14:27 -04:00
Lotus Bot 3a02484378 fix: lodash 4.17.21->4.18.1, revert giphy upgrade (worse vulns)
lodash >= 4.18.0 patches prototype-pollution (GHSA-f23m-r3pf-42rh) and
code-injection (GHSA-r5fr-rjxr-66jc) used by slate-dom/slate-react in
the deployed bundle.

Attempted @giphy/react-components@10.1.2 upgrade but it pulled in new
high-severity lodash and js-cookie vulns — net regression, reverted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 22:01:31 -04:00
Lotus Bot 3d1590fa7b fix: dompurify 2.5.9->3.4.5 (XSS), emojibase chunk, husky prepare
- dompurify updated to 3.4.5 to fix 7 XSS/prototype-pollution CVEs
- emojibase-data added to manualChunks: splits 856 kB out of the main
  bundle, reducing it from 1.8 MB to 932 kB
- husky prepare script updated from deprecated "husky install" to "husky"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 21:55:39 -04:00
Lotus Bot 720d18296f fix: pdf.worker at root, drop vite-plugin-top-level-await package
Replace broken vite-plugin-static-copy target for pdf.worker with a
custom closeBundle plugin that copies the file directly to dist root.
Also uninstall vite-plugin-top-level-await which was removed from
vite.config.js in the previous commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 21:45:30 -04:00
Lotus Bot 30c6d4736f chore: trigger deploy pipeline test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 21:33:29 -04:00
Lotus Bot cbbfa7e8d4 style: prettier format ci.yml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 21:14:01 -04:00
Lotus Bot 00be1d9c9e fix: use esnext target, drop vite-plugin-top-level-await
Plugin crashes with Rollup 4. esnext target supports TLA natively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 21:07:12 -04:00
Lotus Bot 42b9cc2b64 chore: prettier format all files, brotli, Sentry release tagging, CI gates
Prettier: auto-formatted 103 files to fix baseline. Prettier check in CI
  is now a hard gate (removed continue-on-error).

Brotli: installed libnginx-mod-http-brotli-filter/static. Enabled in nginx
  with brotli_static on for pre-compressed assets and comp_level 6.

Sentry releases: deploy script now exports VITE_APP_VERSION=<git-short-sha>
  before building so each Sentry release maps to an exact commit.
  CI also passes github.sha as VITE_APP_VERSION.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:49:33 -04:00
Lotus Bot 408fc1b846 ci: add TypeScript, ESLint, Prettier, audit, and bundle size report
Build is the only hard gate. TS/ESLint/Prettier/audit run as informational
checks (continue-on-error) since the codebase has pre-existing issues from
matrix-js-sdk type incompatibilities and upstream formatting.

Bundle size table is written to the job summary after every build so regressions
are visible without digging into logs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:42:45 -04:00
Lotus Bot c63b8519ed ci: add Gitea Actions build check workflow
Runs npm ci + npm run build on every push to lotus and on PRs.
Marks commit as failed if the build breaks — gives early feedback
before the webhook deploy script also catches it.
Source map upload skipped in CI (deploy script handles that).
npm audit runs informational-only (continue-on-error) since known
vulns require upstream fixes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:35:40 -04:00
Lotus Bot d121a22c15 feat: skeleton loaders, Sentry source maps, auto-deploy via webhook
RoomSkeleton: shimmer skeleton matching Room header/timeline/input layout,
  used as Suspense fallback for all three Room routes (home/direct/space)

Sentry source maps: @sentry/vite-plugin uploads 72 hidden source map files
  to Sentry on each build then deletes them from dist — stack traces now show
  real file/line numbers instead of minified bundle positions.
  Auth token loaded from /etc/lotus-deploy.env (not in git).

Auto-deploy: webhook receiver on port 9001, nginx proxies
  /hooks/lotus-deploy, HMAC-SHA256 verified, triggers on lotus branch push.
  Deploy script: git reset --hard + npm ci + npm run build + rsync to webroot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:30:44 -04:00
Lotus Bot 1eec57cdc9 Merge vite6-upgrade: upgrade Vite 5->6 with all ecosystem plugins 2026-05-21 20:11:13 -04:00
Lotus Bot 5e53d68234 chore: upgrade Vite 5 -> 6 and associated plugins
vite: 5.4.19 -> 6.4.2
@vitejs/plugin-react: 4.2.0 -> 5.2.0 (6.x requires Vite 8, skipped)
@vanilla-extract/vite-plugin: 3.7.1 -> 5.2.2
@vanilla-extract/css: 1.9.3 -> 1.20.1
@vanilla-extract/recipes: 0.3.0 -> 0.5.7
vite-plugin-pwa: 0.20.5 -> 1.3.0
vite-plugin-static-copy: 1.0.4 -> 4.1.0
vite-plugin-top-level-await: 1.4.4 -> 1.6.0

Reduces vuln count from 21 to 16 (eliminated 5 moderate).
No config changes required - vite.config.js was compatible as-is.
Defensive Icon src guard confirmed present in Vite 6 output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:11:09 -04:00
Lotus Bot b15a149d14 fix: disable Sentry tracing to prevent CORS failures on Matrix requests
browserTracingIntegration injects sentry-trace and baggage headers into all
outgoing fetch calls. Synapse does not list these in Access-Control-Allow-Headers,
so every Matrix API call was blocked by the browser CORS preflight check.

Removed browserTracingIntegration, set tracePropagationTargets:[] and
tracesSampleRate:0. Error capture (the useful part) is unaffected.
CSP fix (Sentry ingest domain) is applied via nginx — no code change needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:00:21 -04:00
Lotus Bot 6037e10a23 perf: split chunks and lazy-load Room to shrink initial bundle
manualChunks: add sentry, folds, i18n, jotai, immer
Router: lazy-load Room component (used in home/direct/space routes)
Sentry: wire in real DSN with browserTracingIntegration, 5% trace rate,
  tracePropagationTargets scoped to matrix.lotusguild.org, sendDefaultPii=false

Main bundle: 2481 kB -> 1857 kB gzip 623 kB -> 450 kB (-28% initial load)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 19:56:38 -04:00
Lotus Bot 41899adafa feat: add Sentry error tracking with defensive error boundary
- Initialize Sentry SDK in index.tsx when VITE_SENTRY_DSN env var is set
- Wrap entire App with Sentry.ErrorBoundary (replaces the hard crash with a retry UI)
- 5% trace sample rate, sendDefaultPii disabled, strip events containing accessToken
- Add .env.production template with VITE_SENTRY_DSN placeholder
- Get your DSN from sentry.io -> Project Settings -> Client Keys

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 19:44:51 -04:00
Lotus Bot c1249f3322 fix: guard Icon src against non-function values to prevent crash
Add defensive check in folds Icon component so that if src is ever
undefined or non-function (root cause unknown, possibly data-dependent),
the SVG renders empty rather than throwing and crashing the whole app.

Also adds postinstall script to re-apply the patch after npm install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 19:26:52 -04:00
Lotus Bot 0ef8dc9baf fix(security): upgrade i18next-http-backend 2.5.2→3.0.6 (path traversal CVE)
Fixes GHSA-q89c-q3h5-w34g: path traversal & URL injection via unsanitised
lng/ns parameters. Remaining open issues are all in devDependencies
(commitizen/lodash/tmp) or dev-server-only tools (esbuild/vite), with no
runtime impact on the production build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:17:08 -04:00
Lotus Bot ce2e0ef203 perf(router): lazy-load Lobby/Explore/Inbox routes; fix spoiler aria-pressed initial state
Lobby, Explore/FeaturedRooms/PublicRooms, Inbox/Notifications/Invites are
now lazy-loaded via React.lazy so they only enter the bundle when navigated
to. Main bundle: 2547 kB → 2472 kB (gzip 637 → 618 kB).

Spoiler aria-pressed was initialised to false (revealed); changed to true
so the spoiler starts hidden, matching CSS logic (aria-pressed=true →
color:transparent).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:14:08 -04:00
Lotus Bot 689805ca6e fix(a11y): semantic headings, htmlFor/id associations, remove duplicate aria-labels
H-tag: add as=h1/h2 to dialog/UIA/auth headings (21 components)
Label: add htmlFor/id to PasswordRegisterForm (5 pairs) and PasswordResetForm (3 pairs)
Dupe: remove duplicate aria-label from Controls.tsx screenshare button, MembersDrawer, Members, RoomInput

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 15:36:59 -04:00
Lotus Bot 09905828ef fix(a11y): replace aria-pressed with aria-expanded on Home/Space/Direct menu triggers\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:51:14 -04:00
Lotus Bot a67f581c52 fix(a11y): add htmlFor/id label associations in login and token input forms\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:49:49 -04:00
Lotus Bot 8fa079c289 fix: add color-scheme meta, og:type, fix fonts.googleapis.com crossorigin\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:48:19 -04:00
Lotus Bot a90169abb9 fix(a11y): add aria-live regions to SyncStatus connection banners\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:43:26 -04:00
Lotus Bot 8e62dec419 fix(a11y): add labels to unlabeled form inputs\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:40:35 -04:00
Lotus Bot d1c49a1738 fix(a11y): add semantic heading hierarchy across settings, modals, and pages\n\nAdd as="h1"/h2/h3 to Text components used as visual headings:\n- Auth pages: h1 brand, h2 section titles\n- Settings panels: h2 for General/Permissions/DeveloperTools/Members/Emojis\n- Modal dialogs: h2 for CreateRoom, CreateSpace, AddServer\n- Explore pages: h2 page heading, h3 subsections\n- Inbox pages: h2 Notifications/Invites, h3 Primary/Public/Spam\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:35:55 -04:00
Lotus Bot 343bb3a496 perf: lazy-load modal renderers and auth pages, split vendor chunks\n\nMain bundle: 3866 kB -> 2547 kB gzip (637 kB, was 997 kB)\nNew cacheable chunks: matrix-sdk, react-dom, router, react-query, linkify\nLazy-loaded: RoomSettings, SpaceSettings, Search, CreateRoom, CreateSpace, Auth\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:32:40 -04:00
Lotus Bot c05b233b3f fix(a11y): label all buttons in Editor.preview.tsx demo component\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:21:34 -04:00
Lotus Bot 9843e8bdf1 fix(a11y): label remaining unlabeled icon buttons across 12 components\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:17:07 -04:00
Lotus Bot 2909aebb1f fix(a11y): replace aria-pressed with aria-expanded on menu-trigger buttons\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:06:40 -04:00
Lotus Bot abd90ab980 fix(a11y): fix remaining unlabeled icon buttons and portaled tooltip issue\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> 2026-05-21 13:04:11 -04:00
Lotus Bot 5e740496c9 fix(perf): hoist lotusTerminal setting out of Message component (Perf-10)
Previously every visible Message subscribed to settingsAtom via useSetting,
creating O(80) active atom subscriptions. Now RoomTimeline reads it once
and passes it down as a prop, reducing subscriptions to 1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 12:07:42 -04:00
Lotus Bot d707c4441c feat(a11y): form input labels (H-6), remaining button labels (C-1)
H-6: aria-label on all form inputs missing accessible names:
  - Login: username, password (already done)
  - Register: username, password, confirm, token, email
  - Password reset: email, new password, confirm password
  - Settings: display name, user ID to ignore, keyword, page zoom,
    date format, device name, backup passwords (new/confirm/restore)
  - Auth: server URL picker input
C-1: additional icon buttons:
  - RoomInput: toolbar toggle (aria-pressed + label)
  - Lobby/Members: scroll to top, toggle member list
  - UIAFlowOverlay: cancel authentication
  - BackupRestore: backup options menu
  - UrlPreview: previous/next preview buttons
  - RoomPacks: undo remove/remove pack buttons
  - RoomViewHeader: start call, member list toggle
  - ServerPicker: change server button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 12:03:26 -04:00
Lotus Bot df30476b53 feat(a11y): comprehensive icon button label sweep — 60+ remaining buttons labeled
C-1 complete sweep across all components and features:
- Call controls: mic mute/unmute, deafen/undeafen, video, screenshare, chat
- RoomInput: dismiss reply, attach file, sticker, emoji, GIF, location, toolbar
- Media viewers: close in image/pdf/text viewers and editors
- Settings dialogs: close buttons in all room/space/common settings panels
- Lobby: back, toggle member list, scroll to top, pack add/remove
- Auth: server picker, UIA flow cancel
- Upload cards: cancel uploads
- URL preview: prev/next buttons
- Members drawer: close + scroll to top
- RoomViewHeader: back, start call, toggle member list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 11:58:40 -04:00
Lotus Bot 18b12cfca1 fix(perf,a11y): selectAtom for unread subscriptions, semantic headings, Perf-5 binary search
Perf-3: Replace raw roomToUnreadAtom subscription in Home, Direct, Space with
  selectAtom-derived Set<string> — components now only re-render when rooms
  gain/lose unread presence, not on every notification count update
Perf-5: RoomTimeline eventRenderer now uses binary search on precomputed
  timelineSegments instead of O(N×T) linear scan per visible message
A11y L-1: Add as=h2 semantic heading to Home, Direct, Inbox, Space page nav
  titles so screen readers announce page sections correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 21:59:09 -04:00
Lotus Bot 4e80c0a0f5 feat(a11y,perf): comprehensive icon button labels, toolbar a11y, timeline binary search
A11y C-1: aria-label on 30+ remaining icon-only buttons across:
  - settings panels (close, reset, info, expand, remove, undo)
  - editor toolbar (bold, italic, underline, strike, code, spoiler,
    blockquote, code block, ordered/unordered list, headings 1-3)
  - auth stages (cancel buttons in SSO, Password stages)
  - device verification (cancel buttons)
  - password input (show/hide toggle with dynamic label)
  - event readers, account data editor close buttons
  - global emoji packs (add/remove buttons)
Perf-5: Replace O(N×T) getTimelineAndBaseIndex scan with precomputed binary
  search (timelineSegments useMemo) — O(log T) per visible message render

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 21:54:33 -04:00
Lotus Bot d4705f9235 fix(a11y,sec): remove tabIndex=-1 from interactive buttons, npm audit fix
H-3: tabIndex=-1 removed from login info, settings reset, settings info buttons
      + aria-label added to each for screen reader discoverability
SEC: npm audit fix - 18 non-breaking dependency updates (34 vulns -> 16 remaining)
     Remaining 16 require --force (breaking changes, deferred)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 21:47:20 -04:00