Author SHA1 Message Date
litruv 52a9da18f2 Gate the splash on rooms only and hold only the remaining animation time. 2026-11-03 04:46:26 +11:00
litruv 9b3956d85f Turn off the prism index-key rule and drop the stale directives.
Checks / checks (push) Successful in 2m0s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-03 02:53:34 +11:00
litruv f81461c044 Merge the mutually recursive CSS scope helpers. [skip build]
Checks / checks (push) Successful in 2m0s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-03 02:32:08 +11:00
litruv 96d0d27549 Remove the TikTok embeds and the raw oEmbed HTML injection. [skip build] 2026-11-03 02:25:42 +11:00
litruv 33ae13e514 Drop the key conflict handler and the crypto store prefix. [skip build]
Checks / checks (push) Successful in 2m0s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-03 02:10:33 +11:00
litruv 17d1eef572 Turn off the accepted rules and fix the design tokens, alt text, and last type errors. [skip build]
Checks / checks (push) Successful in 2m18s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-03 01:10:06 +11:00
litruv 3db9b499af Use EventType at the space create sites and augment the room kind key. [skip build]
Checks / checks (push) Successful in 2m5s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-02 05:24:52 +11:00
litruv fea879497c Augment the custom event types and make the dep arrays honest. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-02 05:12:35 +11:00
litruv b85a2b9290 Fix the reaction content type and the fixable lint sites. [skip build]
Checks / checks (push) Successful in 2m6s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-02 04:21:58 +11:00
litruv 9d17b14a9e Type the crypto, settings, and component any sites. [skip build]
Checks / checks (push) Successful in 2m4s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-02 03:56:07 +11:00
litruv 6c8a085ae1 Type the paarrot api, WebKit globals, and plugin command content. [skip build]
Checks / checks (push) Successful in 2m6s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-02 02:22:02 +11:00
litruv b36335cde9 Type the window and power-level casts. [skip build]
Checks / checks (push) Successful in 2m5s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-02 01:45:51 +11:00
litruv 8d6aaa619f Move the Capacitor code to the mobile overlay. [skip build]
Checks / checks (push) Successful in 2m6s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-02 01:07:20 +11:00
litruv 1e3d630b1a Fix the ref, upload, keyframes, and implicit-any type errors. [skip build]
Checks / checks (push) Successful in 2m6s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-02 00:51:31 +11:00
litruv 45f38f2ac8 Drop the mutation and sequential-await rules and the stale directives. [skip build]
Checks / checks (push) Successful in 2m6s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-02 00:09:28 +11:00
litruv 48db806dd7 Use EventType at the state and account data call sites. [skip build]
Checks / checks (push) Successful in 2m4s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 23:50:13 +11:00
litruv 634d1e0a0f Resolve the exhaustive-deps findings and attach cause to the rethrown errors. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 23:04:36 +11:00
litruv 027dbee1f1 Type the updater API and the Tauri global. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 22:36:44 +11:00
litruv 3781b05f6f Type the electron and matrix plugin call sites instead of any. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 22:08:24 +11:00
litruv eaa9ac00dd Add keyboard activation to the interactive elements and use stable keys. [skip build]
Checks / checks (push) Successful in 2m8s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 21:32:32 +11:00
litruv 664b7eb739 Rewrite the restricted iterators and reorder the forward references. [skip build]
Checks / checks (push) Successful in 2m11s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 21:05:47 +11:00
litruv 5477242661 Fix the mechanical lint groups and delete the unused bindings. [skip build]
Checks / checks (push) Successful in 2m12s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 20:31:21 +11:00
litruv 593dd3bdf3 Mount the dialog host at the app root so prompts resolve before the client route renders. [skip build]
Checks / checks (push) Successful in 2m8s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 19:55:26 +11:00
litruv 9bc8679fb7 Replace the native confirm and alert with an in-app dialog. [skip build]
Checks / checks (push) Successful in 2m8s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 11:44:17 +11:00
litruv 6805762834 Drop autofocus and move the search reset out of render. [skip build]
Checks / checks (push) Successful in 2m6s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 10:48:55 +11:00
litruv 2db4fe4734 Drop the unused eslint-disable directives. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 10:39:41 +11:00
litruv 73554ecf7f Fix the small mechanical rules. [skip build]
Checks / checks (push) Successful in 2m12s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 10:28:59 +11:00
litruv bb85cd9778 Turn off the React Compiler rules and no-bitwise. [skip build]
Checks / checks (push) Successful in 2m17s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 09:58:49 +11:00
litruv 29aaba56f0 Move the browser-encrypt-attachment types into an ambient declaration file. [skip build]
Checks / checks (push) Successful in 2m11s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 09:54:17 +11:00
litruv 24cde1447d Put the repo in the commit link. [skip build]
Checks / checks (push) Successful in 2m9s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 09:29:39 +11:00
litruv 8a53006ead Use globalThis and React.JSX in the browser code. [skip build]
Checks / checks (push) Successful in 2m10s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 09:09:00 +11:00
litruv 230ca4fcf0 Add the debug packet recorder behind the developer-tools toggle.
Checks / checks (push) Successful in 2m14s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 09:01:38 +11:00
litruv 9591d8d01b Fix the mechanical style rules. [skip build] 2026-11-01 09:01:32 +11:00
litruv 831ce01150 Turn off the base unused-vars rule for the TS files. [skip build]
Checks / checks (push) Successful in 2m10s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 07:02:36 +11:00
litruv 2d3bebdc23 Drop the unused imports and the inert unused variables. [skip build]
Checks / checks (push) Successful in 2m16s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 06:09:31 +11:00
litruv c46d4d367e Turn off no-undef for the TS files too. [skip build]
Checks / checks (push) Successful in 2m11s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 05:48:37 +11:00
litruv d6fe94ff48 Drop the dead Tauri branches and the plugin packages. [skip build]
Checks / checks (push) Successful in 2m43s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 05:31:13 +11:00
litruv 0f60822cec Fix the single-violation style findings. [skip build] 2026-11-01 05:31:04 +11:00
litruv b158648fc4 Remove the playground. [skip build]
Checks / checks (push) Successful in 2m15s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 04:53:15 +11:00
litruv 205860c168 Turn off the JSX scope rule and allow console. [skip build] 2026-11-01 04:52:19 +11:00
litruv 3be37c5d09 Export the default in the raw module declaration so the typecheck compiles.
Checks / checks (push) Successful in 2m24s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 04:27:31 +11:00
litruv a6ad8651b3 Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
Checks / checks (push) Successful in 2m11s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 04:23:53 +11:00
litruv 3cd159a63e Drop the redundant try around the render check fetch.
Checks / checks (push) Successful in 1m58s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 04:01:33 +11:00
litruv 0688075542 Point the commit link at the public web base.
Checks / checks (push) Successful in 1m56s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 03:58:19 +11:00
litruv 7edf179ec9 Drop the explicit undefined initialisation of encInfo.
Checks / checks (push) Successful in 1m56s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 03:45:49 +11:00
litruv c0aa7fa8f5 Comment the fixing commit when a check issue closes.
Checks / checks (push) Successful in 1m56s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 03:43:06 +11:00
litruv a77f72f5d6 Strip the ANSI codes from check output before matching findings.
Checks / checks (push) Successful in 1m56s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 03:37:32 +11:00
litruv 7689433376 Page the open issue list so dedupe sees every check issue.
Checks / checks (push) Successful in 1m58s
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 03:32:37 +11:00
litruv 6e6d4322c5 Port the ESLint config to flat format and file check findings as Gitea issues.
Checks / checks (push) Successful in 2m38s
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-11-01 03:20:19 +11:00
litruv bb27305b70 Add a developer tools view for public profile fields.
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-11-01 02:03:29 +11:00
litruv fcbd9b4b66 Remove the unused joinNames helper from the typing indicator. 2026-11-01 02:03:23 +11:00
litruv 14f31f57c1 Add a per-user custom typing verb to the typing indicator.
The verb is a profile field (im.paarrot.typing_verb) read through the shared profile cache. The sentence builder replaces the four hardcoded branches, and the profile settings page has presets, a text input, and a live preview.
2026-11-01 01:24:59 +11:00
litruv b294bb0c06 Revert reporting the activity bar against the message in the viewport.
Trigger cinny-mobile / dispatch (push) Successful in 1s
The activity bar shows readers of the latest rendered event again. The scroll listener and the extra prop are gone.
2026-10-31 23:51:34 +11:00
litruv a6fac786b3 Fetch the TikTok oEmbed through the main process in Electron and drop the thumbnail crossOrigin.
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-10-15 23:12:55 +11:00
litruv a4e96dd01f Remove the Paarrot delivery receipt.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Delivery markers (com.paarrot.received) are no longer sent or rendered; the activity bar shows only read receipts. Markers already sent to servers remain there.
2026-10-13 19:04:54 +11:00
litruv f0495cccca Report the activity bar against the message in the viewport.
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-10-13 14:34:25 +11:00
litruv 76e5f960d1 Add Telegram-style delivery receipt to Paarrot.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Matrix has no delivery receipt type in the spec (Synapse only accepts
m.read, m.read.private and m.fully_read), so delivery is recorded as a
client-defined event com.paarrot.received related to the target message
with m.reference. The app sends the marker when a notification fires for
a message, and the bottom-right indicator shows a single tick when
received-but-not-read and the existing double tick once read. Other
clients see an unknown event; cinny never renders it in the timeline
because events with a relation are skipped unless show hidden events is on.
2026-10-13 08:01:04 +11:00
litruv bd649d4e16 Apply the flat composer chrome to all themes instead of stationery only.
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-10-13 03:10:20 +11:00
litruv 2639982d5b Add word wrap, line numbers, and language override to code blocks. 2026-10-13 03:09:31 +11:00
litruv 95d1cb9630 Show cached spaces on the loading splash until the chats are ready
Trigger cinny-mobile / dispatch (push) Successful in 1s
The splash hid as soon as sync reported Prepared, so the first paint after it
disappeared showed the empty state. Hide only once the room-list atoms actually
contain chats, and bind those atoms while the splash is still up so the first
paint is already populated.

Also fixes the ClientEvent.Sync handler signature: data is the third argument,
so reading it as the second made fromCache always undefined.
2026-10-06 11:11:27 +11:00
litruv fabbbc40af Skip sourcemap generation in CI builds
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-10-06 08:04:04 +11:00
litruv 72c71bc789 Add 4.11.193 update notes for the shared profile cache.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Move the Discord collectibles entry into the older list, and list 4.11.177 there too - its document was bundled but never referenced by the manifest.
2026-10-06 07:49:42 +11:00
litruv 9b657e3ab4 Cache profile fields and assets behind one shared store.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Colour, banner, collectibles, and profile each read the same extended
profile endpoint through separate caches with mismatched TTLs, so a
single profile view fired three round trips. They now read through one
cache with a shared TTL and in-flight dedupe, and profile media is kept
as blob URLs instead of being re-downloaded per mount.

useUserProfile now prefers the SDK's sync-cached user and only fetches
when both the SDK and the cache are cold.
2026-10-06 07:42:47 +11:00
litruv f2caef5592 Open the last seen channel on startup.
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-10-06 00:37:57 +11:00
litruv 47979718eb Fix responsive message images
Trigger cinny-mobile / dispatch (push) Successful in 2s
Constrain image attachments to their parent while preserving their aspect ratio.
2026-08-25 00:02:45 +10:00
litruv 862307ee7d Add TikTok player iframe
Trigger cinny-mobile / dispatch (push) Successful in 2s
Use TikTok's supported player endpoint rather than injecting its oEmbed script.
2026-08-24 23:58:31 +10:00
litruv b16263b481 Enable native HTTP for Capacitor.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Route mobile fetch requests through Capacitor's native network bridge to support redirected collectible catalog downloads.
2026-08-24 20:06:27 +10:00
litruv c34cfaf33f Enable collectibles on mobile clients.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Fetch and cache the published catalog in the renderer when Electron is unavailable, then download selected CDN assets directly for Matrix upload.
2026-08-24 19:52:50 +10:00
litruv 87c9f59826 Use public Discord collectibles catalog.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Remove local token setup in favor of the cached published catalog and document the collectible profile experience in the latest update notes.
2026-08-24 19:29:48 +10:00
litruv d59945eb4c Add configurable sidebar nameplate background.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Render the equipped nameplate behind the larger settings avatar with blur-aware sidebar controls, adjustable opacity, and immediate collectible cache invalidation.
2026-08-24 18:48:48 +10:00
litruv 0cbc5d9a1c Add Discord collectibles to profiles, messages, and settings.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Integrate profile effects, nameplates, and avatar decorations with live catalog browsing, Matrix profile storage, and rendering across user heroes, DMs, messages, and the sidebar avatar.
2026-08-24 00:54:48 +10:00
litruv 6cb1e14632 Fix What's New dialog layout and improve dev styling/debugging.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Portal the updates dialog to document.body with stable data attributes,
fix max-width (invalid S800 token), bundle update images for Capacitor,
and add readable vanilla-extract class names plus portalContainer tap fixes.
2026-08-23 16:54:59 +10:00
litruv 7d866404b3 Fix Android updates dialog, mobile About page, and user color crash guard.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Use stripBase for update static copy paths, show Settings detail on mobile
when nav is hidden, pause Settings focus trap during release notes, and guard
extractMemberColorPreference when room is not a Matrix Room instance.
2026-08-23 16:18:35 +10:00
litruv c264de53b5 Fix View updates on Android: bundled notes, portal stack, tap handling.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Bundle update markdown at build time for Capacitor, portal into
portalContainer above Settings, defer open to avoid FocusTrap closing
on the same tap, and disable click-outside dismiss.
2026-08-23 08:38:23 +10:00
litruv b6f3f5c0aa Move update manifest generator into cinny for standalone Android builds.
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-08-23 08:26:27 +10:00
litruv 25be638c5e Fix auto-show of What's New on first launch after an app update.
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-08-23 08:23:15 +10:00
litruv a20c871726 Fix updates dialog on Android by portaling above Settings and resolving Capacitor asset URLs.
Trigger cinny-mobile / dispatch (push) Successful in 2s
2026-08-23 08:19:51 +10:00
litruv e65a516350 Add MSC4522 username colors, release notes dialog, and profile layout fixes.
Trigger cinny-mobile / dispatch (push) Successful in 1s
Replace legacy profile style metadata with MSC4133 profile fields, add in-app update notes, tighten account profile name spacing, and wire desktop media save helpers through the client.
2026-08-23 08:06:48 +10:00
litruv 9887903f49 Add centralized saveMedia helpers for image, video, and file downloads.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Platforms can register a custom saver; viewers share one download/save path instead of FileSaver call sites.
2026-08-09 20:49:00 +10:00
litruv 898d217451 Make sick emoji confetti a fullscreen downward spew with morph.
Trigger cinny-mobile / dispatch (push) Successful in 1s
🤢 now fills the viewport, morphs to 🤮 while particles spawn, hides the jumbo stand-in cleanly, and keeps green droplets out of the face morph.
2026-08-09 18:35:12 +10:00
litruv e08b4ec22e Replace image lightbox with slate-style shadowbox.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Full-viewport blur backdrop, floating chrome, wheel/click/pinch zoom and pan; drop the ModalWide card shell around timeline and profile image viewers.
2026-08-09 15:58:47 +10:00
litruv 13523fea2b Add fullscreen firework emoji confetti and fix Linux URL paste.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Sparkle 🎆/🎇 from the jumbo emoji with a lightweight particle fountain that piles on the floor. Prefer text/plain over sticky clipboard images on Linux so address-bar URLs do not also attach a leftover bitmap.
2026-08-09 15:50:19 +10:00
litruv 8a68a1e30a Add bot-driven room app UI via im.paarrot.ui state.
Trigger cinny-mobile / dispatch (push) Successful in 2s
Bots can publish a declarative panel UI that takes over a room; user
actions are sent as im.paarrot.ui.action timeline events.
2026-08-09 13:16:43 +10:00
litruv 32bf2cbed5 Use ACTIONS_TOKEN secret to dispatch cinny-mobile builds.
Trigger cinny-mobile / dispatch (push) Successful in 1s
2026-08-03 16:30:50 +10:00
litruv 17706ae019 Add workflow to dispatch cinny-mobile submodule bump on push.
Trigger cinny-mobile / dispatch (push) Failing after 1s
2026-08-03 16:28:35 +10:00
litruv 82b22fa739 Add local API actions for recent messages and unreads by scope. 2026-08-03 15:08:18 +10:00
litruv 0da4f0d6cb Add emoji confetti bursts and component playground.
Support app.relay.emoji_confetti on jumbo emoji clicks with canvas physics,
per-emoji particle profiles, and a fixed overlay that does not affect scroll.
Also add a Vite playground for live component previews and theme hover preview.
2026-07-29 20:40:43 +10:00
litruv ea7642f0bb Surface OEM AUTO_START blocks in UnifiedPush settings status.
TCL App Boot can drop NEW_ENDPOINT; show a clear allow-auto-start hint when detected.
2026-07-28 02:39:35 +10:00
litruv 0fb3da20b9 Fail UnifiedPush reset when no endpoint arrives and surface lastFailure. 2026-07-28 01:38:01 +10:00
litruv e460dbd34e Improve UnifiedPush reset UX: poll for endpoint and clearer status. 2026-07-28 00:40:02 +10:00
litruv 0de2fd942f Prefer native UnifiedPush gateway discovery to avoid WebView CORS failures. 2026-07-28 00:18:28 +10:00
litruv 2603ca8e5c Fix avatar upload failing on JPEG/WebP/GIF without a profile color.
embedMetadataInImage returned null for non-PNG when there was nothing to embed, which blocked plain avatar saves after format/library churn.
2026-07-25 20:09:22 +10:00
litruv 99a294791e Open DMs during sync catch-up instead of blocking on parent maps.
Prefer the direct route for m.direct rooms and allow joined space children before roomToParents finishes backfilling.
2026-07-24 16:52:34 +10:00
litruv f62200ecd1 Fix Jump to Latest sticking visible while scrolled to the live bottom. 2026-07-24 16:00:59 +10:00
litruv b52926f7d8 Fix system notifications ignoring mention-only and default room settings.
Skip non-highlight events for Mentions/Default non-DM rooms so public chats stay quiet unless they should ping.
2026-07-24 00:30:25 +10:00
litruv d338e1c35e Show update progress as a title-bar bar instead of a popout. 2026-07-23 15:18:24 +10:00
litruv 9589680a81 Use paarrot://desktop SSO redirect so consent identifies the app. 2026-07-23 15:13:53 +10:00
litruv 27f1357fc0 Remove editor beforeinput autocorrect workaround. 2026-07-23 14:57:57 +10:00
litruv 9509a9705e Add Shared Media drawer and harden same-room navigation.
Widen the media panel, support skinny full-page mode, keep jump-to-latest and return-to-previous reliable, and stop same-room event jumps from remounting the outlet or yanking the sidebar.
2026-07-23 14:52:01 +10:00
litruv 61d41900cc Add Stationery and Stationery Dark themes with notebook chrome.
Manila folders, ruled chat, post-it nav, and folder tabs; dark variant uses Catppuccin Mocha colors with muted stickies and soft glows.
2026-07-23 00:24:10 +10:00
litruv e7777f42d8 Fix jumbo emoji detection broken by production minifier.
Replace surrogate-pair emoji regex with Unicode property escapes so Rolldown no longer corrupts matching in production builds.
2026-07-22 20:28:59 +10:00
litruv ae70eae0fc Fix jumbo emoji sizing in production builds.
Set jumbo font-size on the message body and inherit Text size so T400 no longer keeps emoji-only messages small.
2026-07-22 20:14:09 +10:00
litruv c286501be8 Improve timeline scroll, media layout, avatars, and emoji coverage.
Remember room scroll position across switches, reserve image/video heights from Matrix dimensions, cache authenticated media blobs for avatars, restore jumbo emoji-only messages, and extend emoji font unicode-range for Unicode 15 glyphs.
2026-07-22 20:00:14 +10:00
litruv 154f4dfdb0 fix: stop emoji fonts claiming spaces and Latin text
Use Fontsource's real family name ('Inter Variable') so text no longer
falls through to Noto Color Emoji / Twemoji. Scope emoji @font-face to
emoji unicode-range so space metrics stay normal on Linux and elsewhere.
2026-07-15 03:19:54 +10:00
litruv c7067021ba Fix white timestamps when Twemoji is selected
InterVariable did not match Fontsource's Inter Variable name, so digits
fell through to Twemoji COLR keycaps. Scope Twemoji off ASCII digits.
2026-07-13 02:40:03 +10:00
litruv 687f139719 Fix Slate crash after inserting emoji from picker/autocomplete 2026-07-13 02:40:02 +10:00
litruv b711646b58 Fix mic processing toggles after LiveKit voiceIsolation default 2026-07-13 02:25:04 +10:00
litruv bd6d753f47 update 2026-07-12 18:15:03 +10:00
litruv 3de3058ca9 Allow git deps in npm for Node/npm compatibility. 2026-07-12 08:18:57 +10:00
litruv 02d96a9758 hidden shit, and online status bars, search settings 2026-07-12 07:49:17 +10:00
litruv 5374c10c61 room shit 2026-07-10 21:35:38 +10:00
litruv 9c7f71896c fix: rework compact nav and centralized back routing
Use master-detail layout on skinny windows so server and channel lists share one screen, with back returning to the space list instead of redirect loops. Add useBackRoute for title-bar and page-header back buttons with view transitions.
2026-07-09 04:22:07 +10:00
litruv b4258278d8 fix: restore rooms and DMs after React Router 7 upgrade
Stop double-encoding Matrix IDs in pathUtils, decode route params on read, fix millify CJS import, and read space children from currentState so channels and joins work again.
2026-07-09 02:35:04 +10:00
litruv e058165830 feat: upgrade toolchain and soften sync recovery after network blips
Bump Vite 8, matrix-js-sdk, and related deps; fix immer/vanilla-extract imports for new majors. Replace blocking sync error dialog with background recovery on wake/offline, and disable Vite auto-open in dev. Add feature handoff documentation index.
2026-07-09 01:55:09 +10:00
litruv f67f08f1db feat: Enhance space hierarchy management by implementing asynchronous room fetching and improving room handling logic 2026-07-06 16:06:50 +10:00
litruv 3ee95a295d feat: Implement forum feed layout and refactor space navigation logic to support new routing structure 2026-07-06 15:35:21 +10:00
litruv 09db721b7e refactor: Consolidate icon imports across components and streamline import statements for improved readability 2026-07-06 03:29:18 +10:00
litruv 1f71fd7a51 feat: Update plugin manager integration with lucide-react icons and improve RoomInput component logic 2026-07-06 01:30:25 +10:00
litruv c57797ffe4 feat: Integrate forum layout support across various components and enhance room handling logic 2026-07-06 01:06:20 +10:00
litruv d1626e3585 feat: Enhance protocol status handling and repair functionality in About and SSOLogin components 2026-05-25 01:01:05 +10:00
litruv a4a0fa6758 feat: Add protocol status handling and repair functionality in About component 2026-05-25 00:34:13 +10:00
litruv 8de528da9a fix: Improve drag threshold handling in useInertialHorizontalScroll hook 2026-05-17 17:07:49 +10:00
litruv ba31d65568 feat: Refactor Android share handling to dynamically load Capacitor core and improve plugin registration 2026-05-17 16:53:40 +10:00
litruv c2fc71ddca feat: Refactor background sync to dynamically load Capacitor core and register plugin 2026-05-17 16:51:39 +10:00
litruv 40dc552c8d fix: Update import statement for Capacitor local notifications module ID 2026-05-17 16:48:34 +10:00
litruv 62876edd77 feat: Add carousel functionality with scrolling and image handling in RoomTimeline 2026-05-17 16:46:31 +10:00
litruv 9b81530012 feat: Lazy-load Capacitor local notifications to optimize runtime loading 2026-05-17 16:42:46 +10:00
litruv af02b215f4 feat: Implement inertial horizontal scrolling for carousel components and enhance text selection handling 2026-05-17 16:42:46 +10:00
744 changed files with 53667 additions and 19329 deletions
-72
View File
@@ -1,72 +0,0 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
'airbnb',
'prettier',
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
"globals": {
JSX: "readonly"
},
plugins: [
'react',
'@typescript-eslint'
],
rules: {
'linebreak-style': 0,
'no-underscore-dangle': 0,
"no-shadow": "off",
"import/prefer-default-export": "off",
"import/extensions": "off",
"import/no-unresolved": "off",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: true,
},
],
'react/no-unstable-nested-components': [
'error',
{ allowAsProps: true },
],
"react/jsx-filename-extension": [
"error",
{
extensions: [".tsx", ".jsx"],
},
],
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-shadow": "error"
},
overrides: [
{
files: ['*.ts'],
rules: {
'no-undef': 'off',
},
},
],
};
+45
View File
@@ -0,0 +1,45 @@
name: Checks
on:
push:
branches:
- main
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci --prefer-offline
# ci-checks.sh always exits 0: findings become issues, not failed builds.
- name: Run checks
env:
API_BASE: ${{ github.server_url }}/api/v1
# github.server_url is the internal runner host, so the commit link needs the public one.
WEB_BASE: https://git.ruv.wtf
REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
# Prefer a PAT with issue write scope (secret: GITEA_TOKEN).
# Default GITHUB_TOKEN is usually scoped to this repo only.
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TOKEN="${GITEA_TOKEN:-${GITHUB_TOKEN:-}}"
if [ -z "$TOKEN" ]; then
echo "No GITEA_TOKEN/GITHUB_TOKEN available to file issues"
exit 0
fi
export TOKEN
bash scripts/ci-checks.sh
+53
View File
@@ -0,0 +1,53 @@
name: Trigger cinny-mobile
on:
push:
branches:
- main
jobs:
dispatch:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message || '', '[skip mobile]') }}
steps:
- name: Dispatch update-submodule on cinny-mobile
env:
# Prefer a PAT with write:repository on cinny-mobile (secret: ACTIONS_TOKEN).
# Default GITHUB_TOKEN is usually scoped to this repo only.
ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_BASE: ${{ github.server_url }}/api/v1
CINNY_SHA: ${{ github.sha }}
run: |
set -euo pipefail
TOKEN="${ACTIONS_TOKEN:-${GITHUB_TOKEN:-}}"
if [ -z "${TOKEN}" ]; then
echo "No ACTIONS_TOKEN/GITHUB_TOKEN available to dispatch cinny-mobile"
exit 1
fi
BODY=$(jq -n \
--arg ref "master" \
--arg sha "${CINNY_SHA}" \
'{ref: $ref, inputs: {cinny_sha: $sha}}')
echo "Dispatching litruv/cinny-mobile update-submodule.yml for ${CINNY_SHA}"
HTTP_CODE=$(curl -sS -o /tmp/dispatch-body.txt -w "%{http_code}" \
-X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \
-d "${BODY}" \
"${API_BASE}/repos/litruv/cinny-mobile/actions/workflows/update-submodule.yml/dispatches?return_run_details=true")
echo "HTTP ${HTTP_CODE}"
cat /tmp/dispatch-body.txt || true
echo
case "${HTTP_CODE}" in
200|201|204) echo "Dispatch accepted" ;;
*)
echo "Dispatch failed"
exit 1
;;
esac
+5 -1
View File
@@ -4,4 +4,8 @@ node_modules
devAssets devAssets
.DS_Store .DS_Store
.idea .idea
.cache
# Vite build artifacts
vite.config.js.timestamp-*
+2 -1
View File
@@ -1,2 +1,3 @@
legacy-peer-deps=true legacy-peer-deps=true
save-exact=true save-exact=true
allow-git=all
+11 -11
View File
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our Examples of behavior that contributes to a positive environment for our
community include: community include:
* Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, - Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience and learning from the experience
* Focusing on what is best not just for us as individuals, but for the - Focusing on what is best not just for us as individuals, but for the
overall community overall community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or - The use of sexualized language or imagery, and sexual attention or
advances of any kind advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or email - Publishing others' private information, such as a physical or email
address, without their explicit permission address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a - Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban ### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community **Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals. individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within **Consequence**: A permanent ban from any sort of public interaction within
+3
View File
@@ -7,6 +7,9 @@
"LocalNotifications": { "LocalNotifications": {
"smallIcon": "ic_stat_paarrot", "smallIcon": "ic_stat_paarrot",
"iconColor": "#FF8A00" "iconColor": "#FF8A00"
},
"CapacitorHttp": {
"enabled": true
} }
} }
} }
+3 -22
View File
@@ -9,30 +9,11 @@
"xmr.se" "xmr.se"
], ],
"allowCustomHomeservers": true, "allowCustomHomeservers": true,
"calling": {
"livekitServiceUrl": "https://b.ruv.wtf/matrix-rtc/livekit/jwt"
},
"featuredCommunities": { "featuredCommunities": {
"openAsDefault": false, "openAsDefault": false,
"spaces": [ "spaces": [],
"#cinny-space:matrix.org", "rooms": [],
"#community:matrix.org", "servers": []
"#space:envs.net",
"#science-space:matrix.org",
"#libregaming-games:tchncs.de",
"#mathematics-on:matrix.org"
],
"rooms": [
"#cinny:matrix.org",
"#freesoftware:matrix.org",
"#pcapdroid:matrix.org",
"#gentoo:matrix.org",
"#PrivSec.dev:arcticfoxes.net",
"#disroot:aria-net.org"
],
"servers": ["envs.net", "matrix.org", "monero.social", "mozilla.org"]
}, },
"hashRouter": { "hashRouter": {
+30 -10
View File
@@ -11,6 +11,7 @@ The API server starts automatically when you run Paarrot. It listens on `http://
**Option 1: Using Postman** **Option 1: Using Postman**
Import the Postman collection for easy testing: Import the Postman collection for easy testing:
1. Open Postman 1. Open Postman
2. Click **Import** → **File** 2. Click **Import** → **File**
3. Select `paarrot-api.postman_collection.json` 3. Select `paarrot-api.postman_collection.json`
@@ -19,16 +20,19 @@ Import the Postman collection for easy testing:
The collection is automatically updated on git push. The collection is automatically updated on git push.
**Option 2: Using the test script** **Option 2: Using the test script**
```bash ```bash
node test-api.js node test-api.js
``` ```
**Option 3: Using curl** **Option 3: Using curl**
```bash ```bash
./test-api.sh ./test-api.sh
``` ```
**Option 4: Manual curl commands** **Option 4: Manual curl commands**
```bash ```bash
# Health check # Health check
curl http://127.0.0.1:33384/health curl http://127.0.0.1:33384/health
@@ -46,15 +50,22 @@ curl -X POST http://127.0.0.1:33384/message/current \
### Common Endpoints ### Common Endpoints
| Endpoint | Method | Description | | Endpoint | Method | Description |
|----------|--------|-------------| | -------------------- | ------ | ------------------------------------------------- |
| `/health` | GET | Check if API is running | | `/health` | GET | Check if API is running |
| `/status` | GET | Get app status (mute, deafen, etc.) | | `/status` | GET | Get app status (mute, deafen, etc.) |
| `/mute/toggle` | POST | Toggle microphone mute | | `/mute/toggle` | POST | Toggle microphone mute |
| `/deafen/toggle` | POST | Toggle deafen | | `/deafen/toggle` | POST | Toggle deafen |
| `/channels` | GET | Get list of rooms | | `/channels` | GET | Get list of rooms |
| `/channel` | POST | Switch to a room | | `/channel` | POST | Switch to a room |
| `/message/current` | POST | Send message to current room | | `/message/current` | POST | Send message to current room |
| `/room/current` | GET | Get current room info |
| `/messages/groups` | GET | Last N messages across groups (`?limit=10`) |
| `/messages/dms` | GET | Last N messages across DMs (`?limit=10`) |
| `/messages/combined` | GET | Last N messages across groups + DMs (`?limit=10`) |
| `/unreads/groups` | GET | Unread group conversations |
| `/unreads/dms` | GET | Unread DM conversations |
| `/unreads/combined` | GET | Unread groups + DMs |
## 🎮 Stream Deck Integration ## 🎮 Stream Deck Integration
@@ -62,10 +73,12 @@ curl -X POST http://127.0.0.1:33384/message/current \
2. Create buttons with these settings: 2. Create buttons with these settings:
**Mute Toggle Button:** **Mute Toggle Button:**
- URL: `http://127.0.0.1:33384/mute/toggle` - URL: `http://127.0.0.1:33384/mute/toggle`
- Method: POST - Method: POST
**Quick Message Button:** **Quick Message Button:**
- URL: `http://127.0.0.1:33384/message/current` - URL: `http://127.0.0.1:33384/message/current`
- Method: POST - Method: POST
- Body: `{"message": "BRB!"}` - Body: `{"message": "BRB!"}`
@@ -75,6 +88,7 @@ curl -X POST http://127.0.0.1:33384/message/current \
To enable full functionality, you need to implement the action handlers in the Cinny frontend: To enable full functionality, you need to implement the action handlers in the Cinny frontend:
1. Import the API handler in your app initialization: 1. Import the API handler in your app initialization:
```typescript ```typescript
import { initPaarrotAPI } from './app/paarrot-api'; import { initPaarrotAPI } from './app/paarrot-api';
@@ -91,6 +105,7 @@ initPaarrotAPI(matrixClient);
## 📖 Full Documentation ## 📖 Full Documentation
See [API.md](API.md) for complete API documentation including: See [API.md](API.md) for complete API documentation including:
- All available endpoints - All available endpoints
- Request/response formats - Request/response formats
- Error handling - Error handling
@@ -100,6 +115,7 @@ See [API.md](API.md) for complete API documentation including:
## 🛠️ Configuration ## 🛠️ Configuration
Edit `electron/api-server.js` to customize: Edit `electron/api-server.js` to customize:
- Port number (default: 33384) - Port number (default: 33384)
- Timeout duration (default: 10s) - Timeout duration (default: 10s)
- CORS settings - CORS settings
@@ -107,11 +123,13 @@ Edit `electron/api-server.js` to customize:
## 🐛 Troubleshooting ## 🐛 Troubleshooting
**API not responding:** **API not responding:**
1. Check if Paarrot is running 1. Check if Paarrot is running
2. Look for "Paarrot API server listening" in console logs 2. Look for "Paarrot API server listening" in console logs
3. Verify port 33384 is not in use: `lsof -i :33384` 3. Verify port 33384 is not in use: `lsof -i :33384`
**Actions not working:** **Actions not working:**
1. Check browser console for errors 1. Check browser console for errors
2. Ensure `initPaarrotAPI()` is called in your app 2. Ensure `initPaarrotAPI()` is called in your app
3. Implement the TODO items in `paarrot-api.ts` 3. Implement the TODO items in `paarrot-api.ts`
@@ -137,6 +155,7 @@ Edit `electron/api-server.js` and change the port number in the constructor.
## 💡 Examples ## 💡 Examples
**Python Script:** **Python Script:**
```python ```python
import requests import requests
@@ -148,12 +167,13 @@ toggle_mute()
``` ```
**JavaScript:** **JavaScript:**
```javascript ```javascript
async function sendQuickMessage(msg) { async function sendQuickMessage(msg) {
const res = await fetch('http://127.0.0.1:33384/message/current', { const res = await fetch('http://127.0.0.1:33384/message/current', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message: msg }) body: JSON.stringify({ message: msg }),
}); });
return res.json(); return res.json();
} }
+222 -78
View File
@@ -22,6 +22,7 @@ Check if the API server is running.
**Endpoint**: `GET /health` **Endpoint**: `GET /health`
**Response**: **Response**:
```json ```json
{ {
"status": "ok", "status": "ok",
@@ -39,6 +40,7 @@ Get the current status of the app (mute, deafen, current room, etc.).
**Endpoint**: `GET /status` **Endpoint**: `GET /status`
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -60,6 +62,7 @@ Set the mute status.
**Endpoint**: `POST /mute` **Endpoint**: `POST /mute`
**Request Body**: **Request Body**:
```json ```json
{ {
"muted": true "muted": true
@@ -67,6 +70,7 @@ Set the mute status.
``` ```
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -85,6 +89,7 @@ Toggle the current mute status.
**Endpoint**: `POST /mute/toggle` **Endpoint**: `POST /mute/toggle`
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -103,6 +108,7 @@ Set the deafen status (deafening also mutes).
**Endpoint**: `POST /deafen` **Endpoint**: `POST /deafen`
**Request Body**: **Request Body**:
```json ```json
{ {
"deafened": true "deafened": true
@@ -110,6 +116,7 @@ Set the deafen status (deafening also mutes).
``` ```
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -128,6 +135,7 @@ Toggle the current deafen status.
**Endpoint**: `POST /deafen/toggle` **Endpoint**: `POST /deafen/toggle`
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -146,6 +154,7 @@ Switch to a different Matrix room.
**Endpoint**: `POST /channel` **Endpoint**: `POST /channel`
**Request Body**: **Request Body**:
```json ```json
{ {
"roomId": "!abc123:matrix.org" "roomId": "!abc123:matrix.org"
@@ -153,6 +162,7 @@ Switch to a different Matrix room.
``` ```
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -172,6 +182,7 @@ Get a list of available rooms/channels.
**Endpoint**: `GET /channels` **Endpoint**: `GET /channels`
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -212,6 +223,7 @@ Send a message to a specific room.
**Endpoint**: `POST /message` **Endpoint**: `POST /message`
**Request Body**: **Request Body**:
```json ```json
{ {
"roomId": "!abc123:matrix.org", "roomId": "!abc123:matrix.org",
@@ -220,6 +232,7 @@ Send a message to a specific room.
``` ```
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -239,6 +252,7 @@ Send a message to the currently active room.
**Endpoint**: `POST /message/current` **Endpoint**: `POST /message/current`
**Request Body**: **Request Body**:
```json ```json
{ {
"message": "Hello from the API!" "message": "Hello from the API!"
@@ -246,6 +260,7 @@ Send a message to the currently active room.
``` ```
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -265,6 +280,7 @@ Get information about the currently active room.
**Endpoint**: `GET /room/current` **Endpoint**: `GET /room/current`
**Response**: **Response**:
```json ```json
{ {
"success": true, "success": true,
@@ -280,6 +296,128 @@ Get information about the currently active room.
--- ---
### Get Recent Messages (Groups)
Get the most recent messages across joined group channels (non-DMs).
**Endpoint**: `GET /messages/groups`
**Query Parameters**:
- `limit` (optional) — number of messages to return (1–100, default `10`)
**Response**:
```json
{
"success": true,
"data": {
"scope": "groups",
"limit": 10,
"count": 2,
"messages": [
{
"eventId": "$event1",
"roomId": "!abc123:matrix.org",
"roomName": "General",
"isDirect": false,
"sender": "@alice:matrix.org",
"senderName": "Alice",
"timestamp": 1710000000000,
"msgtype": "m.text",
"body": "Hello!"
}
]
}
}
```
---
### Get Recent Messages (DMs)
Get the most recent messages across joined direct messages.
**Endpoint**: `GET /messages/dms`
**Query Parameters**:
- `limit` (optional) — number of messages to return (1–100, default `10`)
**Response**: same shape as groups, with `"scope": "dms"`.
---
### Get Recent Messages (Combined)
Get the most recent messages across groups and DMs together.
**Endpoint**: `GET /messages/combined`
**Query Parameters**:
- `limit` (optional) — number of messages to return (1–100, default `10`)
**Response**: same shape as groups, with `"scope": "combined"`.
---
### Get Unread Conversations (Groups)
List joined group channels that currently have unread activity.
**Endpoint**: `GET /unreads/groups`
**Response**:
```json
{
"success": true,
"data": {
"scope": "groups",
"count": 1,
"unreads": [
{
"roomId": "!abc123:matrix.org",
"name": "General",
"isDirect": false,
"avatar": "mxc://matrix.org/abc123",
"total": 3,
"highlight": 1,
"latest": {
"eventId": "$event1",
"sender": "@alice:matrix.org",
"senderName": "Alice",
"timestamp": 1710000000000,
"msgtype": "m.text",
"body": "Hello!"
}
}
]
}
}
```
Muted rooms are excluded. Sorted by latest activity, then highlight/total counts.
---
### Get Unread Conversations (DMs)
**Endpoint**: `GET /unreads/dms`
**Response**: same shape as groups, with `"scope": "dms"`.
---
### Get Unread Conversations (Combined)
**Endpoint**: `GET /unreads/combined`
**Response**: same shape as groups, with `"scope": "combined"`.
---
## Error Responses ## Error Responses
All endpoints return error responses in the following format: All endpoints return error responses in the following format:
@@ -292,6 +430,7 @@ All endpoints return error responses in the following format:
``` ```
Common HTTP status codes: Common HTTP status codes:
- `200 OK` - Request successful - `200 OK` - Request successful
- `400 Bad Request` - Missing or invalid parameters - `400 Bad Request` - Missing or invalid parameters
- `404 Not Found` - Endpoint not found - `404 Not Found` - Endpoint not found
@@ -326,7 +465,7 @@ const fetch = require('node-fetch');
// Toggle mute // Toggle mute
async function toggleMute() { async function toggleMute() {
const response = await fetch('http://127.0.0.1:33384/mute/toggle', { const response = await fetch('http://127.0.0.1:33384/mute/toggle', {
method: 'POST' method: 'POST',
}); });
const data = await response.json(); const data = await response.json();
console.log('Muted:', data.data.muted); console.log('Muted:', data.data.muted);
@@ -337,9 +476,9 @@ async function sendMessage(roomId, message) {
const response = await fetch('http://127.0.0.1:33384/message', { const response = await fetch('http://127.0.0.1:33384/message', {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json',
}, },
body: JSON.stringify({ roomId, message }) body: JSON.stringify({ roomId, message }),
}); });
const data = await response.json(); const data = await response.json();
console.log('Message sent:', data.data.eventId); console.log('Message sent:', data.data.eventId);
@@ -382,14 +521,17 @@ To integrate with Stream Deck:
Example configurations: Example configurations:
**Mute Toggle Button**: **Mute Toggle Button**:
- URL: `http://127.0.0.1:33384/mute/toggle` - URL: `http://127.0.0.1:33384/mute/toggle`
- Method: POST - Method: POST
**Deafen Toggle Button**: **Deafen Toggle Button**:
- URL: `http://127.0.0.1:33384/deafen/toggle` - URL: `http://127.0.0.1:33384/deafen/toggle`
- Method: POST - Method: POST
**Send Quick Message**: **Send Quick Message**:
- URL: `http://127.0.0.1:33384/message/current` - URL: `http://127.0.0.1:33384/message/current`
- Method: POST - Method: POST
- Body: `{"message": "BRB!"}` - Body: `{"message": "BRB!"}`
@@ -407,82 +549,80 @@ Add this to your app initialization:
```typescript ```typescript
// Listen for API actions from the Electron API server // Listen for API actions from the Electron API server
if (window.electron?.api?.onAction) { if (window.electron?.api?.onAction) {
window.electron.api.onAction(async (action: { window.electron.api.onAction(
action: string; async (action: { action: string; params: any; responseChannel: string }) => {
params: any; try {
responseChannel: string; let result;
}) => {
try { switch (action.action) {
let result; case 'toggle-mute':
// Toggle microphone mute
switch (action.action) { result = await toggleMicrophone();
case 'toggle-mute': break;
// Toggle microphone mute
result = await toggleMicrophone(); case 'set-mute':
break; // Set microphone mute state
result = await setMicrophone(action.params.muted);
case 'set-mute': break;
// Set microphone mute state
result = await setMicrophone(action.params.muted); case 'toggle-deafen':
break; // Toggle deafen (mute speakers)
result = await toggleDeafen();
case 'toggle-deafen': break;
// Toggle deafen (mute speakers)
result = await toggleDeafen(); case 'set-deafen':
break; // Set deafen state
result = await setDeafen(action.params.deafened);
case 'set-deafen': break;
// Set deafen state
result = await setDeafen(action.params.deafened); case 'change-channel':
break; // Navigate to a different room
result = await changeRoom(action.params.roomId);
case 'change-channel': break;
// Navigate to a different room
result = await changeRoom(action.params.roomId); case 'get-channels':
break; // Get list of rooms
result = await getRoomList();
case 'get-channels': break;
// Get list of rooms
result = await getRoomList(); case 'send-message':
break; // Send message to specific room
result = await sendMessage(action.params.roomId, action.params.message);
case 'send-message': break;
// Send message to specific room
result = await sendMessage(action.params.roomId, action.params.message); case 'send-message-current':
break; // Send message to current room
result = await sendMessageToCurrent(action.params.message);
case 'send-message-current': break;
// Send message to current room
result = await sendMessageToCurrent(action.params.message); case 'get-current-room':
break; // Get current room info
result = await getCurrentRoomInfo();
case 'get-current-room': break;
// Get current room info
result = await getCurrentRoomInfo(); case 'get-status':
break; // Get current app status
result = await getAppStatus();
case 'get-status': break;
// Get current app status
result = await getAppStatus(); default:
break; throw new Error(`Unknown action: ${action.action}`);
}
default:
throw new Error(`Unknown action: ${action.action}`); // Send success response back
window.electron.api.sendResponse(action.responseChannel, {
success: true,
data: result,
});
} catch (error) {
// Send error response back
window.electron.api.sendResponse(action.responseChannel, {
success: false,
error: error.message,
});
} }
},
// Send success response back );
window.electron.api.sendResponse(action.responseChannel, {
success: true,
data: result
});
} catch (error) {
// Send error response back
window.electron.api.sendResponse(action.responseChannel, {
success: false,
error: error.message
});
}
});
} }
``` ```
@@ -510,16 +650,19 @@ The API server can be configured by modifying `electron/api-server.js`:
## Troubleshooting ## Troubleshooting
**API server not starting**: **API server not starting**:
- Check if port 33384 is already in use - Check if port 33384 is already in use
- Check console logs for errors - Check console logs for errors
- Verify Express is installed: `npm install express cors body-parser` - Verify Express is installed: `npm install express cors body-parser`
**Actions not working**: **Actions not working**:
- Ensure the client-side handler is implemented - Ensure the client-side handler is implemented
- Check browser console for errors - Check browser console for errors
- Verify the action names match between API server and client - Verify the action names match between API server and client
**Timeout errors**: **Timeout errors**:
- Actions must respond within 10 seconds - Actions must respond within 10 seconds
- Check if the Matrix client is initialized - Check if the Matrix client is initialized
- Verify the action handler is registered - Verify the action handler is registered
@@ -529,6 +672,7 @@ The API server can be configured by modifying `electron/api-server.js`:
## Future Enhancements ## Future Enhancements
Potential features to add: Potential features to add:
- WebSocket support for real-time events - WebSocket support for real-time events
- Authentication with API keys - Authentication with API keys
- Voice channel controls (join/leave) - Voice channel controls (join/leave)
+6 -1
View File
@@ -5,6 +5,7 @@ The Paarrot desktop client includes a powerful plugin system that allows you to
## What are Plugins? ## What are Plugins?
Plugins are small JavaScript modules that run inside Paarrot and can: Plugins are small JavaScript modules that run inside Paarrot and can:
- Add custom commands - Add custom commands
- Modify the UI - Modify the UI
- React to Matrix events - React to Matrix events
@@ -53,6 +54,7 @@ Use the search bar to filter plugins by name, description, author, or tags.
⚠️ **Important Security Information** ⚠️ **Important Security Information**
Plugins run with access to your Matrix client and can: Plugins run with access to your Matrix client and can:
- Read your messages - Read your messages
- Send messages on your behalf - Send messages on your behalf
- Access your room list - Access your room list
@@ -79,6 +81,7 @@ Want to create your own plugin? Check out the [Plugin API Reference](docs/PLUGIN
- `plugin-metadata.json` - Plugin information - `plugin-metadata.json` - Plugin information
2. Implement the plugin interface: 2. Implement the plugin interface:
```javascript ```javascript
module.exports = { module.exports = {
onLoad: async (context) => { onLoad: async (context) => {
@@ -87,7 +90,7 @@ module.exports = {
}, },
onUnload: async () => { onUnload: async () => {
// Cleanup when disabled // Cleanup when disabled
} },
}; };
``` ```
@@ -98,6 +101,7 @@ module.exports = {
## Plugin API ## Plugin API
Plugins have access to: Plugins have access to:
- **Matrix Client**: Full matrix-js-sdk client instance - **Matrix Client**: Full matrix-js-sdk client instance
- **React**: For building UI components - **React**: For building UI components
- **Commands**: Register custom slash commands - **Commands**: Register custom slash commands
@@ -134,6 +138,7 @@ Check out the `example-plugin/` directory for a simple example, or the `plugins/
### Performance Issues ### Performance Issues
If Paarrot becomes slow: If Paarrot becomes slow:
1. Disable plugins one by one to identify the culprit 1. Disable plugins one by one to identify the culprit
2. Check for memory leaks in the console 2. Check for memory leaks in the console
3. Contact the plugin author with details 3. Contact the plugin author with details
+234 -210
View File
@@ -27,6 +27,7 @@ Complete reference for developing plugins for Paarrot/Cinny Desktop.
### Plugin Location ### Plugin Location
Plugins are installed in: Plugins are installed in:
- **Windows**: `%APPDATA%\paarrot\plugins\<plugin-name>\` - **Windows**: `%APPDATA%\paarrot\plugins\<plugin-name>\`
- **Linux**: `~/.config/Paarrot/plugins/<plugin-name>/` - **Linux**: `~/.config/Paarrot/plugins/<plugin-name>/`
- **macOS**: `~/Library/Application Support/Paarrot/plugins/<plugin-name>/` - **macOS**: `~/Library/Application Support/Paarrot/plugins/<plugin-name>/`
@@ -59,38 +60,38 @@ Plugins are installed in:
```javascript ```javascript
module.exports = { module.exports = {
name: "My Plugin", name: 'My Plugin',
version: "1.0.0", version: '1.0.0',
dependencies: { dependencies: {
// "other-plugin": "^1.0.0" // "other-plugin": "^1.0.0"
}, },
/** /**
* Called when plugin loads * Called when plugin loads
* @param {PluginContext} ctx - Plugin context * @param {PluginContext} ctx - Plugin context
*/ */
onLoad: async (ctx) => { onLoad: async (ctx) => {
ctx.log('Plugin loaded!'); ctx.log('Plugin loaded!');
// Initialize your plugin here // Initialize your plugin here
ctx.commands.register({ ctx.commands.register({
name: "hello", name: 'hello',
description: "Say hello", description: 'Say hello',
run: () => "Hello, world!" run: () => 'Hello, world!',
}); });
}, },
/** /**
* Called when plugin unloads * Called when plugin unloads
*/ */
onUnload: async () => { onUnload: async () => {
console.log('Plugin unloaded'); console.log('Plugin unloaded');
}, },
/** /**
* API for other plugins * API for other plugins
*/ */
exports: null exports: null,
}; };
``` ```
@@ -105,7 +106,8 @@ interface PluginContext {
pluginId: string; pluginId: string;
matrixClient: MatrixClient; matrixClient: MatrixClient;
React: typeof import('react'); React: typeof import('react');
lucide: typeof import('lucide-react');
commands: CommandsAPI; commands: CommandsAPI;
messages: MessagesAPI; messages: MessagesAPI;
ui: UIAPI; ui: UIAPI;
@@ -128,54 +130,57 @@ Register slash commands that users can type in chat.
```javascript ```javascript
ctx.commands.register({ ctx.commands.register({
name: "mycommand", name: 'mycommand',
description: "Does something cool", description: 'Does something cool',
args: ["arg1", "arg2"], // Optional args: ['arg1', 'arg2'], // Optional
run: (args) => { run: (args) => {
// Return string to send as message // Return string to send as message
return `Got args: ${args.arg1}, ${args.arg2}`; return `Got args: ${args.arg1}, ${args.arg2}`;
} },
}); });
``` ```
#### Examples #### Examples
**Simple command:** **Simple command:**
```javascript ```javascript
ctx.commands.register({ ctx.commands.register({
name: "shrug", name: 'shrug',
description: "Send a shrug emoji", description: 'Send a shrug emoji',
run: () => "¯\\_(ツ)_/¯" run: () => '¯\\_(ツ)_/¯',
}); });
// Usage: /shrug // Usage: /shrug
``` ```
**Command with arguments:** **Command with arguments:**
```javascript ```javascript
ctx.commands.register({ ctx.commands.register({
name: "greet", name: 'greet',
description: "Greet someone", description: 'Greet someone',
args: ["name"], args: ['name'],
run: ({ name }) => `Hello, ${name || 'stranger'}!` run: ({ name }) => `Hello, ${name || 'stranger'}!`,
}); });
// Usage: /greet Alice // Usage: /greet Alice
``` ```
**Advanced command:** **Advanced command:**
```javascript ```javascript
ctx.commands.register({ ctx.commands.register({
name: "calc", name: 'calc',
description: "Simple calculator", description: 'Simple calculator',
args: ["expression"], args: ['expression'],
run: ({ expression }) => { run: ({ expression }) => {
try { try {
const sanitized = expression.replace(/[^0-9+\-*/().\s]/g, ''); const sanitized = expression.replace(/[^0-9+\-*/().\s]/g, '');
const result = Function(`'use strict'; return (${sanitized})`)(); const result = Function(`'use strict'; return (${sanitized})`)();
return `${expression} = ${result}`; return `${expression} = ${result}`;
} catch (err) { } catch (err) {
return "Invalid expression"; return 'Invalid expression';
} }
} },
}); });
// Usage: /calc 2 + 2 * 3 // Usage: /calc 2 + 2 * 3
``` ```
@@ -213,7 +218,7 @@ ctx.messages.onBeforeSend((msg) => {
if (msg.content.includes('secret')) { if (msg.content.includes('secret')) {
msg.content = msg.content.replace(/secret/g, '█████'); msg.content = msg.content.replace(/secret/g, '█████');
} }
// Add prefix // Add prefix
msg.content = `[Bot] ${msg.content}`; msg.content = `[Bot] ${msg.content}`;
}); });
@@ -230,7 +235,7 @@ ctx.messages.onReceive((msg) => {
ctx.notify({ ctx.notify({
title: 'Important Message', title: 'Important Message',
body: msg.content, body: msg.content,
type: 'info' type: 'info',
}); });
} }
}); });
@@ -239,15 +244,16 @@ ctx.messages.onReceive((msg) => {
#### Real-World Examples #### Real-World Examples
**Auto-expand abbreviations:** **Auto-expand abbreviations:**
```javascript ```javascript
ctx.messages.onBeforeSend((msg) => { ctx.messages.onBeforeSend((msg) => {
const expansions = { const expansions = {
'brb': 'be right back', brb: 'be right back',
'omw': 'on my way', omw: 'on my way',
'gtg': 'got to go', gtg: 'got to go',
'afk': 'away from keyboard' afk: 'away from keyboard',
}; };
Object.entries(expansions).forEach(([abbr, full]) => { Object.entries(expansions).forEach(([abbr, full]) => {
const regex = new RegExp(`\\b${abbr}\\b`, 'gi'); const regex = new RegExp(`\\b${abbr}\\b`, 'gi');
msg.content = msg.content.replace(regex, full); msg.content = msg.content.replace(regex, full);
@@ -256,6 +262,7 @@ ctx.messages.onBeforeSend((msg) => {
``` ```
**Add auto-shrug to questions:** **Add auto-shrug to questions:**
```javascript ```javascript
ctx.messages.onBeforeSend((msg) => { ctx.messages.onBeforeSend((msg) => {
if (msg.content.trim().endsWith('?')) { if (msg.content.trim().endsWith('?')) {
@@ -265,6 +272,7 @@ ctx.messages.onBeforeSend((msg) => {
``` ```
**Track mentions:** **Track mentions:**
```javascript ```javascript
ctx.messages.onReceive((msg) => { ctx.messages.onReceive((msg) => {
const userId = ctx.matrixClient.getUserId(); const userId = ctx.matrixClient.getUserId();
@@ -299,21 +307,25 @@ Register custom UI renderers for messages, images, and other content types.
```javascript ```javascript
// Custom message renderer // Custom message renderer
ctx.ui.registerRenderer("message", (msg, defaultRenderer) => { ctx.ui.registerRenderer('message', (msg, defaultRenderer) => {
// Custom logic // Custom logic
if (msg.sender?.includes('bot')) { if (msg.sender?.includes('bot')) {
// Return custom React component // Return custom React component
return ctx.React.createElement('div', { return ctx.React.createElement(
style: { background: 'yellow' } 'div',
}, msg.content); {
style: { background: 'yellow' },
},
msg.content,
);
} }
// Fall back to default // Fall back to default
return defaultRenderer?.(); return defaultRenderer?.();
}); });
// Custom image renderer // Custom image renderer
ctx.ui.registerRenderer("image", (data, defaultRenderer) => { ctx.ui.registerRenderer('image', (data, defaultRenderer) => {
// Add custom effects, borders, etc. // Add custom effects, borders, etc.
return defaultRenderer?.(); return defaultRenderer?.();
}); });
@@ -327,14 +339,11 @@ interface UIAPI {
unregisterButton(id: string): void; unregisterButton(id: string): void;
registerRenderer( registerRenderer(
type: string, type: string,
renderer: (data: any, defaultRenderer?: () => ReactNode) => ReactNode renderer: (data: any, defaultRenderer?: () => ReactNode) => ReactNode,
): void; ): void;
} }
type CustomRenderer = ( type CustomRenderer = (data: any, defaultRenderer?: () => ReactNode) => ReactNode;
data: any,
defaultRenderer?: () => ReactNode
) => ReactNode;
``` ```
--- ---
@@ -353,30 +362,30 @@ ctx.ui.registerButton({
location: 'text-composer-toolbar', location: 'text-composer-toolbar',
label: 'My Tool', label: 'My Tool',
icon: '🔧', icon: '🔧',
onClick: () => ctx.log('clicked!') onClick: () => ctx.log('clicked!'),
}); });
``` ```
#### UI Locations — Nav List Rows #### UI Locations — Nav List Rows
| Location | Where it appears | | Location | Where it appears |
|---|---| | ----------------- | ----------------------------------------------------------- |
| `channel-list` | Space channel list, below Lobby and Message Search | | `channel-list` | Space channel list, below Lobby and Message Search |
| `home-section` | Home panel, inside the Rooms category above the room list | | `home-section` | Home panel, inside the Rooms category above the room list |
| `direct-messages` | DMs panel, below "Create Chat" and above the CHATS dropdown | | `direct-messages` | DMs panel, below "Create Chat" and above the CHATS dropdown |
#### UI Locations — Icon Buttons #### UI Locations — Icon Buttons
| Location | Where it appears | | Location | Where it appears |
|---|---| | ----------------------------- | --------------------------------------------------------------------------------------------- |
| `text-composer-toolbar` | Message composer toolbar (alongside emoji, sticker buttons) | | `text-composer-toolbar` | Message composer toolbar (alongside emoji, sticker buttons) |
| `composer-actions` | Left side of the composer, beside the `+` attach button | | `composer-actions` | Left side of the composer, beside the `+` attach button |
| `room-header` | Top room header bar, before the ⋮ menu | | `room-header` | Top room header bar, before the ⋮ menu |
| `room-menu` | Room ⋮ dropdown menu | | `room-menu` | Room ⋮ dropdown menu |
| `message-actions` | Message hover action bar | | `message-actions` | Message hover action bar |
| `user-menu` | Right-click popup on the user avatar | | `user-menu` | Right-click popup on the user avatar |
| `search-notification-section` | Notifications page header (right side) | | `search-notification-section` | Notifications page header (right side) |
| `sidebar-actions` | Left sidebar — above Explore Servers icon, and above Search icon in the sticky bottom section | | `sidebar-actions` | Left sidebar — above Explore Servers icon, and above Search icon in the sticky bottom section |
#### Positioning #### Positioning
@@ -389,9 +398,9 @@ ctx.ui.registerButton({
position: { position: {
after: 'emoji-picker-button', after: 'emoji-picker-button',
group: 'my-tools', group: 'my-tools',
order: 1 order: 1,
}, },
onClick: () => ctx.log('clicked!') onClick: () => ctx.log('clicked!'),
}); });
``` ```
@@ -406,16 +415,25 @@ ctx.ui.unregisterButton('my-button');
```typescript ```typescript
type UILocation = type UILocation =
| 'channel-list' | 'direct-messages' | 'home-section' | 'channel-list'
| 'text-composer-toolbar' | 'composer-actions' | 'direct-messages'
| 'room-header' | 'room-menu' | 'message-actions' | 'home-section'
| 'user-menu' | 'search-notification-section' | 'sidebar-actions'; | 'text-composer-toolbar'
| 'composer-actions'
| 'room-header'
| 'room-menu'
| 'message-actions'
| 'user-menu'
| 'search-notification-section'
| 'sidebar-actions';
interface UIButtonDefinition { interface UIButtonDefinition {
id: string; id: string;
location: UILocation; location: UILocation;
label: string; label: string;
icon?: string; icon?: string;
/** Lucide icon name, e.g. `ImagePlay`. Also supported via `icon: 'lucide:ImagePlay'`. */
lucideIcon?: string;
position?: UIButtonPosition; position?: UIButtonPosition;
onClick?: () => void | Promise<void>; onClick?: () => void | Promise<void>;
} }
@@ -440,47 +458,47 @@ Define settings that users can configure in the UI.
ctx.settings.define({ ctx.settings.define({
// Boolean toggle // Boolean toggle
enableFeature: { enableFeature: {
type: "boolean", type: 'boolean',
label: "Enable Feature", label: 'Enable Feature',
description: "Toggle this feature on/off", description: 'Toggle this feature on/off',
default: true default: true,
}, },
// String input // String input
apiKey: { apiKey: {
type: "string", type: 'string',
label: "API Key", label: 'API Key',
description: "Your API key", description: 'Your API key',
default: "" default: '',
}, },
// Number input // Number input
maxRetries: { maxRetries: {
type: "number", type: 'number',
label: "Max Retries", label: 'Max Retries',
description: "Maximum retry attempts", description: 'Maximum retry attempts',
default: 3 default: 3,
}, },
// Select dropdown // Select dropdown
theme: { theme: {
type: "select", type: 'select',
label: "Theme", label: 'Theme',
description: "Choose a theme", description: 'Choose a theme',
options: [ options: [
{ value: "dark", label: "Dark Mode" }, { value: 'dark', label: 'Dark Mode' },
{ value: "light", label: "Light Mode" } { value: 'light', label: 'Light Mode' },
], ],
default: "dark" default: 'dark',
}, },
// Color picker // Color picker
accentColor: { accentColor: {
type: "color", type: 'color',
label: "Accent Color", label: 'Accent Color',
description: "Choose your accent color", description: 'Choose your accent color',
default: "#6366f1" default: '#6366f1',
} },
}); });
``` ```
@@ -525,9 +543,9 @@ Register custom themes that appear in the theme selector dropdown. Themes use CS
```javascript ```javascript
ctx.themes.register({ ctx.themes.register({
id: "my-theme", id: 'my-theme',
name: "My Custom Theme", name: 'My Custom Theme',
kind: "dark", // "light" or "dark" kind: 'dark', // "light" or "dark"
css: ` css: `
body.plugin-my-plugin-my-theme { body.plugin-my-plugin-my-theme {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
@@ -540,7 +558,7 @@ ctx.themes.register({
.plugin-my-plugin-my-theme { .plugin-my-plugin-my-theme {
--tc-link: hsl(213, 100%, 80%); --tc-link: hsl(213, 100%, 80%);
} }
` `,
}); });
``` ```
@@ -560,6 +578,7 @@ Example: plugin ID `my-plugin` + theme ID `dark-blue` = `.plugin-my-plugin-dark-
#### CSS Custom Properties #### CSS Custom Properties
Available CSS variables you can override: Available CSS variables you can override:
- `--tc-link` - Link color - `--tc-link` - Link color
- `--mx-uc-1` through `--mx-uc-8` - Matrix user ID colors (for different users) - `--mx-uc-1` through `--mx-uc-8` - Matrix user ID colors (for different users)
- `--font-emoji` - Emoji font family - `--font-emoji` - Emoji font family
@@ -568,6 +587,7 @@ Available CSS variables you can override:
#### Styling Elements #### Styling Elements
Common selectors to style: Common selectors to style:
- `body.plugin-{pluginId}-{themeId}` - Body background - `body.plugin-{pluginId}-{themeId}` - Body background
- `.plugin-{pluginId}-{themeId} #root` - Main app container - `.plugin-{pluginId}-{themeId} #root` - Main app container
- `.plugin-{pluginId}-{themeId} [role="navigation"]` - Navigation sidebar - `.plugin-{pluginId}-{themeId} [role="navigation"]` - Navigation sidebar
@@ -579,11 +599,12 @@ Common selectors to style:
#### Examples #### Examples
**Dark Theme with Gradients:** **Dark Theme with Gradients:**
```javascript ```javascript
ctx.themes.register({ ctx.themes.register({
id: "midnight", id: 'midnight',
name: "Midnight Blue 🌙", name: 'Midnight Blue 🌙',
kind: "dark", kind: 'dark',
css: ` css: `
body.plugin-my-plugin-midnight { body.plugin-my-plugin-midnight {
background: linear-gradient(135deg, #0a192f 0%, #112240 50%, #1a365d 100%); background: linear-gradient(135deg, #0a192f 0%, #112240 50%, #1a365d 100%);
@@ -610,16 +631,17 @@ ctx.themes.register({
.plugin-my-plugin-midnight { .plugin-my-plugin-midnight {
--tc-link: hsl(213, 100%, 80%); --tc-link: hsl(213, 100%, 80%);
} }
` `,
}); });
``` ```
**Light Theme:** **Light Theme:**
```javascript ```javascript
ctx.themes.register({ ctx.themes.register({
id: "sunrise", id: 'sunrise',
name: "Sunrise ☀️", name: 'Sunrise ☀️',
kind: "light", kind: 'light',
css: ` css: `
body.plugin-my-plugin-sunrise { body.plugin-my-plugin-sunrise {
background: linear-gradient(135deg, #fff4e6 0%, #ffe0b2 50%, #ffcc80 100%); background: linear-gradient(135deg, #fff4e6 0%, #ffe0b2 50%, #ffcc80 100%);
@@ -642,16 +664,17 @@ ctx.themes.register({
.plugin-my-plugin-sunrise { .plugin-my-plugin-sunrise {
--tc-link: hsl(30, 100%, 40%); --tc-link: hsl(30, 100%, 40%);
} }
` `,
}); });
``` ```
**Minimal Theme:** **Minimal Theme:**
```javascript ```javascript
ctx.themes.register({ ctx.themes.register({
id: "forest", id: 'forest',
name: "Forest Green 🌲", name: 'Forest Green 🌲',
kind: "dark", kind: 'dark',
css: ` css: `
body.plugin-my-plugin-forest { body.plugin-my-plugin-forest {
background: #1a2f23; background: #1a2f23;
@@ -668,14 +691,14 @@ ctx.themes.register({
--mx-uc-7: hsl(135, 60%, 70%); --mx-uc-7: hsl(135, 60%, 70%);
--mx-uc-8: hsl(155, 60%, 70%); --mx-uc-8: hsl(155, 60%, 70%);
} }
` `,
}); });
``` ```
#### Unregister Theme #### Unregister Theme
```javascript ```javascript
ctx.themes.unregister("my-theme"); ctx.themes.unregister('my-theme');
``` ```
#### API Reference #### API Reference
@@ -696,6 +719,7 @@ interface PluginTheme {
``` ```
**Notes:** **Notes:**
- CSS is injected once when the plugin loads (not per theme change) - CSS is injected once when the plugin loads (not per theme change)
- Theme IDs are automatically prefixed with `plugin-{pluginId}-` to avoid conflicts - Theme IDs are automatically prefixed with `plugin-{pluginId}-` to avoid conflicts
- Theme class names follow the pattern: `.plugin-{pluginId}-{themeId}` - Theme class names follow the pattern: `.plugin-{pluginId}-{themeId}`
@@ -714,19 +738,19 @@ Hook into raw Matrix events for advanced functionality.
```javascript ```javascript
// Room messages // Room messages
ctx.matrix.on("m.room.message", (event) => { ctx.matrix.on('m.room.message', (event) => {
const content = event.getContent(); const content = event.getContent();
ctx.log('Message:', content.body); ctx.log('Message:', content.body);
}); });
// Membership changes // Membership changes
ctx.matrix.on("m.room.member", (event) => { ctx.matrix.on('m.room.member', (event) => {
const content = event.getContent(); const content = event.getContent();
ctx.log('Membership:', content.membership); ctx.log('Membership:', content.membership);
}); });
// Timeline events // Timeline events
ctx.matrix.on("Room.timeline", (event) => { ctx.matrix.on('Room.timeline', (event) => {
if (event.getType() === 'm.room.message') { if (event.getType() === 'm.room.message') {
const sender = event.getSender(); const sender = event.getSender();
ctx.log('Timeline event from:', sender); ctx.log('Timeline event from:', sender);
@@ -734,7 +758,7 @@ ctx.matrix.on("Room.timeline", (event) => {
}); });
// Sync state // Sync state
ctx.matrix.on("sync", (state, prevState) => { ctx.matrix.on('sync', (state, prevState) => {
ctx.log('Sync state:', state); ctx.log('Sync state:', state);
}); });
``` ```
@@ -746,10 +770,10 @@ const handler = (event) => {
ctx.log('Event received'); ctx.log('Event received');
}; };
ctx.matrix.on("m.room.message", handler); ctx.matrix.on('m.room.message', handler);
// Later... // Later...
ctx.matrix.off("m.room.message", handler); ctx.matrix.off('m.room.message', handler);
``` ```
#### API Reference #### API Reference
@@ -762,6 +786,7 @@ interface MatrixEventsAPI {
``` ```
**Common Event Types:** **Common Event Types:**
- `m.room.message` - Room messages - `m.room.message` - Room messages
- `m.room.member` - Membership changes - `m.room.member` - Membership changes
- `m.room.name` - Room name changes - `m.room.name` - Room name changes
@@ -781,11 +806,11 @@ Run periodic tasks or delayed actions.
// Run every 30 seconds // Run every 30 seconds
const intervalId = ctx.timers.setInterval(() => { const intervalId = ctx.timers.setInterval(() => {
ctx.log('Periodic task running'); ctx.log('Periodic task running');
// Do something periodically // Do something periodically
const stats = { const stats = {
timestamp: Date.now(), timestamp: Date.now(),
setting: ctx.settings.get('theme') setting: ctx.settings.get('theme'),
}; };
ctx.log('Stats:', stats); ctx.log('Stats:', stats);
}, 30000); }, 30000);
@@ -802,9 +827,9 @@ const timeoutId = ctx.timers.setTimeout(() => {
ctx.notify({ ctx.notify({
title: 'Reminder', title: 'Reminder',
body: 'This is a delayed notification', body: 'This is a delayed notification',
type: 'info' type: 'info',
}); });
}, 10000); // 10 seconds }, 10000); // 10 seconds
// Clear timeout // Clear timeout
ctx.timers.clearTimeout(timeoutId); ctx.timers.clearTimeout(timeoutId);
@@ -841,8 +866,8 @@ ctx.notify('Hello, world!');
ctx.notify({ ctx.notify({
title: 'Plugin Alert', title: 'Plugin Alert',
body: 'Something important happened!', body: 'Something important happened!',
type: 'info', // 'info' | 'success' | 'error' | 'warning' type: 'info', // 'info' | 'success' | 'error' | 'warning'
duration: 5000 // milliseconds (optional) duration: 5000, // milliseconds (optional)
}); });
``` ```
@@ -853,30 +878,28 @@ ctx.notify({
ctx.notify({ ctx.notify({
title: 'Success', title: 'Success',
body: 'Operation completed successfully!', body: 'Operation completed successfully!',
type: 'success' type: 'success',
}); });
// Error notification // Error notification
ctx.notify({ ctx.notify({
title: 'Error', title: 'Error',
body: 'Something went wrong', body: 'Something went wrong',
type: 'error' type: 'error',
}); });
// Warning // Warning
ctx.notify({ ctx.notify({
title: 'Warning', title: 'Warning',
body: 'This action cannot be undone', body: 'This action cannot be undone',
type: 'warning' type: 'warning',
}); });
``` ```
#### API Reference #### API Reference
```typescript ```typescript
type NotificationFunction = ( type NotificationFunction = (options: NotificationOptions | string) => void;
options: NotificationOptions | string
) => void;
interface NotificationOptions { interface NotificationOptions {
title: string; title: string;
@@ -913,13 +936,14 @@ ctx.error('Error details:', errorObject);
type LogFunction = (...args: any[]) => void; type LogFunction = (...args: any[]) => void;
interface PluginContext { interface PluginContext {
log: LogFunction; // Info level log: LogFunction; // Info level
warn: LogFunction; // Warning level warn: LogFunction; // Warning level
error: LogFunction; // Error level error: LogFunction; // Error level
} }
``` ```
**Note:** All logs are visible in: **Note:** All logs are visible in:
- Browser console (F12) - Browser console (F12)
- Plugin logs panel (Settings → Plugins → Logs) - coming soon - Plugin logs panel (Settings → Plugins → Logs) - coming soon
@@ -934,21 +958,21 @@ Export functions and data for other plugins to use.
```javascript ```javascript
module.exports = { module.exports = {
// ... onLoad, onUnload ... // ... onLoad, onUnload ...
exports: { exports: {
version: "1.0.0", version: '1.0.0',
utils: { utils: {
greet: (name) => `Hello, ${name}!`, greet: (name) => `Hello, ${name}!`,
processText: (text) => text.toUpperCase(), processText: (text) => text.toUpperCase(),
getStats: () => ({ getStats: () => ({
version: "1.0.0", version: '1.0.0',
features: ['commands', 'settings'] features: ['commands', 'settings'],
}) }),
} },
} },
}; };
``` ```
@@ -960,11 +984,11 @@ const otherPlugin = ctx.require('other-plugin-id');
if (otherPlugin) { if (otherPlugin) {
const greeting = otherPlugin.utils.greet('World'); const greeting = otherPlugin.utils.greet('World');
ctx.log(greeting); // "Hello, World!" ctx.log(greeting); // "Hello, World!"
const processed = otherPlugin.utils.processText('hello'); const processed = otherPlugin.utils.processText('hello');
ctx.log(processed); // "HELLO" ctx.log(processed); // "HELLO"
const stats = otherPlugin.utils.getStats(); const stats = otherPlugin.utils.getStats();
ctx.log('Stats:', stats); ctx.log('Stats:', stats);
} }
@@ -1015,7 +1039,7 @@ ctx.log('Sync state:', syncState);
// Send custom event // Send custom event
await ctx.matrixClient.sendEvent(roomId, 'm.room.message', { await ctx.matrixClient.sendEvent(roomId, 'm.room.message', {
msgtype: 'm.text', msgtype: 'm.text',
body: 'Hello from plugin!' body: 'Hello from plugin!',
}); });
``` ```
@@ -1023,7 +1047,7 @@ await ctx.matrixClient.sendEvent(roomId, 'm.room.message', {
```typescript ```typescript
interface PluginContext { interface PluginContext {
matrixClient: MatrixClient; // Full Matrix.js SDK client matrixClient: MatrixClient; // Full Matrix.js SDK client
} }
``` ```
@@ -1040,122 +1064,122 @@ Here's a complete plugin that demonstrates all features:
* Example Plugin - All Features * Example Plugin - All Features
*/ */
module.exports = { module.exports = {
name: "Example Plugin", name: 'Example Plugin',
version: "1.0.0", version: '1.0.0',
dependencies: {}, dependencies: {},
onLoad: async (ctx) => { onLoad: async (ctx) => {
ctx.log('🚀 Plugin loading...'); ctx.log('🚀 Plugin loading...');
// === COMMANDS === // === COMMANDS ===
ctx.commands.register({ ctx.commands.register({
name: "hello", name: 'hello',
description: "Say hello", description: 'Say hello',
run: () => "Hello, world!" run: () => 'Hello, world!',
}); });
ctx.commands.register({ ctx.commands.register({
name: "greet", name: 'greet',
description: "Greet someone", description: 'Greet someone',
args: ["name"], args: ['name'],
run: ({ name }) => `Hello, ${name}!` run: ({ name }) => `Hello, ${name}!`,
}); });
// === INTERCEPTORS === // === INTERCEPTORS ===
ctx.messages.onBeforeSend((msg) => { ctx.messages.onBeforeSend((msg) => {
// Auto-expand abbreviations // Auto-expand abbreviations
msg.content = msg.content.replace(/\bbrb\b/gi, 'be right back'); msg.content = msg.content.replace(/\bbrb\b/gi, 'be right back');
// Add emoji if enabled // Add emoji if enabled
if (ctx.settings.get('addEmoji')) { if (ctx.settings.get('addEmoji')) {
msg.content += ' ✨'; msg.content += ' ✨';
} }
}); });
ctx.messages.onReceive((msg) => { ctx.messages.onReceive((msg) => {
// Track keywords // Track keywords
const keywords = ctx.settings.get('keywords') || ''; const keywords = ctx.settings.get('keywords') || '';
keywords.split(',').forEach(keyword => { keywords.split(',').forEach((keyword) => {
if (msg.content.includes(keyword.trim())) { if (msg.content.includes(keyword.trim())) {
ctx.notify(`Keyword detected: ${keyword}`); ctx.notify(`Keyword detected: ${keyword}`);
} }
}); });
}); });
// === SETTINGS === // === SETTINGS ===
ctx.settings.define({ ctx.settings.define({
addEmoji: { addEmoji: {
type: "boolean", type: 'boolean',
label: "Add Emoji", label: 'Add Emoji',
description: "Add sparkles to messages", description: 'Add sparkles to messages',
default: false default: false,
}, },
keywords: { keywords: {
type: "string", type: 'string',
label: "Track Keywords", label: 'Track Keywords',
description: "Comma-separated keywords to track", description: 'Comma-separated keywords to track',
default: "important,urgent" default: 'important,urgent',
}, },
theme: { theme: {
type: "select", type: 'select',
label: "Theme", label: 'Theme',
options: [ options: [
{ value: "light", label: "Light" }, { value: 'light', label: 'Light' },
{ value: "dark", label: "Dark" } { value: 'dark', label: 'Dark' },
], ],
default: "dark" default: 'dark',
} },
}); });
// === THEMES === // === THEMES ===
ctx.themes.register({ ctx.themes.register({
id: "example-theme", id: 'example-theme',
name: "Example Theme", name: 'Example Theme',
kind: "dark", kind: 'dark',
colors: { colors: {
background: "#1a1a2e", background: '#1a1a2e',
surface: "#16213e", surface: '#16213e',
primary: "#0f3460", primary: '#0f3460',
secondary: "#533483", secondary: '#533483',
onBackground: "#ffffff", onBackground: '#ffffff',
onSurface: "#e0e0e0" onSurface: '#e0e0e0',
} },
}); });
// === MATRIX EVENTS === // === MATRIX EVENTS ===
ctx.matrix.on("m.room.message", (event) => { ctx.matrix.on('m.room.message', (event) => {
const content = event.getContent(); const content = event.getContent();
if (content.body?.includes('example')) { if (content.body?.includes('example')) {
ctx.log('Keyword found in message'); ctx.log('Keyword found in message');
} }
}); });
// === BACKGROUND TASKS === // === BACKGROUND TASKS ===
ctx.timers.setInterval(() => { ctx.timers.setInterval(() => {
ctx.log('Periodic check'); ctx.log('Periodic check');
}, 60000); // Every minute }, 60000); // Every minute
// === NOTIFICATIONS === // === NOTIFICATIONS ===
ctx.notify({ ctx.notify({
title: 'Example Plugin', title: 'Example Plugin',
body: 'Plugin loaded successfully!', body: 'Plugin loaded successfully!',
type: 'success' type: 'success',
}); });
// === EXPORTS === // === EXPORTS ===
this.exports = { this.exports = {
version: "1.0.0", version: '1.0.0',
greet: (name) => `Hello, ${name}!` greet: (name) => `Hello, ${name}!`,
}; };
ctx.log('✅ Plugin loaded'); ctx.log('✅ Plugin loaded');
}, },
onUnload: async () => { onUnload: async () => {
console.log('Plugin unloaded'); console.log('Plugin unloaded');
}, },
exports: null exports: null,
}; };
``` ```
@@ -1176,10 +1200,10 @@ onLoad: async (ctx) => {
ctx.notify({ ctx.notify({
title: 'Plugin Error', title: 'Plugin Error',
body: error.message, body: error.message,
type: 'error' type: 'error',
}); });
} }
} };
``` ```
### Cleanup ### Cleanup
@@ -1191,9 +1215,9 @@ onUnload: async () => {
// Timers are auto-cleared // Timers are auto-cleared
// Event handlers are auto-removed // Event handlers are auto-removed
// Settings are persisted automatically // Settings are persisted automatically
console.log('Plugin unloaded'); console.log('Plugin unloaded');
} };
``` ```
### Settings Validation ### Settings Validation
@@ -1202,7 +1226,7 @@ Validate settings before use:
```javascript ```javascript
const maxRetries = ctx.settings.get('maxRetries') || 3; const maxRetries = ctx.settings.get('maxRetries') || 3;
const keywords = (ctx.settings.get('keywords') || '').split(',').filter(k => k.trim()); const keywords = (ctx.settings.get('keywords') || '').split(',').filter((k) => k.trim());
``` ```
### Logging ### Logging
@@ -1210,9 +1234,9 @@ const keywords = (ctx.settings.get('keywords') || '').split(',').filter(k => k.t
Use appropriate log levels: Use appropriate log levels:
```javascript ```javascript
ctx.log('Info message'); // Normal operation ctx.log('Info message'); // Normal operation
ctx.warn('Warning message'); // Potential issues ctx.warn('Warning message'); // Potential issues
ctx.error('Error message'); // Actual errors ctx.error('Error message'); // Actual errors
``` ```
### Performance ### Performance
+64 -65
View File
@@ -15,26 +15,26 @@ Buttons render in two visual styles depending on location — **nav list rows**
These render as full-width list entries matching the style of built-in items like "Create Room" and "Message Search": These render as full-width list entries matching the style of built-in items like "Create Room" and "Message Search":
| Location | Where it appears | | Location | Where it appears |
|---|---| | ----------------- | ----------------------------------------------------------------------- |
| `channel-list` | Space channel list, below Lobby and Message Search | | `channel-list` | Space channel list, below Lobby and Message Search |
| `home-section` | Home panel, inside the Rooms category above the room list | | `home-section` | Home panel, inside the Rooms category above the room list |
| `direct-messages` | Direct Messages panel, below "Create Chat" and above the CHATS dropdown | | `direct-messages` | Direct Messages panel, below "Create Chat" and above the CHATS dropdown |
### Icon Buttons ### Icon Buttons
These render as compact icon buttons inline with other toolbar/header controls: These render as compact icon buttons inline with other toolbar/header controls:
| Location | Where it appears | | Location | Where it appears |
|---|---| | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `text-composer-toolbar` | Message composer toolbar (alongside emoji, sticker buttons) | | `text-composer-toolbar` | Message composer toolbar (alongside emoji, sticker buttons) |
| `composer-actions` | Left side of the composer, beside the `+` attach button | | `composer-actions` | Left side of the composer, beside the `+` attach button |
| `room-header` | Top room header bar, before the ⋮ menu button | | `room-header` | Top room header bar, before the ⋮ menu button |
| `room-menu` | Room ⋮ dropdown menu | | `room-menu` | Room ⋮ dropdown menu |
| `message-actions` | Message hover action bar | | `message-actions` | Message hover action bar |
| `user-menu` | Right-click popup on the user avatar | | `user-menu` | Right-click popup on the user avatar |
| `search-notification-section` | Notifications page header (right side) | | `search-notification-section` | Notifications page header (right side) |
| `sidebar-actions` | Left sidebar — appears in **two** places: above the Explore Servers icon, and above the Search icon in the sticky bottom section | | `sidebar-actions` | Left sidebar — appears in **two** places: above the Explore Servers icon, and above the Search icon in the sticky bottom section |
> 💡 **Tip:** Install the [example-showcase-plugin](example-showcase-plugin/) to see exactly where each location appears in the UI! > 💡 **Tip:** Install the [example-showcase-plugin](example-showcase-plugin/) to see exactly where each location appears in the UI!
@@ -46,7 +46,7 @@ These render as compact icon buttons inline with other toolbar/header controls:
module.exports = { module.exports = {
name: 'my-plugin', name: 'my-plugin',
version: '1.0.0', version: '1.0.0',
onLoad: (context) => { onLoad: (context) => {
context.ui.registerButton({ context.ui.registerButton({
id: 'my-button', id: 'my-button',
@@ -55,13 +55,13 @@ module.exports = {
icon: '🎨', icon: '🎨',
onClick: () => { onClick: () => {
context.log('Button clicked!'); context.log('Button clicked!');
} },
}); });
}, },
onUnload: () => { onUnload: () => {
// Buttons are automatically cleaned up on plugin unload // Buttons are automatically cleaned up on plugin unload
} },
}; };
``` ```
@@ -80,8 +80,8 @@ context.ui.registerButton({
position: { position: {
before: 'emoji-picker-button', // Place before emoji picker before: 'emoji-picker-button', // Place before emoji picker
// OR // OR
after: 'sticker-button' // Place after sticker button after: 'sticker-button', // Place after sticker button
} },
}); });
``` ```
@@ -97,8 +97,8 @@ context.ui.registerButton({
icon: '1️⃣', icon: '1️⃣',
position: { position: {
group: 'my-plugin-tools', group: 'my-plugin-tools',
order: 1 // Lower numbers appear first order: 1, // Lower numbers appear first
} },
}); });
context.ui.registerButton({ context.ui.registerButton({
@@ -108,8 +108,8 @@ context.ui.registerButton({
icon: '2️⃣', icon: '2️⃣',
position: { position: {
group: 'my-plugin-tools', group: 'my-plugin-tools',
order: 2 order: 2,
} },
}); });
``` ```
@@ -126,8 +126,8 @@ context.ui.registerButton({
position: { position: {
group: 'my-tools', group: 'my-tools',
after: 'emoji-picker-button', after: 'emoji-picker-button',
order: 1 order: 1,
} },
}); });
context.ui.registerButton({ context.ui.registerButton({
@@ -137,8 +137,8 @@ context.ui.registerButton({
icon: '🔨', icon: '🔨',
position: { position: {
group: 'my-tools', group: 'my-tools',
order: 2 order: 2,
} },
}); });
``` ```
@@ -148,7 +148,7 @@ context.ui.registerButton({
module.exports = { module.exports = {
name: 'custom-tools', name: 'custom-tools',
version: '1.0.0', version: '1.0.0',
onLoad: (context) => { onLoad: (context) => {
// Nav list row — appears below "Create Chat" in the DMs panel // Nav list row — appears below "Create Chat" in the DMs panel
context.ui.registerButton({ context.ui.registerButton({
@@ -156,7 +156,7 @@ module.exports = {
location: 'direct-messages', location: 'direct-messages',
label: 'Favourites', label: 'Favourites',
icon: '⭐', icon: '⭐',
onClick: () => context.log('Favourites clicked!') onClick: () => context.log('Favourites clicked!'),
}); });
// Nav list row — appears in the space channel list // Nav list row — appears in the space channel list
@@ -165,7 +165,7 @@ module.exports = {
location: 'channel-list', location: 'channel-list',
label: 'Quick Access', label: 'Quick Access',
icon: '⚡', icon: '⚡',
onClick: () => context.log('Quick access clicked!') onClick: () => context.log('Quick access clicked!'),
}); });
// Icon button — appears in the message composer toolbar // Icon button — appears in the message composer toolbar
@@ -176,9 +176,9 @@ module.exports = {
icon: '𝐁', icon: '𝐁',
position: { position: {
group: 'custom-formatting', group: 'custom-formatting',
order: 1 order: 1,
}, },
onClick: () => context.log('Bold clicked!') onClick: () => context.log('Bold clicked!'),
}); });
// Icon button — appears in the room header // Icon button — appears in the room header
@@ -188,7 +188,7 @@ module.exports = {
label: 'Special Search', label: 'Special Search',
icon: '🔍', icon: '🔍',
position: { after: 'search-button' }, position: { after: 'search-button' },
onClick: () => context.log('Special search clicked!') onClick: () => context.log('Special search clicked!'),
}); });
// Sidebar icon — appears above Explore and above Search // Sidebar icon — appears above Explore and above Search
@@ -197,13 +197,13 @@ module.exports = {
location: 'sidebar-actions', location: 'sidebar-actions',
label: 'Plugin Panel', label: 'Plugin Panel',
icon: '🧩', icon: '🧩',
onClick: () => context.log('Plugin panel clicked!') onClick: () => context.log('Plugin panel clicked!'),
}); });
}, },
onUnload: () => { onUnload: () => {
// All registered buttons are automatically cleaned up // All registered buttons are automatically cleaned up
} },
}; };
``` ```
@@ -228,13 +228,12 @@ const button: UIButtonDefinition = {
position: { position: {
group: 'my-tools', group: 'my-tools',
after: 'emoji-picker', after: 'emoji-picker',
order: 1 order: 1,
}, },
onClick: () => console.log('Clicked!') onClick: () => console.log('Clicked!'),
}; };
``` ```
## Basic Usage ## Basic Usage
### Simple Button ### Simple Button
@@ -243,7 +242,7 @@ const button: UIButtonDefinition = {
module.exports = { module.exports = {
name: 'my-plugin', name: 'my-plugin',
version: '1.0.0', version: '1.0.0',
onLoad: (context) => { onLoad: (context) => {
context.ui.registerButton({ context.ui.registerButton({
id: 'my-button', id: 'my-button',
@@ -252,13 +251,13 @@ module.exports = {
icon: '🎨', icon: '🎨',
onClick: () => { onClick: () => {
context.log('Button clicked!'); context.log('Button clicked!');
} },
}); });
}, },
onUnload: () => { onUnload: () => {
// Buttons are automatically cleaned up on plugin unload // Buttons are automatically cleaned up on plugin unload
} },
}; };
``` ```
@@ -277,8 +276,8 @@ context.ui.registerButton({
position: { position: {
before: 'emoji-picker-button', // Place before emoji picker before: 'emoji-picker-button', // Place before emoji picker
// OR // OR
after: 'sticker-button' // Place after sticker button after: 'sticker-button', // Place after sticker button
} },
}); });
``` ```
@@ -294,8 +293,8 @@ context.ui.registerButton({
icon: '1️⃣', icon: '1️⃣',
position: { position: {
group: 'my-plugin-tools', group: 'my-plugin-tools',
order: 1 // Lower numbers appear first order: 1, // Lower numbers appear first
} },
}); });
context.ui.registerButton({ context.ui.registerButton({
@@ -305,8 +304,8 @@ context.ui.registerButton({
icon: '2️⃣', icon: '2️⃣',
position: { position: {
group: 'my-plugin-tools', group: 'my-plugin-tools',
order: 2 order: 2,
} },
}); });
``` ```
@@ -323,8 +322,8 @@ context.ui.registerButton({
position: { position: {
group: 'my-tools', group: 'my-tools',
after: 'emoji-picker-button', after: 'emoji-picker-button',
order: 1 order: 1,
} },
}); });
context.ui.registerButton({ context.ui.registerButton({
@@ -334,8 +333,8 @@ context.ui.registerButton({
icon: '🔨', icon: '🔨',
position: { position: {
group: 'my-tools', group: 'my-tools',
order: 2 order: 2,
} },
}); });
``` ```
@@ -345,7 +344,7 @@ context.ui.registerButton({
module.exports = { module.exports = {
name: 'custom-tools', name: 'custom-tools',
version: '1.0.0', version: '1.0.0',
onLoad: (context) => { onLoad: (context) => {
// Nav list row — appears below "Create Chat" in the DMs panel // Nav list row — appears below "Create Chat" in the DMs panel
context.ui.registerButton({ context.ui.registerButton({
@@ -353,7 +352,7 @@ module.exports = {
location: 'direct-messages', location: 'direct-messages',
label: 'Favourites', label: 'Favourites',
icon: '⭐', icon: '⭐',
onClick: () => context.log('Favourites clicked!') onClick: () => context.log('Favourites clicked!'),
}); });
// Nav list row — appears in the space channel list // Nav list row — appears in the space channel list
@@ -362,7 +361,7 @@ module.exports = {
location: 'channel-list', location: 'channel-list',
label: 'Quick Access', label: 'Quick Access',
icon: '⚡', icon: '⚡',
onClick: () => context.log('Quick access clicked!') onClick: () => context.log('Quick access clicked!'),
}); });
// Icon button — appears in the message composer toolbar // Icon button — appears in the message composer toolbar
@@ -373,9 +372,9 @@ module.exports = {
icon: '𝐁', icon: '𝐁',
position: { position: {
group: 'custom-formatting', group: 'custom-formatting',
order: 1 order: 1,
}, },
onClick: () => context.log('Bold clicked!') onClick: () => context.log('Bold clicked!'),
}); });
// Icon button — appears in the room header // Icon button — appears in the room header
@@ -385,7 +384,7 @@ module.exports = {
label: 'Special Search', label: 'Special Search',
icon: '🔍', icon: '🔍',
position: { after: 'search-button' }, position: { after: 'search-button' },
onClick: () => context.log('Special search clicked!') onClick: () => context.log('Special search clicked!'),
}); });
// Sidebar icon — appears above Explore and above Search // Sidebar icon — appears above Explore and above Search
@@ -394,13 +393,13 @@ module.exports = {
location: 'sidebar-actions', location: 'sidebar-actions',
label: 'Plugin Panel', label: 'Plugin Panel',
icon: '🧩', icon: '🧩',
onClick: () => context.log('Plugin panel clicked!') onClick: () => context.log('Plugin panel clicked!'),
}); });
}, },
onUnload: () => { onUnload: () => {
// All registered buttons are automatically cleaned up // All registered buttons are automatically cleaned up
} },
}; };
``` ```
@@ -425,8 +424,8 @@ const button: UIButtonDefinition = {
position: { position: {
group: 'my-tools', group: 'my-tools',
after: 'emoji-picker', after: 'emoji-picker',
order: 1 order: 1,
}, },
onClick: () => console.log('Clicked!') onClick: () => console.log('Clicked!'),
}; };
``` ```
+35 -16
View File
@@ -5,18 +5,21 @@ All requested features have been implemented! 🎉
## ✅ Implemented Features ## ✅ Implemented Features
### 1. ✅ Enhanced Slash Commands ### 1. ✅ Enhanced Slash Commands
- **Simple commands**: `ctx.commands.register({ name: "shrug", run: () => "¯\\_(ツ)_/¯" })` - **Simple commands**: `ctx.commands.register({ name: "shrug", run: () => "¯\\_(ツ)_/¯" })`
- **Commands with args**: `ctx.commands.register({ name: "echo", args: ["text"], run: ({ text }) => text })` - **Commands with args**: `ctx.commands.register({ name: "echo", args: ["text"], run: ({ text }) => text })`
- Automatic argument parsing - Automatic argument parsing
- Execution API: `ctx.commands.execute(name, args)` - Execution API: `ctx.commands.execute(name, args)`
### 2. ✅ Message Interceptors ### 2. ✅ Message Interceptors
- **Before send**: `ctx.messages.onBeforeSend((msg) => { msg.content = "modified" })` - **Before send**: `ctx.messages.onBeforeSend((msg) => { msg.content = "modified" })`
- **On receive**: `ctx.messages.onReceive((msg) => { /* process */ })` - **On receive**: `ctx.messages.onReceive((msg) => { /* process */ })`
- Full MessageContext with content, roomId, metadata - Full MessageContext with content, roomId, metadata
- Async support for interceptors - Async support for interceptors
### 3. ✅ Custom Renderers & Button Registration ### 3. ✅ Custom Renderers & Button Registration
- **Register renderer**: `ctx.ui.registerRenderer("message", (msg, defaultRenderer) => { /* render */ })` - **Register renderer**: `ctx.ui.registerRenderer("message", (msg, defaultRenderer) => { /* render */ })`
- **Unregister renderer**: `ctx.ui.unregisterRenderer("message")` - **Unregister renderer**: `ctx.ui.unregisterRenderer("message")`
- **Register button**: `ctx.ui.registerButton({ id, location, label, icon, onClick })` - **Register button**: `ctx.ui.registerButton({ id, location, label, icon, onClick })`
@@ -29,6 +32,7 @@ All requested features have been implemented! 🎉
- See [PLUGIN_BUTTON_API.md](PLUGIN_BUTTON_API.md) for full reference - See [PLUGIN_BUTTON_API.md](PLUGIN_BUTTON_API.md) for full reference
### 4. ✅ Settings UI Per Plugin ### 4. ✅ Settings UI Per Plugin
- **Define schema**: `ctx.settings.define({ theme: { type: "select", options: [...] } })` - **Define schema**: `ctx.settings.define({ theme: { type: "select", options: [...] } })`
- **Supported types**: string, number, boolean, select, color - **Supported types**: string, number, boolean, select, color
- **Get/Set**: `ctx.settings.get(key)` / `ctx.settings.set(key, value)` - **Get/Set**: `ctx.settings.get(key)` / `ctx.settings.set(key, value)`
@@ -36,24 +40,28 @@ All requested features have been implemented! 🎉
- No JSON editing needed! - No JSON editing needed!
### 5. ✅ Hot Reload ### 5. ✅ Hot Reload
- **API**: `pluginRegistry.reloadPlugin(pluginId, newPlugin, newContext)` - **API**: `pluginRegistry.reloadPlugin(pluginId, newPlugin, newContext)`
- Auto-cleanup of old plugin resources - Auto-cleanup of old plugin resources
- Maintains enabled/disabled state - Maintains enabled/disabled state
- Dev-friendly workflow - Dev-friendly workflow
### 6. ✅ Dependency System ### 6. ✅ Dependency System
- **Declare**: `dependencies: { "paarrot.core-utils": "^1.0.0" }` - **Declare**: `dependencies: { "paarrot.core-utils": "^1.0.0" }`
- **Require**: `const utils = ctx.require("paarrot.utils")` - **Require**: `const utils = ctx.require("paarrot.utils")`
- Error handling for missing dependencies - Error handling for missing dependencies
- Plugin exports system - Plugin exports system
### 7. ✅ Raw Matrix Events Hook ### 7. ✅ Raw Matrix Events Hook
- **Full SDK access**: `ctx.matrix.on("m.room.message", (ev) => { })` - **Full SDK access**: `ctx.matrix.on("m.room.message", (ev) => { })`
- **Any event type**: Room.timeline, sync, RoomState.events, etc. - **Any event type**: Room.timeline, sync, RoomState.events, etc.
- Direct Matrix.js SDK integration - Direct Matrix.js SDK integration
- Power users will go nuts! - Power users will go nuts!
### 8. ✅ Background Tasks / Intervals ### 8. ✅ Background Tasks / Intervals
- **Interval**: `ctx.timers.setInterval(() => { /* cursed shit */ }, 10000)` - **Interval**: `ctx.timers.setInterval(() => { /* cursed shit */ }, 10000)`
- **Timeout**: `ctx.timers.setTimeout(() => { }, 5000)` - **Timeout**: `ctx.timers.setTimeout(() => { }, 5000)`
- **Clear**: `ctx.timers.clearInterval(id)` / `ctx.timers.clearTimeout(id)` - **Clear**: `ctx.timers.clearInterval(id)` / `ctx.timers.clearTimeout(id)`
@@ -61,12 +69,14 @@ All requested features have been implemented! 🎉
- Perfect for bots, reminders, auto-cleanup - Perfect for bots, reminders, auto-cleanup
### 9. ✅ Notifications API ### 9. ✅ Notifications API
- **Simple**: `ctx.notify("Oi")` - **Simple**: `ctx.notify("Oi")`
- **Advanced**: `ctx.notify({ title: "Oi", body: "New message from Steve", type: "info" })` - **Advanced**: `ctx.notify({ title: "Oi", body: "New message from Steve", type: "info" })`
- Action buttons support - Action buttons support
- Custom duration - Custom duration
### 10. ✅ Plugin Logs Panel ### 10. ✅ Plugin Logs Panel
- **Logging**: `ctx.log()`, `ctx.warn()`, `ctx.error()` - **Logging**: `ctx.log()`, `ctx.warn()`, `ctx.error()`
- Per-plugin log storage - Per-plugin log storage
- Visible in `pluginRegistry.getLogs(pluginId)` - Visible in `pluginRegistry.getLogs(pluginId)`
@@ -85,16 +95,19 @@ All requested features have been implemented! 🎉
## 📁 Files Changed ## 📁 Files Changed
### Core System ### Core System
- [`PluginAPI.ts`](cinny/src/app/features/settings/plugins/PluginAPI.ts) - Enhanced with all APIs - [`PluginAPI.ts`](cinny/src/app/features/settings/plugins/PluginAPI.ts) - Enhanced with all APIs
- [`PluginLoader.tsx`](cinny/src/app/features/settings/plugins/PluginLoader.tsx) - Complete rewrite with context creation - [`PluginLoader.tsx`](cinny/src/app/features/settings/plugins/PluginLoader.tsx) - Complete rewrite with context creation
- [`index.ts`](cinny/src/app/features/settings/plugins/index.ts) - Exports updated - [`index.ts`](cinny/src/app/features/settings/plugins/index.ts) - Exports updated
### Documentation ### Documentation
- [`PLUGIN_DEVELOPMENT.md`](cinny/src/app/features/settings/plugins/PLUGIN_DEVELOPMENT.md) - Comprehensive guide - [`PLUGIN_DEVELOPMENT.md`](cinny/src/app/features/settings/plugins/PLUGIN_DEVELOPMENT.md) - Comprehensive guide
- [`PLUGINS.md`](PLUGINS.md) - User guide - [`PLUGINS.md`](PLUGINS.md) - User guide
- [`example-plugin/index.js`](example-plugin/index.js) - Full-featured example - [`example-plugin/index.js`](example-plugin/index.js) - Full-featured example
### Integration ### Integration
- [`ClientRoot.tsx`](cinny/src/app/pages/client/ClientRoot.tsx) - PluginLoader integrated - [`ClientRoot.tsx`](cinny/src/app/pages/client/ClientRoot.tsx) - PluginLoader integrated
- [`main.js`](electron/main.js) - IPC handler for reading plugin code - [`main.js`](electron/main.js) - IPC handler for reading plugin code
- [`preload.js`](electron/preload.js) - readPluginCode API exposed - [`preload.js`](electron/preload.js) - readPluginCode API exposed
@@ -103,32 +116,36 @@ All requested features have been implemented! 🎉
## 🚀 Usage Examples ## 🚀 Usage Examples
### Command with Args ### Command with Args
```javascript ```javascript
ctx.commands.register({ ctx.commands.register({
name: "echo", name: 'echo',
args: ["text"], args: ['text'],
run: ({ text }) => text run: ({ text }) => text,
}); });
``` ```
### Message Interceptor ### Message Interceptor
```javascript ```javascript
ctx.messages.onBeforeSend((msg) => { ctx.messages.onBeforeSend((msg) => {
if (msg.content === "brb") { if (msg.content === 'brb') {
msg.content = "be right back ya legend"; msg.content = 'be right back ya legend';
} }
}); });
``` ```
### Custom Settings ### Custom Settings
```javascript ```javascript
ctx.settings.define({ ctx.settings.define({
theme: { type: "select", options: ["dark", "light"] }, theme: { type: 'select', options: ['dark', 'light'] },
spamFilter: { type: "boolean", default: true } spamFilter: { type: 'boolean', default: true },
}); });
``` ```
### Background Tasks ### Background Tasks
```javascript ```javascript
ctx.timers.setInterval(() => { ctx.timers.setInterval(() => {
// do cursed shit every 10s // do cursed shit every 10s
@@ -136,15 +153,17 @@ ctx.timers.setInterval(() => {
``` ```
### Raw Matrix Events ### Raw Matrix Events
```javascript ```javascript
ctx.matrix.on("m.room.message", (ev) => { ctx.matrix.on('m.room.message', (ev) => {
ctx.log('Message:', ev.getContent().body); ctx.log('Message:', ev.getContent().body);
}); });
``` ```
### Plugin Dependencies ### Plugin Dependencies
```javascript ```javascript
const utils = ctx.require("paarrot.utils"); const utils = ctx.require('paarrot.utils');
utils.doSomething(); utils.doSomething();
``` ```
@@ -155,43 +174,43 @@ interface PluginContext {
pluginId: string; pluginId: string;
matrixClient: MatrixClient; matrixClient: MatrixClient;
React: typeof import('react'); React: typeof import('react');
commands: { commands: {
register: (command: PluginCommand) => void; register: (command: PluginCommand) => void;
unregister: (name: string) => void; unregister: (name: string) => void;
execute: (name: string, args: Record<string, any>) => Promise<string | void>; execute: (name: string, args: Record<string, any>) => Promise<string | void>;
}; };
messages: { messages: {
onBeforeSend: (interceptor: MessageInterceptor) => void; onBeforeSend: (interceptor: MessageInterceptor) => void;
onReceive: (interceptor: MessageInterceptor) => void; onReceive: (interceptor: MessageInterceptor) => void;
}; };
ui: { ui: {
registerButton: (button: UIButtonDefinition) => void; registerButton: (button: UIButtonDefinition) => void;
unregisterButton: (id: string) => void; unregisterButton: (id: string) => void;
registerRenderer: (type: string, renderer: CustomRenderer) => void; registerRenderer: (type: string, renderer: CustomRenderer) => void;
unregisterRenderer: (type: string) => void; unregisterRenderer: (type: string) => void;
}; };
settings: { settings: {
define: (schema: SettingsSchema) => void; define: (schema: SettingsSchema) => void;
get: <T = any>(key: string) => T | undefined; get: <T = any>(key: string) => T | undefined;
set: (key: string, value: any) => void; set: (key: string, value: any) => void;
}; };
matrix: { matrix: {
on: (eventType: string, handler: (event: MatrixEvent) => void) => void; on: (eventType: string, handler: (event: MatrixEvent) => void) => void;
off: (eventType: string, handler: (event: MatrixEvent) => void) => void; off: (eventType: string, handler: (event: MatrixEvent) => void) => void;
}; };
timers: { timers: {
setInterval: (callback: () => void, ms: number) => number; setInterval: (callback: () => void, ms: number) => number;
setTimeout: (callback: () => void, ms: number) => number; setTimeout: (callback: () => void, ms: number) => number;
clearInterval: (id: number) => void; clearInterval: (id: number) => void;
clearTimeout: (id: number) => void; clearTimeout: (id: number) => void;
}; };
notify: (options: NotificationOptions | string) => void; notify: (options: NotificationOptions | string) => void;
log: (...args: any[]) => void; log: (...args: any[]) => void;
warn: (...args: any[]) => void; warn: (...args: any[]) => void;
+113
View File
@@ -0,0 +1,113 @@
# Paarrot documentation
Documentation for the Paarrot Matrix client (Cinny fork). Use this index to find feature handoffs, API references, and developer guides.
## Handoff docs (start here)
Per-feature handoff folders live under [`handoff/features/`](./handoff/features/). Each folder has a `HANDOFF.md` with architecture, key files, data model, and maintenance notes.
New feature? Copy [`handoff/TEMPLATE.md`](./handoff/TEMPLATE.md) into `handoff/features/<feature-name>/HANDOFF.md` and add a row below.
### Platform & shell
| Feature | Handoff |
|---------|---------|
| Electron desktop shell | [electron-shell](./handoff/features/electron-shell/HANDOFF.md) |
| Android (Capacitor/Tauri) | [android](./handoff/features/android/HANDOFF.md) |
| Client chrome (title bar, splash, welcome) | [client-chrome](./handoff/features/client-chrome/HANDOFF.md) |
| Local HTTP API | [local-api](./handoff/features/local-api/HANDOFF.md) |
| Stream Deck integration | [streamdeck](./handoff/features/streamdeck/HANDOFF.md) |
| Background notifications | [background-notifications](./handoff/features/background-notifications/HANDOFF.md) |
### Core client
| Feature | Handoff |
|---------|---------|
| Authentication | [authentication](./handoff/features/authentication/HANDOFF.md) |
| Matrix client (init, sync, providers) | [matrix-client](./handoff/features/matrix-client/HANDOFF.md) |
| State management (Jotai) | [state-management](./handoff/features/state-management/HANDOFF.md) |
| Routing & navigation | [routing-and-navigation](./handoff/features/routing-and-navigation/HANDOFF.md) |
| E2E encryption & devices | [e2e-and-devices](./handoff/features/e2e-and-devices/HANDOFF.md) |
### Navigation & panels
| Feature | Handoff |
|---------|---------|
| Home & sidebar | [home-and-sidebar](./handoff/features/home-and-sidebar/HANDOFF.md) |
| Room nav (channel rows) | [room-nav](./handoff/features/room-nav/HANDOFF.md) |
| Direct messages | [direct-messages](./handoff/features/direct-messages/HANDOFF.md) |
| Inbox & invites | [inbox-and-invites](./handoff/features/inbox-and-invites/HANDOFF.md) |
| Explore (public rooms) | [explore](./handoff/features/explore/HANDOFF.md) |
| Join before navigate | [join-before-navigate](./handoff/features/join-before-navigate/HANDOFF.md) |
### Messaging
| Feature | Handoff |
|---------|---------|
| Room timeline | [room-timeline](./handoff/features/room-timeline/HANDOFF.md) |
| Editor & composer | [editor-and-composer](./handoff/features/editor-and-composer/HANDOFF.md) |
| Message rendering (markdown, HTML) | [message-rendering](./handoff/features/message-rendering/HANDOFF.md) |
| Media & URL preview | [media-and-url-preview](./handoff/features/media-and-url-preview/HANDOFF.md) |
| Message search | [message-search](./handoff/features/message-search/HANDOFF.md) |
| Global search (quick nav) | [global-search](./handoff/features/global-search/HANDOFF.md) |
### Rooms, spaces & creation
| Feature | Handoff |
|---------|---------|
| Create flows (room/space/DM) | [create-flows](./handoff/features/create-flows/HANDOFF.md) |
| Room settings | [room-settings](./handoff/features/room-settings/HANDOFF.md) |
| Space settings | [space-settings](./handoff/features/space-settings/HANDOFF.md) |
| Common settings (shared pages) | [common-settings](./handoff/features/common-settings/HANDOFF.md) |
| Sub-rooms | [sub-rooms](./handoff/features/sub-rooms/HANDOFF.md) |
| Lobby (space card view) | [lobby-forums](./handoff/features/lobby-forums/HANDOFF.md) |
| Forum spaces (post feed UI) | [forum](./handoff/features/forum/HANDOFF.md) |
| Room App UI (bot-driven) | [room-app-ui](./handoff/features/room-app-ui/HANDOFF.md) |
### Settings & customization
| Feature | Handoff |
|---------|---------|
| User settings | [user-settings](./handoff/features/user-settings/HANDOFF.md) |
| Themes & appearance | [themes-and-appearance](./handoff/features/themes-and-appearance/HANDOFF.md) |
| Emojis & stickers | [emoji-stickers](./handoff/features/emoji-stickers/HANDOFF.md) |
| Custom emoji packs | [custom-emoji-packs](./handoff/features/custom-emoji-packs/HANDOFF.md) |
| Avatar metadata | [avatar-metadata](./handoff/features/avatar-metadata/HANDOFF.md) |
| Embed filters | [embed-filters](./handoff/features/embed-filters/HANDOFF.md) |
| Developer tools | [developer-tools](./handoff/features/developer-tools/HANDOFF.md) |
### Real-time & extensions
| Feature | Handoff |
|---------|---------|
| Voice & video calls | [voice-calls](./handoff/features/voice-calls/HANDOFF.md) |
| Plugin system | [plugins](./handoff/features/plugins/HANDOFF.md) |
## API & plugin references
| Doc | Description |
|-----|-------------|
| [API.md](./API.md) | Full local HTTP API reference (port 33384) |
| [API-QUICKSTART.md](./API-QUICKSTART.md) | Quick start for the local API |
| [PLUGINS.md](./PLUGINS.md) | Plugin system user guide |
| [PLUGIN_API.md](./PLUGIN_API.md) | Full plugin API reference |
| [PLUGIN_BUTTON_API.md](./PLUGIN_BUTTON_API.md) | UI button injection API |
| [PLUGIN_SYSTEM_IMPLEMENTATION.md](./PLUGIN_SYSTEM_IMPLEMENTATION.md) | Internal plugin architecture |
Plugin development guide (in-app): [`src/app/features/settings/plugins/PLUGIN_DEVELOPMENT.md`](../src/app/features/settings/plugins/PLUGIN_DEVELOPMENT.md)
## Repo layout (docs-related)
```
cinny/docs/
README.md ← you are here
handoff/
README.md ← how to write handoff docs
TEMPLATE.md ← copy for new features
features/
<feature-name>/
HANDOFF.md
API.md ← reference docs (kept at root for links)
PLUGINS.md
...
```
+53
View File
@@ -0,0 +1,53 @@
# Handoff documentation
Handoff docs capture what a new maintainer needs to own a feature: behavior, architecture, data model, sharp edges, and how to verify changes.
## When to write one
Create or update a handoff when:
- A feature is Paarrot-specific (not vanilla Cinny upstream)
- The feature spans multiple layers (UI + Matrix + Electron/Android)
- You are about to hand work to another person or pause development
Inherited Cinny features (basic room timeline, auth flows, etc.) do not need handoffs unless Paarrot has materially changed them.
## Folder convention
```
handoff/features/<kebab-case-name>/
HANDOFF.md
```
Use short, product-facing names: `voice-calls`, `sub-rooms`, `local-api`.
## How to fill in a handoff
1. Copy [`TEMPLATE.md`](./TEMPLATE.md) to `features/<name>/HANDOFF.md`
2. Fill every section — delete "Add your extra things here" placeholders
3. Link to existing reference docs instead of duplicating them
4. Add the feature to the table in [`../README.md`](../README.md)
5. List real file paths (grep the codebase; do not guess)
## Sections explained
| Section | Purpose |
|---------|---------|
| **Summary** | One paragraph: what it does and why it exists |
| **User-facing behavior** | What users see and configure |
| **Architecture** | Layers, main modules, request/event flow |
| **Key files** | Paths a maintainer will touch first |
| **Data model** | Matrix state events, account data, local storage |
| **Dependencies** | External services, npm packages, OS APIs |
| **Integration points** | Other features, IPC, plugins, API |
| **Testing** | Manual steps and any automated tests |
| **Known issues** | Bugs, limitations, tech debt |
| **Related docs** | Links to API refs, READMEs, upstream specs |
## Keeping handoffs current
Update the handoff in the same PR when you:
- Add a new Matrix event type or account data key
- Change IPC or HTTP API contracts
- Move or rename core modules
+67
View File
@@ -0,0 +1,67 @@
# <Feature name> — handoff
> Copy this file to `handoff/features/<feature-name>/HANDOFF.md` and replace all placeholders.
## Summary
<!-- One paragraph: what this feature does and why Paarrot has it. -->
## User-facing behavior
<!-- What users see, where in the UI, and what settings exist. -->
## Architecture
<!-- High-level flow: UI → hooks/services → Matrix/Electron/OS. -->
```
<!-- Optional ASCII or mermaid diagram -->
```
## Key files
| Path | Role |
| -------------- | --------------------- |
| `path/to/file` | <!-- what it does --> |
## Data model
<!-- Matrix state events, account data types, local storage keys. -->
| Key / event | Scope | Shape |
| ----------- | ----- | ----- |
| | | |
## Dependencies
<!-- npm packages, external APIs, OS permissions. -->
## Integration points
<!-- Other features, local API, plugins, IPC channels. -->
## Testing
### Manual
1. <!-- step -->
### Automated
<!-- test files or "none yet" -->
## Known issues & gotchas
<!-- Sharp edges, race conditions, platform differences. -->
## Future work
<!-- Planned improvements or open questions. -->
## Related docs
- <!-- links -->
## Add your extra things here
<!-- Feature-specific notes: rollout flags, server requirements, MSC numbers, etc. -->
+88
View File
@@ -0,0 +1,88 @@
# Android (Capacitor / Tauri) — handoff
## Summary
Paarrot ships an Android build via Capacitor and/or Tauri (`src-tauri/`, `cinny/capacitor.config.json`). Mobile-specific code handles native notifications, UnifiedPush background sync, share intents, and platform detection branching away from Electron APIs.
## User-facing behavior
- Native Android app with Paarrot UI (WebView)
- Share into Paarrot from other apps (images/files → room upload draft)
- Background notifications via UnifiedPush (not FCM-only)
- No local HTTP API on mobile (Electron-only)
## Architecture
```
Capacitor/Tauri shell
→ WebView loads cinny bundle
ClientNonUIFeatures.tsx
→ isCapacitorNative / isTauri branches
backgroundSync.ts → UnifiedPush + Matrix pusher
androidShare.ts → share intent → room draft
tauri.ts → native notification APIs
```
## Key files
| Path | Role |
| ---------------------------------------------------- | --------------------------------- |
| `cinny/capacitor.config.json` | Capacitor app id, web dir |
| `src-tauri/src/main.rs` | Tauri Android entry |
| `cinny/src/app/utils/tauri.ts` | Platform detection, notifications |
| `cinny/src/app/utils/backgroundSync.ts` | UnifiedPush registration |
| `cinny/src/app/utils/androidShare.ts` | Share target handling |
| `cinny/src/app/pages/client/ClientNonUIFeatures.tsx` | Share listener wiring |
## Data model
Same as background notifications (`paarrot.unifiedpush.*` localStorage).
Share payloads: ephemeral in-memory until user picks room.
## Dependencies
- Capacitor plugins / Tauri mobile toolchain
- UnifiedPush distributor (ntfy, etc.)
- Android notification icon resources
## Integration points
- **background-notifications**: primary overlap
- **Room input drafts**: `roomIdToUploadItemsAtomFamily` for shared files
- **NOT Electron**: `initPaarrotAPI` skips on mobile webview
## Testing
### Manual
1. Build Android APK/AAB per project scripts.
2. Share image from Gallery → Paarrot → pick room → verify upload draft.
3. Background app; trigger mention; verify UP notification.
4. Tap notification → opens correct room.
### Automated
- None on device CI in repo (check Gitea workflow)
## Known issues & gotchas
- `ANDROID_NOTIFICATION_SMALL_ICON = 'ic_stat_paarrot'` must exist in Android res
- UnifiedPush without distributor shows user-facing error string
- Feature parity gap vs desktop (plugins, Stream Deck, local API)
- Test `isTauri` vs `isCapacitorNative` — both may be true in some builds
## Future work
- iOS Capacitor target
- Play Store release pipeline docs
- Mobile plugin sandbox policy
## Related docs
- [background-notifications HANDOFF](../background-notifications/HANDOFF.md)
## Add your extra things here
- `listenForAndroidShares`, `getPendingAndroidShare`, `materializeSharedFile` in `androidShare.ts`
- Capacitor app name in `capacitor.config.json` — verify `appId` matches push config
@@ -0,0 +1,97 @@
# Authentication — handoff
## Summary
Auth covers login, registration, password reset, SSO, and server selection before the Matrix client starts. Sessions are persisted locally and restored on app launch via `ClientRoot`.
## User-facing behavior
- Pick homeserver (ServerPicker) or use default from config
- Login: password, token, SSO redirect
- Register: password-based with optional email flows
- Reset password flow
- Auth layout shows Paarrot branding
- Device display name defaults to `Paarrot`
## Architecture
```
Unauthenticated routes (AuthLayout)
→ Login / Register / ResetPassword / SSOLogin
→ session written to localStorage (sessions.ts)
ClientRoot (authenticated)
→ initClient(session) → startClient(mx)
```
## Key files
| Path | Role |
| ------------------------------------------------------------ | ------------------------ |
| `cinny/src/app/pages/auth/login/Login.tsx` | Login hub |
| `cinny/src/app/pages/auth/login/PasswordLoginForm.tsx` | Password login |
| `cinny/src/app/pages/auth/login/TokenLogin.tsx` | Access token login |
| `cinny/src/app/pages/auth/SSOLogin.tsx` | SSO redirect |
| `cinny/src/app/pages/auth/register/Register.tsx` | Registration |
| `cinny/src/app/pages/auth/register/PasswordRegisterForm.tsx` | Password register |
| `cinny/src/app/pages/auth/reset-password/ResetPassword.tsx` | Password reset |
| `cinny/src/app/pages/auth/ServerPicker.tsx` | Homeserver selection |
| `cinny/src/app/pages/auth/AuthLayout.tsx` | Auth chrome + logo |
| `cinny/src/app/pages/auth/login/loginUtil.ts` | Login helpers |
| `cinny/src/app/pages/auth/register/registerUtil.ts` | Register helpers |
| `cinny/src/app/state/sessions.ts` | Session storage |
| `cinny/src/client/initMatrix.ts` | Client init from session |
| `cinny/src/app/pages/afterLoginRedirectPath.ts` | Post-login redirect |
## Data model
| Key | Storage | Content |
| --------------------------- | --------------------- | ---------------------------------------- |
| Session store | localStorage | access token, user id, device id, hs url |
| `setAfterLoginRedirectPath` | sessionStorage/memory | deep link target after login |
## Dependencies
- `matrix-js-sdk` login/register APIs
- Homeserver `.well-known` / login flows (`useParsedLoginFlows`, `useAuthFlows`)
- OIDC/SSO via redirect URLs
## Integration points
- **Router**: unauthenticated vs `ClientRoot` split
- **matrix-client**: `initClient` consumes session
- **Device verification**: post-login verification UI in router
## Testing
### Manual
1. Login with password on test homeserver.
2. Token login with valid access token.
3. SSO flow if server supports it.
4. Register new account; verify email if required.
5. Logout clears session and returns to login.
### Automated
- None
## Known issues & gotchas
- `initial_device_display_name: 'Paarrot'` hardcoded in login/register forms
- Session logout from server triggers full localStorage clear + reload
- Server picker URL must match actual homeserver capabilities
## Future work
- Multi-account without full reload (see account-switcher)
- Passkey / WebAuthn if upstream adds support
## Related docs
- [matrix-client HANDOFF](../matrix-client/HANDOFF.md)
- [e2e-and-devices HANDOFF](../e2e-and-devices/HANDOFF.md)
## Add your extra things here
- Auth routes: `LOGIN_PATH`, `REGISTER_PATH`, `RESET_PASSWORD_PATH` in `paths.ts`
- `UnAuthRouteThemeManager` vs `AuthRouteThemeManager` in ThemeManager.tsx
@@ -0,0 +1,92 @@
# Avatar metadata — handoff
## Summary
Paarrot embeds profile accent metadata **inside image files** (PNG, JPEG, WebP, GIF) so avatar colors, banners, gradients, and border colors travel with the MXC upload. Other Paarrot clients read this metadata to theme profile UI without extra Matrix account data fields.
## User-facing behavior
- **Settings → Account → Profile**: pick accent color (and related styling) applied to avatar image on save
- Profile viewers extract color/banner from avatar HTTP URL for themed headers
- Works across image formats users commonly upload
## Architecture
```
Profile settings UI
→ embedMetadata / embedColor (imageMetadata.ts)
→ format-specific: pngMetadata, jpegMetadata, webpMetadata, gifMetadata
→ upload to Matrix
Other clients / Profile.tsx
→ extractMetadataFromImage(fetch avatar)
→ apply CSS variables / banner URL
```
## Key files
| Path | Role |
| ----------------------------------------------------- | ----------------------------- |
| `cinny/src/app/utils/imageMetadata.ts` | Unified embed/extract API |
| `cinny/src/app/utils/pngMetadata.ts` | PNG tEXt chunks |
| `cinny/src/app/utils/jpegMetadata.ts` | JPEG XMP APP1 |
| `cinny/src/app/utils/webpMetadata.ts` | WebP XMP |
| `cinny/src/app/utils/gifMetadata.ts` | GIF application extension |
| `cinny/src/app/features/settings/account/Profile.tsx` | Settings UI + upload pipeline |
## Data model
Metadata keys (embedded in binary image, not Matrix):
| Key | Format | Notes |
| --------------------- | ------------------- | ---------------- |
| `paarrot:color` | All | Accent color hex |
| `paarrot:banner` | PNG (+ unified API) | Banner image URL |
| `paarrot:borderColor` | PNG | Border accent |
| `paarrot:gradient` | PNG | Gradient spec |
XMP namespace: `http://paarrot.app/ns/1.0/`
## Dependencies
- Browser `ArrayBuffer` / `Uint8Array` parsing
- No server-side processing — client-only before upload
## Integration points
- **Profile display**: user profile cards read metadata from avatar URL
- **Image upload flow**: must re-encode image with metadata before `uploadContent`
## Testing
### Manual
1. Set profile color in settings; save avatar.
2. Download avatar MXC; verify metadata with hex dump or Paarrot on second account.
3. Repeat for PNG, JPEG, WebP, GIF uploads.
4. Remove color; verify strip functions work.
### Automated
- None — good candidate for unit tests on chunk parsers
## Known issues & gotchas
- Metadata stripped if user uploads through non-Paarrot client
- Large images: re-encoding memory cost on mobile
- Console logging in `pngMetadata.ts` (`extractColorFromPNG`) — noisy in prod
- Federation: only Paarrot-aware clients interpret metadata
## Future work
- Unit tests per format parser
- Fallback to account data if metadata missing
- Document binary spec in standalone spec doc
## Related docs
- None
## Add your extra things here
- Entry points: `extractPaarrotMetadata`, `embedPaarrotMetadata`, `embedPaarrotColor` in `imageMetadata.ts`
- Profile comment: "Stored in avatar image metadata, visible to other Paarrot users"
@@ -0,0 +1,95 @@
# Background notifications — handoff
## Summary
Paarrot keeps users notified of Matrix activity when the app is in the background: desktop tray/favicon badges, system notifications (Electron/Tauri/Android), and Android **UnifiedPush** for reliable mobile push without Google FCM dependency.
## User-facing behavior
- Unread counts update favicon (Paarrot / unread / highlight variants)
- System notifications for mentions/DMs per notification settings
- Android: requires UnifiedPush distributor (e.g. ntfy); user prompted if missing
- Foreground/background state affects sync strategy
## Architecture
```
ClientNonUIFeatures.tsx
→ FaviconUpdater (roomToUnread atom)
→ notification listeners (tauri.ts sendNotification)
→ initPaarrotAPI + background sync lifecycle
backgroundSync.ts
→ UnifiedPush registration, pusher setup
→ setAppForegroundState / startBackgroundSync / stopBackgroundSync
tauri.ts / electron main
→ OS notification APIs, Android small icon ic_stat_paarrot
```
## Key files
| Path | Role |
| ---------------------------------------------------------------------- | ------------------------------------------------------- |
| `cinny/src/app/pages/client/ClientNonUIFeatures.tsx` | Favicon, notifications, API init, background sync hooks |
| `cinny/src/app/utils/backgroundSync.ts` | Pushers, UnifiedPush, foreground state |
| `cinny/src/app/utils/tauri.ts` | Tauri/Capacitor notification helpers |
| `cinny/src/app/features/settings/notifications/SystemNotification.tsx` | Permission UX |
| `electron/main.js` | Tray, notification IPC (if applicable) |
| `src-tauri/src/main.rs` | Tauri Android shell |
## Data model
| Key | Storage | Purpose |
| ------------------------- | ------------------- | ----------------- |
| `paarrot.unifiedpush.*` | localStorage prefix | UP endpoint state |
| `com.paarrot.app.android` | Pusher app id base | Android pushers |
| Matrix pusher | Homeserver | HTTP push gateway |
## Dependencies
- UnifiedPush distributor app on Android
- Notification permission (browser/OS)
- Homeserver pusher support
- `matrix-js-sdk` sync
## Integration points
- **Settings → Notifications**: rules + system permission
- **DirectTab / sidebar**: custom Paarrot SVG favicon states
- **Deep links**: notification tap → `setupNotificationTapListener`
## Testing
### Manual
1. Desktop: background app; send mention; verify system notification.
2. Verify favicon switches unread/highlight with counts.
3. Android: install ntfy; verify push when app killed.
4. Toggle notification settings; verify respect mute rules.
### Automated
- None
## Known issues & gotchas
- UnifiedPush user education string in `backgroundSync.ts` if no distributor
- Multiple runtimes: `isTauri`, `isElectron`, `isCapacitorNative` branch logic
- Pusher registration races on fast login/logout
- Android small icon: `ic_stat_paarrot` must exist in Android resources
- Background wake (`MatrixSyncService`) must filter by push rules / unread_notifications; a push for one room used to notify for every new message in the sync batch
## Future work
- iOS push strategy
- Notification action buttons (reply, mark read)
- Per-room notification channels on Android
## Related docs
- Matrix push gateway docs (upstream)
## Add your extra things here
- Constants: `PUSHER_APP_ID_BASE`, `PUSHER_STORAGE_PREFIX` in `backgroundSync.ts`
- Logo assets: `paarrot.svg`, `paarrot-unread.svg`, `paarrot-highlight.svg` in `public/res/svg/`
- Android notify filter: mute / mentions / default-room behavior lives in `MatrixSyncService.resolveRoomNotifyMode`
@@ -0,0 +1,95 @@
# Client chrome — handoff
## Summary
App shell UI outside core chat: custom title bar (Electron), splash screen, welcome page, account switcher, update notifications, sync status, spec version warnings, and feature capability checks.
## User-facing behavior
- **Title bar**: drag region, window controls, room title, account menu (desktop)
- **Splash**: loading spinner during client init
- **Welcome page**: first-run / empty state hints
- **Account switcher**: switch between logged-in accounts (if multi-session)
- **Update notification**: new version available (electron-updater)
- **Feature check**: block unsupported browsers
- **Spec versions**: warn on old homeserver
## Architecture
```
ClientRoot → TitleBar + AccountSwitcher + children
SplashScreen during matrix init
WelcomePage on empty states
UpdateNotification component
FeatureCheck wraps App
SpecVersions in ClientRoot
```
## Key files
| Path | Role |
| --------------------------------------------------------------------- | ------------------------ |
| `cinny/src/app/components/title-bar/TitleBar.tsx` | Desktop title bar |
| `cinny/src/app/components/splash-screen/SplashScreen.tsx` | Splash |
| `cinny/src/app/pages/client/WelcomePage.tsx` | Welcome / download links |
| `cinny/src/app/components/account-switcher/AccountSwitcher.tsx` | Multi-account |
| `cinny/src/app/components/update-notification/UpdateNotification.tsx` | Auto-update UI |
| `cinny/src/app/pages/FeatureCheck.tsx` | Browser capability gate |
| `cinny/src/app/pages/client/SpecVersions.tsx` | HS version warning |
| `cinny/src/app/pages/client/SyncStatus.tsx` | Sync indicator |
| `cinny/src/app/pages/ConfigConfig.tsx` | Config load error UI |
| `cinny/src/app/components/ClientConfigLoader.tsx` | Load config.json |
## Data model
| Key | Storage |
| -------------- | ---------------------------- |
| Sessions | multi-account in sessions.ts |
| electron-store | window bounds (main process) |
## Dependencies
- Electron IPC for window controls
- `electron-updater` for updates
- `clientConfig` JSON (homeserver default, hash router, etc.)
## Integration points
- **electron-shell**: title bar IPC
- **matrix-client**: splash until sync ready
- **authentication**: account switcher sessions
## Testing
### Manual
1. Desktop: minimize/maximize/close via title bar.
2. Slow network: splash shows until ready.
3. Trigger update check in dev (if configured).
4. Unsupported browser: FeatureCheck message.
### Automated
- None
## Known issues & gotchas
- Title bar only on Electron — web uses browser chrome
- Welcome page links point to GitHub releases — verify URLs match your distribution (Gitea vs GitHub)
- `FeatureCheck` may block older WebViews on Android
## Future work
- Unified status bar (sync + update + call status)
- macOS traffic lights styling
## Related docs
- [electron-shell HANDOFF](../electron-shell/HANDOFF.md)
- [matrix-client HANDOFF](../matrix-client/HANDOFF.md)
- [authentication HANDOFF](../authentication/HANDOFF.md)
## Add your extra things here
- Title bar shows `Paarrot` prefix + dynamic room/space title suffix
- `ClientConfigLoader` reads public config — document config.json schema in client config handoff if split later
@@ -0,0 +1,82 @@
# Common settings — handoff
## Summary
Shared setting pages used by both room and space settings overlays: general (profile, join rules, encryption, embed filters), members, permissions editors, emojis/stickers, and developer tools (raw state events).
## User-facing behavior
- Same UI whether editing a room or space context
- Members list with kick/ban/invite
- Power level editor
- Room emoji packs
- Developer tools: send custom state events
## Architecture
```
common-settings/
general/ — RoomProfile, RoomJoinRules, RoomEncryption, EmbedFilters
members/ — Members.tsx
permissions/ — PowersEditor, PermissionGroups
emojis-stickers/
developer-tools/ — StateEventEditor, SendRoomEvent
Imported by room-settings and space-settings shells
```
## Key files
| Path | Role |
| --------------------------------------------------------------------- | ----------------------- |
| `cinny/src/app/features/common-settings/general/RoomProfile.tsx` | Name/topic/avatar |
| `cinny/src/app/features/common-settings/general/RoomJoinRules.tsx` | Join rules |
| `cinny/src/app/features/common-settings/general/RoomEncryption.tsx` | E2E toggle |
| `cinny/src/app/features/common-settings/general/EmbedFilters.tsx` | Room-wide embed filters |
| `cinny/src/app/features/common-settings/members/Members.tsx` | Member management |
| `cinny/src/app/features/common-settings/permissions/PowersEditor.tsx` | Power levels |
| `cinny/src/app/features/common-settings/developer-tools/` | Dev event tools |
## Data model
Standard Matrix room/space state events. Embed filters: `im.paarrot.room.embed_filters`.
## Dependencies
- Permission hooks, member list hooks
## Integration points
- **room-settings** / **space-settings**: parent shells
- **embed-filters**: room-wide pattern UI
- **emoji-stickers**: room pack management
## Testing
### Manual
1. Open members from room settings; invite user.
2. Set embed filter pattern as admin.
3. Developer tools: send test state event (staging only).
### Automated
- None
## Known issues & gotchas
- `DevelopTools` naming typo inherited from upstream
- Encryption enable is irreversible — UI must warn
## Future work
- Extract embed filters to own settings section
## Related docs
- [room-settings HANDOFF](../room-settings/HANDOFF.md)
- [space-settings HANDOFF](../space-settings/HANDOFF.md)
- [embed-filters HANDOFF](../embed-filters/HANDOFF.md)
## Add your extra things here
- `PermissionGroups.tsx` — grouped permission UI
@@ -0,0 +1,88 @@
# Create flows — handoff
## Summary
UI for creating rooms, spaces, direct chats, and adding existing rooms to spaces. Includes modal renderers mounted at client root and join/create page routes.
## User-facing behavior
- Create room modal (optionally as sub-room of parent)
- Create space modal
- Create DM / group DM
- Add existing room to space
- Create tab in sidebar for quick actions
## Architecture
```
CreateRoomModalRenderer → CreateRoomModal.tsx
CreateSpaceModalRenderer → CreateSpaceModal.tsx
create-chat/ — DM creation
add-existing/ — pick room to add to space
pages/client/create/Create.tsx — create hub
pages/client/direct/DirectCreate.tsx
State: createRoomModal.ts, createSpaceModal.ts
```
## Key files
| Path | Role |
| ---------------------------------------------------------- | ------------------------------------ |
| `cinny/src/app/features/create-room/CreateRoomModal.tsx` | Room create + sub-room parent update |
| `cinny/src/app/features/create-space/CreateSpaceModal.tsx` | Space create |
| `cinny/src/app/features/create-chat/` | DM flows |
| `cinny/src/app/features/add-existing/AddExisting.tsx` | Add to space |
| `cinny/src/app/features/create-room/CreateRoom.tsx` | Standalone create page |
| `cinny/src/app/features/create-space/CreateSpace.tsx` | Standalone space create |
| `cinny/src/app/state/createRoomModal.ts` | Modal state + parent room id |
| `cinny/src/app/state/createSpaceModal.ts` | Space modal state |
| `cinny/src/app/pages/client/create/Create.tsx` | Create hub route |
| `cinny/src/app/pages/client/home/CreateRoom.tsx` | Home create entry |
## Data model
Creates standard Matrix rooms/spaces. Sub-room creation also updates `im.paarrot.sub_rooms` on parent.
## Dependencies
- matrix-js-sdk `createRoom` APIs
- Space parent/child events
## Integration points
- **sub-rooms**: parent id in create room modal
- **room-nav**: opens create sub-room modal
- **routing-and-navigation**: Create routes, modal renderers
## Testing
### Manual
1. Create public room; verify join.
2. Create sub-room under parent; appears in home tree.
3. Create space; add existing room.
4. Start DM from DirectCreate.
### Automated
- None
## Known issues & gotchas
- Sub-room failure after room created leaves orphan — see sub-rooms handoff
- `CreateRoomKindSelector` for room type variants
- Forum room type may need specific create options
## Future work
- Create forum space template
- Batch add rooms to space
## Related docs
- [sub-rooms HANDOFF](../sub-rooms/HANDOFF.md)
- [routing-and-navigation HANDOFF](../routing-and-navigation/HANDOFF.md)
## Add your extra things here
- `useOpenCreateSubRoomModal` hook opens modal with `parentRoomId`
@@ -0,0 +1,87 @@
# Custom emoji packs — handoff
## Summary
Built-in (non-plugin) custom emoji system: read image packs from room state, resolve shortcodes to images in messages and autocomplete. Distinct from user-installed JS plugins but shares pack format concepts.
## User-facing behavior
- Room/space emoji packs in settings
- `:shortcode:` in composer resolves to pack image
- Pack viewer for browsing stickers/emojis
- Integrates with `im.ponies.room_emotes` and pack MXC structure
## Architecture
```
plugins/custom-emoji/
PackMetaReader, PackImageReader, PackImagesReader
ImagePack.ts, PackAddress.ts
emoji plugin (plugins/emoji.ts) — render shortcodes
settings emojis-stickers + common-settings emojis
```
## Key files
| Path | Role |
| ------------------------------------------------------------ | ------------------- |
| `cinny/src/app/plugins/custom-emoji/PackMetaReader.ts` | Read pack metadata |
| `cinny/src/app/plugins/custom-emoji/PackImageReader.ts` | Single image |
| `cinny/src/app/plugins/custom-emoji/PackImagesReader.ts` | Bulk images |
| `cinny/src/app/plugins/custom-emoji/ImagePack.ts` | Pack model |
| `cinny/src/app/plugins/custom-emoji/types.ts` | Types |
| `cinny/src/app/plugins/emoji.ts` | Shortcode rendering |
| `cinny/src/app/plugins/recent-emoji.ts` | Recent emoji helper |
| `cinny/src/app/components/image-pack-view/ImagePackView.tsx` | Pack browser UI |
| `cinny/src/app/hooks/useImagePackRooms.ts` | Rooms with packs |
## Data model
| Event | Purpose |
| ----------------------- | -------------------------------------- |
| `im.ponies.room_emotes` | Room emoji pack definition |
| Image pack account data | User/global packs (see emoji-stickers) |
## Dependencies
- MXC media URLs
- `useMediaAuthentication` for protected media
## Integration points
- **emoji-stickers**: settings UI for packs + Telegram import
- **message-rendering**: emoji.ts in parse pipeline
- **editor-and-composer**: EmoticonAutocomplete
## Testing
### Manual
1. Add emoji pack to room.
2. Type `:shortcode:` in composer; image inserts.
3. View pack in ImagePackView.
4. Encrypted room pack visibility.
### Automated
- None
## Known issues & gotchas
- Pack address parsing in `PackAddress.ts` — MXC format sensitive
- Large packs slow autocomplete — consider lazy load
- Telegram import creates separate pack ids (`telegram_*`)
## Future work
- Pack CDN cache
- Animated emoji support audit
## Related docs
- [emoji-stickers HANDOFF](../emoji-stickers/HANDOFF.md)
- [message-rendering HANDOFF](../message-rendering/HANDOFF.md)
## Add your extra things here
- `StateEvent.PoniesRoomEmotes = 'im.ponies.room_emotes'` in room.ts
@@ -0,0 +1,75 @@
# Developer tools — handoff
## Summary
Power-user tools for debugging Matrix state: view/edit account data, send custom room events, and inspect raw JSON. Available in user settings and room/space common-settings.
## User-facing behavior
- **Settings → Developer tools**: account data viewer
- **Room settings → Developer tools**: send state events, room account data
- Raw JSON editors with validation warnings
## Architecture
```
settings/developer-tools/
DevelopTools.tsx, AccountData.tsx
common-settings/developer-tools/
DevelopTools.tsx, StateEventEditor.tsx, SendRoomEvent.tsx
```
## Key files
| Path | Role |
| ----------------------------------------------------------------------------- | -------------------- |
| `cinny/src/app/features/settings/developer-tools/DevelopTools.tsx` | User-level dev tools |
| `cinny/src/app/features/settings/developer-tools/AccountData.tsx` | Account data viewer |
| `cinny/src/app/features/common-settings/developer-tools/DevelopTools.tsx` | Room dev tools entry |
| `cinny/src/app/features/common-settings/developer-tools/StateEventEditor.tsx` | Edit state events |
| `cinny/src/app/features/common-settings/developer-tools/SendRoomEvent.tsx` | Send events |
## Data model
Direct read/write to Matrix account data and state events — **production danger**.
## Dependencies
- matrix-js-sdk low-level APIs
## Integration points
- **user-settings**: developer tab
- **common-settings**: per-room tools
## Testing
### Manual
1. View account data keys on staging account.
2. Send harmless custom state event in test room.
3. Verify permission denied without power level.
### Automated
- None
## Known issues & gotchas
- No guard rails — can break rooms with bad state events
- Should be hidden or disabled in production builds for normal users (currently settings-gated only)
- Typo `DevelopTools` vs `DeveloperTools` in filenames
## Future work
- Feature flag via client config
- Event diff viewer
## Related docs
- [user-settings HANDOFF](../user-settings/HANDOFF.md)
- [common-settings HANDOFF](../common-settings/HANDOFF.md)
## Add your extra things here
- Only use on test homeservers — document internal MSC event types here when experimenting
@@ -0,0 +1,83 @@
# Direct messages — handoff
## Summary
The DMs panel lists direct chats and provides flows to start new conversations. Uses `m.direct` account data to identify DM rooms.
## User-facing behavior
- Sidebar Direct tab shows DM rooms sorted
- Create new DM / group chat
- DM room opens in direct route layout
- Paarrot logo badge states on tab (shared with home tab styling)
## Architecture
```
client/direct/
Direct.tsx — DM room list page
DirectCreate.tsx — start new chat
useDirectRooms.ts — room list from m.direct
RoomProvider.tsx — route-level room context
mDirectAtom — direct room index
```
## Key files
| Path | Role |
| ----------------------------------------------------- | --------------- |
| `cinny/src/app/pages/client/direct/Direct.tsx` | DM list |
| `cinny/src/app/pages/client/direct/DirectCreate.tsx` | Create DM |
| `cinny/src/app/pages/client/direct/useDirectRooms.ts` | List logic |
| `cinny/src/app/pages/client/sidebar/DirectTab.tsx` | Sidebar tab |
| `cinny/src/app/state/mDirectList.ts` | `mDirectAtom` |
| `cinny/src/app/hooks/useDirectUsers.ts` | DM user helpers |
## Data model
| Key | Scope |
| ---------- | ------------------------------------------ |
| `m.direct` | User account data — map userId → roomIds[] |
## Dependencies
- matrix-js-sdk DM APIs
- `is_direct` on member events
## Integration points
- **home-and-sidebar**: DirectTab
- **routing-and-navigation**: `DIRECT_PATH`
- **create-flows**: create-chat feature
- **room-timeline**: same Room component for DM rooms
## Testing
### Manual
1. Start DM with user; appears in direct list.
2. Group DM with multiple users.
3. Unread badge on Direct tab.
### Automated
- None
## Known issues & gotchas
- `m.direct` can be stale — client may repair on sync
- DM vs private room distinction relies on account data
## Future work
- Pin favorite DMs
- DM search filter
## Related docs
- [home-and-sidebar HANDOFF](../home-and-sidebar/HANDOFF.md)
- [create-flows HANDOFF](../create-flows/HANDOFF.md)
## Add your extra things here
- `getDirectRoomPath` in pathUtils for DM room URLs
@@ -0,0 +1,92 @@
# E2E encryption & devices — handoff
## Summary
End-to-end encryption support via matrix-js-sdk crypto store: device verification, cross-signing, secret storage, key backup/export, and session management. Critical for secure DM and encrypted rooms.
## User-facing behavior
- Verify new logins / other sessions
- Export room keys backup (`paarrot-keys.txt`)
- Restore backup after verification
- View and rename devices; logout remote sessions
- Unverified sessions tab in sidebar
## Architecture
```
secretStorageKeys.ts + cryptoCallbacks
Devices.tsx, Verification.tsx, LocalBackup.tsx
DeviceVerification.tsx — incoming verification
BackupRestore.tsx — auto restore on verify
useSecretStorage, useKeyBackup, useVerificationRequest hooks
```
## Key files
| Path | Role |
| ---------------------------------------------------------- | --------------------- |
| `cinny/src/client/secretStorageKeys.ts` | SSSS key handling |
| `cinny/src/app/features/settings/devices/Devices.tsx` | Device list |
| `cinny/src/app/features/settings/devices/Verification.tsx` | Verification UI |
| `cinny/src/app/features/settings/devices/LocalBackup.tsx` | Key export |
| `cinny/src/app/features/settings/devices/OtherDevices.tsx` | Remote sessions |
| `cinny/src/app/components/DeviceVerification.tsx` | Incoming verify modal |
| `cinny/src/app/components/BackupRestore.tsx` | Auto restore |
| `cinny/src/app/components/SecretStorage.tsx` | Passphrase setup |
| `cinny/src/app/hooks/useSecretStorage.ts` | Secret storage API |
| `cinny/src/app/hooks/useKeyBackup.ts` | Backup API |
| `cinny/src/app/pages/client/sidebar/UnverifiedTab.tsx` | Unverified badge |
## Data model
| Store | Purpose |
| ------------------- | ----------------------------------------- |
| IndexedDB crypto | Olm account, Megolm sessions |
| SSSS | Cross-signing keys, backup key |
| Matrix account data | `m.cross_signing.*`, `m.secret_storage.*` |
## Dependencies
- matrix-js-sdk crypto module
- Secure random / Web Crypto
## Integration points
- **matrix-client**: crypto store init in initMatrix
- **authentication**: first login bootstrap
- **user-settings**: devices tab
## Testing
### Manual
1. Login second device; verify via emoji/SAS from first.
2. Export keys backup; file downloads.
3. Encrypted room: send message; decrypt on other device.
4. Logout remote session from devices list.
### Automated
- None
## Known issues & gotchas
- `handlingKeyConflict` in initMatrix on duplicate device keys
- Logout clears crypto store — must re-verify
- Backup passphrase loss = message history loss
## Future work
- Dehydrated devices support
- Better recovery key UX
## Related docs
- [matrix-client HANDOFF](../matrix-client/HANDOFF.md)
- [user-settings HANDOFF](../user-settings/HANDOFF.md)
## Add your extra things here
- Local backup filename: `paarrot-keys.txt` in LocalBackup.tsx
- `ReceiveSelfDeviceVerification` route component in Router.tsx
@@ -0,0 +1,92 @@
# Editor & composer — handoff
## Summary
The message composer is a **Slate**-based rich text editor with autocomplete for users, rooms, and emoticons. Converts between editor state and Matrix HTML/plaintext. Supports toolbar formatting, intents, and file paste/drop integration.
## User-facing behavior
- Type messages with bold/italic/code etc. (toolbar)
- `@user` and `#room` mentions with autocomplete popup
- `:emoji` emoticon autocomplete
- Paste images/files into composer
- Draft persistence per room
## Architecture
```
Editor.tsx (Slate)
→ Elements.tsx, Toolbar.tsx
→ autocomplete/ (User, Room, Emoticon)
→ input.ts / output.ts — Matrix format conversion
RoomInput.tsx wires Editor to send pipeline + uploads
text-area plugin (legacy/plain areas in some UI)
```
## Key files
| Path | Role |
| ----------------------------------------------- | ------------------------- |
| `cinny/src/app/components/editor/Editor.tsx` | Main Slate editor |
| `cinny/src/app/components/editor/Toolbar.tsx` | Formatting toolbar |
| `cinny/src/app/components/editor/input.ts` | Parse into editor |
| `cinny/src/app/components/editor/output.ts` | Serialize to Matrix |
| `cinny/src/app/components/editor/autocomplete/` | Mention/emoji menus |
| `cinny/src/app/features/room/RoomInput.tsx` | Room composer wrapper |
| `cinny/src/app/plugins/text-area/` | Plain text area utilities |
| `cinny/src/app/hooks/useFilePasteHandler.ts` | Paste files |
| `cinny/src/app/hooks/useFileDrop.ts` | Drag-drop files |
| `cinny/src/app/state/room/roomInputDrafts.ts` | Draft persistence |
## Data model
| Key | Storage |
| ------------------------------- | --------------------- |
| `roomIdToMsgDraftAtomFamily` | localStorage per room |
| `roomIdToUploadItemsAtomFamily` | pending uploads |
## Dependencies
- `slate`, `slate-react`
- `folds` UI primitives
## Integration points
- **room-timeline**: send on submit
- **emoji-stickers**: emoticon autocomplete + custom packs
- **plugins**: `text-composer-toolbar`, `composer-actions` slots
- **media-and-url-preview**: upload before send
## Testing
### Manual
1. Mention user and room; verify pill rendering in sent message.
2. Format bold/italic; verify HTML in `formatted_body`.
3. Reload mid-compose; draft restores.
4. Paste image; upload card appears.
### Automated
- `Editor.preview.tsx` exists for dev preview
## Known issues & gotchas
- `useCompositionEndTracking` in App.tsx for IME composition
- Slate types in `slate.d.ts` — keep custom elements typed
- Plain text vs HTML fallback for clients without HTML support
## Future work
- WYSIWYG markdown mode
- Draft sync across devices via account data
## Related docs
- [room-timeline HANDOFF](../room-timeline/HANDOFF.md)
- [emoji-stickers HANDOFF](../emoji-stickers/HANDOFF.md)
## Add your extra things here
- `plainToEditorInput`, `toPlainText` helpers exported from editor index
- Forum has separate composers: `ForumReplyComposer`, `ForumChatComposer`
@@ -0,0 +1,96 @@
# Electron desktop shell — handoff
## Summary
The desktop app wraps the Cinny/Paarrot web UI in Electron: custom title bar, system tray, deep links (`paarrot://`), auto-updates, plugin filesystem access, screen capture for calls, and the local HTTP API server.
## User-facing behavior
- Frameless/custom **title bar** with window controls (Windows/Linux)
- Minimize to **tray**; close may minimize instead of quit (platform config)
- `paarrot://` URL protocol for room links
- Auto-update checks (electron-updater)
- Plugins read/write under `%APPDATA%\paarrot\`
## Architecture
```
electron/main.js (main process)
→ BrowserWindow → Vite dev server or built cinny dist
→ IPC: plugins, screen capture, clipboard, updates
→ PaarrotAPIServer
→ Tray + protocol handler paarrot://
preload / contextBridge → window.electron in renderer
```
## Key files
| Path | Role |
| ------------------------------------------------- | ---------------------------- |
| `electron/main.js` | Main process entry |
| `electron/api-server.js` | Local HTTP API |
| `electron/preload.js` (if exists) | IPC bridge |
| `electron-builder.json5` | Packaging config |
| `package.json` (root) | `npm run dev`, build scripts |
| `dev-app-update.yml` | Update channel config |
| `cinny/src/app/components/title-bar/TitleBar.tsx` | Custom title bar UI |
| `build-resources/` | Linux after-install, icons |
## Data model
| Store | Tool | Contents |
| ---------------- | -------- | ------------------------- |
| `electron-store` | main.js | Window bounds, user prefs |
| UserData | Electron | plugins, caches |
Protocol: `PROTOCOL_SCHEME = 'paarrot'` in main.js
## Dependencies
- `electron`, `electron-updater`, `electron-store`
- `electron-builder` for CI releases
- Vite dev server port **38347**; static server **44548** in dev
## Integration points
- **local-api**: started with main window
- **Plugins**: filesystem paths under `paarrot` app name
- **Voice calls**: `desktopCapturer` for screen share
- **Deep links**: pending deep link queue until client ready
## Testing
### Manual
1. `npm run dev` — window loads, title bar draggable.
2. Register `paarrot://` link; opens correct room.
3. Tray icon present; restore from tray.
4. Build installer; auto-update check (staging).
5. Install plugin to AppData path; loader finds it.
### Automated
- CI: `.gitea/workflows/build.yml`
## Known issues & gotchas
- `isDev` detection: `NODE_ENV` or `!app.isPackaged`
- Protocol registration differs Windows vs Linux (`after-install.sh`)
- Single instance lock for deep links — see `pendingDeepLink` in main.js
- Title bar hit-testing CSS sensitive on Windows 11
## Future work
- macOS menu bar parity
- Code signing documentation for Windows
- Consolidate magic ports into shared config
## Related docs
- [local-api HANDOFF](../local-api/HANDOFF.md)
- Root [README.md](../../../../README.md) — build instructions
## Add your extra things here
- Dev URLs: `VITE_DEV_SERVER = http://localhost:38347`, `PORT = 44548`
- App userData folder name: `paarrot` (matches plugin paths in README)
@@ -0,0 +1,84 @@
# Embed filters — handoff
## Summary
Embed filters let users and room admins suppress URL preview/embeds for matching links. **Personal** filters live in per-room account data; **room-wide** filters are a room state event admins control. Patterns are regex strings tested against URLs before rendering embeds in the timeline and threads.
## User-facing behavior
- Per-user: configure patterns for a room (settings or thread UI — see consumers)
- Room admins: room-wide disabled patterns via `im.paarrot.room.embed_filters`
- Matching URLs skip embed cards (Giphy, Open Graph, etc.)
## Architecture
```
useRoomEmbedFilters (personal, account data)
useRoomWideEmbedFilters (room state)
→ combineEmbedFilters()
→ ThreadView / RoomTimeline embed rendering
```
## Key files
| Path | Role |
| ----------------------------------------------------------------- | ----------------------------- |
| `cinny/src/app/hooks/useRoomEmbedFilters.ts` | Hooks, types, combine logic |
| `cinny/src/types/matrix/room.ts` | `StateEvent.RoomEmbedFilters` |
| `cinny/src/app/features/room/ThreadView.tsx` | Consumer |
| `cinny/src/app/features/room/RoomTimeline.tsx` | Consumer |
| `cinny/src/app/features/common-settings/general/EmbedFilters.tsx` | Room-wide settings UI |
| `cinny/src/app/components/RenderMessageContent.tsx` | Embed render gating |
| `cinny/src/app/features/forum/useForumMessageRenderOptions.ts` | Forum post embed options |
## Data model
| Key | Scope | Content |
| ------------------------------- | ---------------------------- | -------------------------------- |
| `im.paarrot.embed_filters` | Room account data (per user) | `{ disabledPatterns: string[] }` |
| `im.paarrot.room.embed_filters` | Room state | `{ disabledPatterns: string[] }` |
Patterns are JavaScript `RegExp` strings — invalid regex can throw; handle at input time.
## Dependencies
- `matrix-js-sdk` account data + state events
## Integration points
- **URL preview components**: `url-preview/` — embed gating happens before render
- **Thread view**: combines personal + room-wide filters
## Testing
### Manual
1. Add personal pattern blocking `example.com` in a room.
2. Post link; verify no embed.
3. As admin set room-wide pattern; verify all members affected.
4. Test thread view uses combined filters.
### Automated
- None
## Known issues & gotchas
- Two storage locations — document clearly for users (personal vs room-wide)
- Regex validation on save recommended — bad patterns break matching try/catch sites
- Account data type constant: `EMBED_FILTERS_ACCOUNT_DATA_TYPE` in hook file
## Future work
- UI in room settings for room-wide filters (if not complete)
- Import/export pattern lists
- Non-regex simple domain blocklist mode
## Related docs
- None dedicated
## Add your extra things here
- `combineEmbedFilters` merges personal + room-wide with dedup logic — read implementation before changing precedence
- `EmbedFiltersContent` interface in `useRoomEmbedFilters.ts`
@@ -0,0 +1,92 @@
# Emojis & stickers — handoff
## Summary
Paarrot extends Cinny's emoji/sticker system with **usage tracking** (frequently used emojis), **Telegram sticker pack import**, custom emoji pack plugins, and configurable **emoji font** (System / Apple / Twemoji). Pack management lives under Settings and room/space settings.
## User-facing behavior
- **Settings → Emojis & stickers**: global packs, user packs, Telegram import
- Frequently-used emojis sorted by usage stats
- **Settings → General → Emoji style**: System, Apple, Twemoji fonts
- Telegram: bot token stored locally, import packs by name
- Room/space emoji packs via common-settings (inherited Cinny patterns)
## Architecture
```
useEmojiUsage → account data paarrot.favemojis
EmojiStyleFeature (ClientNonUIFeatures) → CSS --font-emoji
TelegramImport.tsx → telegramStickerImport.ts → Matrix image pack upload
custom-emoji plugin (plugins/custom-emoji/) → PackMetaReader
Settings / common-settings EmojisStickers pages
```
## Key files
| Path | Role |
| -------------------------------------------------------------------- | --------------------------- |
| `cinny/src/app/hooks/useEmojiUsage.ts` | Usage stats in account data |
| `cinny/src/app/utils/telegramStickerImport.ts` | Telegram Bot API import |
| `cinny/src/app/features/settings/emojis-stickers/TelegramImport.tsx` | Import UI |
| `cinny/src/app/features/settings/emojis-stickers/EmojisStickers.tsx` | Settings hub |
| `cinny/src/app/features/settings/emojis-stickers/UserPack.tsx` | User pack editor |
| `cinny/src/app/features/settings/emojis-stickers/GlobalPacks.tsx` | Global packs |
| `cinny/src/app/plugins/custom-emoji/` | Custom emoji pack reader |
| `cinny/src/app/pages/client/ClientNonUIFeatures.tsx` | `EmojiStyleFeature` |
| `cinny/src/app/state/settings.ts` | `EmojiStyle` enum |
## Data model
| Key | Scope | Content |
| -------------------------- | ----------------- | ----------------------------------- |
| `paarrot.favemojis` | User account data | Emoji usage counts |
| `cinny_telegram_bot_token` | localStorage | Telegram bot token (TelegramImport) |
| `im.ponies.room_emotes` | Room state | Standard Matrix emoji packs |
## Dependencies
- Telegram Bot API (`api.telegram.org`)
- Twemoji / Apple Color Emoji fonts (bundled or system)
- `matrix-js-sdk` for image pack events
## Integration points
- **Emoji board / composer autocomplete**: reads usage ordering
- **Image pack viewer**: preview imported packs
- **Plugins**: custom-emoji pack format
## Testing
### Manual
1. Send messages with varied emoji; open picker — frequent ones rise.
2. Import Telegram pack with valid bot token; verify stickers in room.
3. Switch emoji style General setting; verify font change in messages.
4. Add room emoji pack in space settings.
### Automated
- None
## Known issues & gotchas
- Telegram token in **localStorage** — not encrypted; user-provided bot
- Telegram import uses network to Telegram servers — rate limits apply
- `PAARROT_EMOJI_USAGE_EVENT = 'paarrot.favemojis'` — must stay stable or migrate
- Pack id prefix `telegram_${packName}` for imported packs
## Future work
- Encrypt or secure-store Telegram token
- Usage stats sync across devices (account data already does)
- Sticker pack marketplace
## Related docs
- Cinny upstream emoji pack docs (if any)
## Add your extra things here
- Emoji style values: `EmojiStyle.System | Apple | Twemoji` in settings atom
- `useEmojiGroupLabels` for picker section headers
+79
View File
@@ -0,0 +1,79 @@
# Explore — handoff
## Summary
Discover public rooms and featured communities on Matrix homeservers. Browse by server, search public room directory, and preview/join rooms.
## User-facing behavior
- Explore tab in sidebar
- Pick server / homeserver directory
- Featured rooms list
- Search public rooms on server
- Join room from preview
## Architecture
```
client/explore/
Explore.tsx — main explore page
Server.tsx — server-specific directory
Featured.tsx — featured rooms
PublicRooms via matrix directory API
```
## Key files
| Path | Role |
| --------------------------------------------------- | -------------------- |
| `cinny/src/app/pages/client/explore/Explore.tsx` | Explore hub |
| `cinny/src/app/pages/client/explore/Server.tsx` | Server directory |
| `cinny/src/app/pages/client/explore/Featured.tsx` | Featured list |
| `cinny/src/app/pages/client/sidebar/ExploreTab.tsx` | Sidebar entry |
| `cinny/src/app/hooks/useRoomDirectoryVisibility.ts` | Directory visibility |
## Data model
Public room directory from homeserver HTTP API (ephemeral).
## Dependencies
- Homeserver `/publicRooms` or sliding sync directory
- `matrix-js-sdk` room directory helpers
## Integration points
- **routing-and-navigation**: `EXPLORE_PATH`, `_SERVER_PATH`, `_FEATURED_PATH`
- **join-before-navigate**: may route here before join
## Testing
### Manual
1. Open explore; list loads for default server.
2. Switch server; directory refreshes.
3. Join public room from explore.
4. Server without public directory — error handling.
### Automated
- None
## Known issues & gotchas
- Public directory disabled on many private homeservers
- Featured rooms may be config-dependent (`clientConfig`)
## Future work
- Federated universal search
- Room preview with topic/avatar before join
## Related docs
- [routing-and-navigation HANDOFF](../routing-and-navigation/HANDOFF.md)
- [join-before-navigate HANDOFF](../join-before-navigate/HANDOFF.md)
## Add your extra things here
- `getExploreFeaturedPath` in pathUtils
+105
View File
@@ -0,0 +1,105 @@
# Forum spaces — handoff
## Summary
Forum spaces provide a board-style UI for `m.forum` rooms and `forum_space` room kinds: topic sections, post feeds, thread detail, rich replies, filters, and dedicated composers. This is a large Paarrot-specific feature area separate from the card-based **Lobby** view.
## User-facing behavior
- Forum spaces open to a **feed** of posts (not the lobby card grid)
- Sections group topics (child rooms / subspaces)
- Create posts with title + rich body; threaded replies
- Board detail view, thread detail, topic search/filter bar
- Distinct composers: new post, reply, chat-style
## Architecture
```
ForumAwareSpaceLayout / ForumSpaceLayout
→ ForumFeedPage (feed sidebar + post list)
→ ForumBoardDetail / ForumThreadDetail
→ forumFeed.ts (aggregate posts from topic rooms)
→ forumTopicHelpers, forumRichText, topicSearch
Hooks: useForumBoard, useForumRoomLiveUpdates, useForumMessageReactions
```
Routing: `getSpaceDefaultPath` + `shouldShowForumLobby` in path utils / room utils.
## Key files
| Path | Role |
| --------------------------------------------------------- | -------------------------------- |
| `cinny/src/app/features/forum/ForumFeedPage.tsx` | Main feed page |
| `cinny/src/app/features/forum/ForumSpaceLayout.tsx` | Layout shell |
| `cinny/src/app/features/forum/ForumAwareSpaceLayout.tsx` | Forum vs non-forum switch |
| `cinny/src/app/features/forum/forumFeed.ts` | Post aggregation, root detection |
| `cinny/src/app/features/forum/types.ts` | ForumTopic, ForumPost, etc. |
| `cinny/src/app/features/forum/ForumBoardView.tsx` | Board listing |
| `cinny/src/app/features/forum/ForumThreadDetail.tsx` | Thread view |
| `cinny/src/app/features/forum/ForumNewPostModal.tsx` | Create post |
| `cinny/src/app/features/forum/ForumReplyComposer.tsx` | Replies |
| `cinny/src/app/features/forum/useForumBoard.ts` | Board data hook |
| `cinny/src/app/features/forum/useForumRoomLiveUpdates.ts` | Live timeline sync |
| `cinny/src/app/pages/pathUtils.ts` | Forum routing |
## Data model
| Signal | Purpose |
| ----------------------------------- | ------------------------------------ |
| `m.room.create` `type: m.forum` | Matrix forum room type |
| `im.paarrot.room.kind: forum_space` | Paarrot forum classification |
| `com.matrixsso.title` on messages | Forum post title (legacy/custom) |
| `formatted_body` with `<h1>` | Root post detection |
| `m.relates_to` threads | Replies and edits |
| `im.paarrot.sub_rooms` | Topic room hierarchy (see sub-rooms) |
## Dependencies
- `matrix-js-sdk` relations, threads, space hierarchy
- Rich text / Slate editor integration for composers
- Embed filters via `useForumMessageRenderOptions.ts`
## Integration points
- **lobby-forums**: routing chooses forum feed vs lobby
- **sub-rooms**: topic rooms may be sub-rooms
- **embed-filters**: forum message render options
- **local-api**: `isSpaceLikeRoom` treats forum as space-like
## Testing
### Manual
1. Open a `m.forum` space; verify feed UI loads.
2. Create post with title; verify appears in feed and topic room.
3. Reply in thread; verify counts and detail view.
4. Filter/search topics; verify results.
5. Compare behavior with `forum_space` room kind.
### Automated
- None
## Known issues & gotchas
- Root post detection uses **two** heuristics: `com.matrixsso.title` and `<h1>` in formatted_body
- Large `forumFeed.ts` — main complexity hotspot
- Forum vs lobby split scattered across path utils and layout components
- Edit/replace relations need careful handling (`isAnnotationRoomMessage`)
## Future work
- Standardize on one title field (MSC alignment)
- Unit tests for `isForumRootContent` and feed aggregation
- Performance for large spaces (pagination)
## Related docs
- [lobby-forums HANDOFF](../lobby-forums/HANDOFF.md) — lobby card UI vs forum feed routing
- [sub-rooms HANDOFF](../sub-rooms/HANDOFF.md)
- [embed-filters HANDOFF](../embed-filters/HANDOFF.md)
## Add your extra things here
- ~40 files under `features/forum/` — start with `forumFeed.ts` and `ForumFeedPage.tsx` when onboarding
- `annotatePostsWithRoomScope` in `forumTopicHelpers.ts` for cross-topic feed display
@@ -0,0 +1,75 @@
# Global search — handoff
## Summary
Quick global search modal for jumping to rooms, users, and recent conversations. Distinct from full message search — optimized for navigation, not event content search.
## User-facing behavior
- Keyboard shortcut / sidebar tab opens search modal
- Type to filter rooms and users
- Select result to navigate
## Architecture
```
SearchModalRenderer (in Router.tsx)
→ features/search/Search.tsx
→ searchModal.ts atom for open state
useAsyncSearch or similar for filtering
```
## Key files
| Path | Role |
| -------------------------------------------------- | ---------------- |
| `cinny/src/app/features/search/Search.tsx` | Modal UI |
| `cinny/src/app/state/searchModal.ts` | Open/close state |
| `cinny/src/app/pages/client/sidebar/SearchTab.tsx` | Sidebar entry |
## Data model
| Key | Storage |
| ------------------ | ------- |
| `searchModal` atom | memory |
## Dependencies
- Local room list + user index from sync
## Integration points
- **routing-and-navigation**: `SearchModalRenderer` in router
- **home-and-sidebar**: SearchTab
- **message-search**: different feature — don't merge UIs
## Testing
### Manual
1. Open search modal from sidebar.
2. Filter rooms by name.
3. Select room; navigates and modal closes.
### Automated
- None
## Known issues & gotchas
- Two "search" features confuse users — message search vs global nav search
- Modal focus trap via folds Overlay patterns
## Future work
- Unify search entry points with tabs (rooms / messages / users)
- Recent searches persistence
## Related docs
- [message-search HANDOFF](../message-search/HANDOFF.md)
- [routing-and-navigation HANDOFF](../routing-and-navigation/HANDOFF.md)
## Add your extra things here
- `SearchModalRenderer` mounted at client root level in Router.tsx
@@ -0,0 +1,100 @@
# Home & sidebar — handoff
## Summary
The **Home** panel lists joined rooms (with sub-room nesting), and the **sidebar** switches between Home, DMs, Explore, Inbox, Search, Create, and Settings tabs. Room ordering, categories, and unread badges are rendered here.
## User-facing behavior
- Home: hierarchical room list with categories, drag reorder, unread/highlight states
- Sidebar tabs with Paarrot logo states (normal/unread/highlight) on Home
- Space tabs when inside a space context
- Threads category on home (`HomeThreadsCategory`)
- Sync status in client chrome
## Architecture
```
SidebarNav → tab routes (HomeTab, DirectTab, ExploreTab, ...)
Home.tsx
→ useHomeRooms.ts (room list + sub-room flattening)
→ RoomNavItem / RoomNavCategoryButton / UnjoinedSubRoomItem
DirectTab.tsx → useDirectRooms.ts
```
## Key files
| Path | Role |
| --------------------------------------------------------- | ----------------------------------- |
| `cinny/src/app/pages/client/home/Home.tsx` | Home room list UI |
| `cinny/src/app/pages/client/home/useHomeRooms.ts` | Room list logic + Paarrot room kind |
| `cinny/src/app/pages/client/SidebarNav.tsx` | Sidebar tab bar |
| `cinny/src/app/pages/client/sidebar/HomeTab.tsx` | Home tab |
| `cinny/src/app/pages/client/sidebar/DirectTab.tsx` | DMs tab + favicon logos |
| `cinny/src/app/pages/client/sidebar/InboxTab.tsx` | Inbox tab |
| `cinny/src/app/pages/client/sidebar/ExploreTab.tsx` | Explore tab |
| `cinny/src/app/pages/client/sidebar/SearchTab.tsx` | Search tab |
| `cinny/src/app/pages/client/sidebar/SettingsTab.tsx` | Settings tab |
| `cinny/src/app/pages/client/sidebar/SpaceTabs.tsx` | Space context tabs |
| `cinny/src/app/pages/client/home/HomeThreadsCategory.tsx` | Threads grouping |
| `cinny/src/app/hooks/useRoomListReorder.ts` | DnD reorder |
| `cinny/src/app/hooks/useSidebarItems.ts` | Sidebar item model |
## Data model
| Source | Data |
| ---------------------- | ------------------------------- |
| `allRoomsAtom` | Joined rooms |
| `roomToUnreadAtom` | Badge state |
| `mDirectAtom` | DM room mapping |
| `im.paarrot.sub_rooms` | Nested children (see sub-rooms) |
| `im.paarrot.room.kind` | Room classification |
| localStorage | Category collapse, room order |
## Dependencies
- Jotai room list atoms
- `matrix-js-sdk` room summaries
## Integration points
- **sub-rooms**: tree flattening in Home.tsx
- **room-nav**: nav item components
- **routing-and-navigation**: tab routes
- **background-notifications**: unread → favicon in DirectTab
## Testing
### Manual
1. Verify room order drag persists.
2. Sub-room nesting indent and unjoined state.
3. Unread badge on sidebar tab.
4. Category collapse/expand.
5. Switch tabs; active state correct.
### Automated
- None
## Known issues & gotchas
- `useHomeRooms` filters top-level vs sub-room IDs — easy to break tree
- DirectTab uses custom Paarrot SVGs for badge states
- Mobile hides sidebar in favor of bottom/full-page nav
## Future work
- Unified sidebar component between home and space contexts
- Virtualize long room lists
## Related docs
- [sub-rooms HANDOFF](../sub-rooms/HANDOFF.md)
- [room-nav HANDOFF](../room-nav/HANDOFF.md)
- [routing-and-navigation HANDOFF](../routing-and-navigation/HANDOFF.md)
## Add your extra things here
- `RoomNavCategoryButton` for collapsible sections
- `useClosedNavCategoriesAtom` for collapsed state
@@ -0,0 +1,83 @@
# Inbox & invites — handoff
## Summary
The inbox area covers invites, notification feed, and notification preferences. Sidebar Inbox tab routes to invites list and notifications history.
## User-facing behavior
- View and accept/decline room invites
- Browse notification events (mentions, etc.)
- Per-room notification preference overrides
## Architecture
```
client/inbox/
Inbox.tsx — layout
Invites.tsx — invite list (allInvitesAtom)
Notifications.tsx — notification feed
ClientRoomsNotificationPreferences.tsx — bulk prefs
```
## Key files
| Path | Role |
| ------------------------------------------------------------------- | ------------------ |
| `cinny/src/app/pages/client/inbox/Inbox.tsx` | Inbox layout |
| `cinny/src/app/pages/client/inbox/Invites.tsx` | Invites UI |
| `cinny/src/app/pages/client/inbox/Notifications.tsx` | Notifications list |
| `cinny/src/app/state/room-list/inviteList.ts` | `allInvitesAtom` |
| `cinny/src/app/pages/client/ClientRoomsNotificationPreferences.tsx` | Room notif prefs |
| `cinny/src/app/pages/client/sidebar/InboxTab.tsx` | Sidebar entry |
| `cinny/src/app/hooks/useRoomsNotificationPreferences.ts` | Prefs hook |
## Data model
| Source | Data |
| ------------ | --------------------------------------- |
| Sync | `m.room.member` invite membership |
| Account data | push rules, per-room notification prefs |
## Dependencies
- matrix-js-sdk sync invite events
- Push rule APIs
## Integration points
- **background-notifications**: same push rules drive system notifications
- **user-settings**: notification settings tab
- **routing-and-navigation**: `INBOX_PATH`, `_INVITES_PATH`, `_NOTIFICATIONS_PATH`
## Testing
### Manual
1. Receive invite; appears in inbox.
2. Accept invite; room joins home list.
3. Decline invite; removed from list.
4. Notifications page shows recent highlights.
### Automated
- None
## Known issues & gotchas
- Invite list can desync briefly during sync gap
- Notification feed scope depends on push rules setup
## Future work
- Mark all invites read
- Notification grouping by room
## Related docs
- [background-notifications HANDOFF](../background-notifications/HANDOFF.md)
- [user-settings HANDOFF](../user-settings/HANDOFF.md)
## Add your extra things here
- `getInboxInvitesPath`, `getInboxNotificationsPath` in pathUtils
@@ -0,0 +1,78 @@
# Join before navigate — handoff
## Summary
When a user opens a room link for a room they have not joined, this preview page shows room info (name, topic, member count) and offers join before entering the timeline.
## User-facing behavior
- matrix.to / internal join links land here if not member
- Room card preview with topic
- Join button → membership then navigate to room/space
- Back navigation on mobile
## Architecture
```
JoinBeforeNavigate.tsx
→ RoomSummaryLoader for preview data
→ useRoomNavigate after join
Route: _JOIN_PATH in Router.tsx
```
## Key files
| Path | Role |
| -------------------------------------------------------------------- | -------------------- |
| `cinny/src/app/features/join-before-navigate/JoinBeforeNavigate.tsx` | Preview + join UI |
| `cinny/src/app/components/RoomSummaryLoader.tsx` | Fetch room preview |
| `cinny/src/app/hooks/useRoomNavigate.ts` | Post-join navigation |
| `cinny/src/app/state/joiningProgress.ts` | Join in progress UX |
## Data model
Preview from `/summary` API or peek room state. No local persistence.
## Dependencies
- matrix-js-sdk `joinRoom`
- `via` servers param for federated joins
## Integration points
- **routing-and-navigation**: join route with `roomIdOrAlias`, `viaServers`
- **explore**: similar preview patterns
- **electron-shell**: `paarrot://` deep links may target join flow
## Testing
### Manual
1. Open link to unjoined public room.
2. Preview shows name/topic.
3. Join succeeds; lands in timeline.
4. Space link navigates to space not room.
### Automated
- None
## Known issues & gotchas
- Private rooms without peek show limited preview
- `viaServers` required for some federated aliases
- `isSpace` check routes to space navigation after join
## Future work
- Knock rooms support
- Invite-only room messaging
## Related docs
- [routing-and-navigation HANDOFF](../routing-and-navigation/HANDOFF.md)
- [electron-shell HANDOFF](../electron-shell/HANDOFF.md)
## Add your extra things here
- Props: `roomIdOrAlias`, optional `eventId`, `viaServers[]`
@@ -0,0 +1,95 @@
# Lobby & forums — handoff
## Summary
Spaces in Paarrot can show a **Lobby** view: a card-based hierarchy of child rooms with drag-and-drop ordering, hero header, and category collapse. **Forum** spaces (`m.forum` room type or `im.paarrot.room.kind` = `forum_space`) use a post-feed style navigation instead of the standard lobby when opened.
## User-facing behavior
- Opening a space lands on lobby (or forum feed for forum spaces)
- Lobby: hero, categories, room cards, DnD reorder (with permissions)
- Forum spaces: routed to post feed per `getSpaceDefaultPath` / `shouldShowForumLobby`
- Category open/closed state persisted per space
## Architecture
```
Space route → Lobby.tsx (SpaceCardLobby)
→ LobbyHeader, LobbyHero, SpaceHierarchy
→ DnD reorder → m.space.child order updates
→ closedLobbyCategories atom (per-space category collapse)
→ shouldShowForumLobby(space) gates forum vs lobby behavior
```
## Key files
| Path | Role |
| ---------------------------------------------------- | --------------------------------------- |
| `cinny/src/app/features/lobby/Lobby.tsx` | Main lobby view |
| `cinny/src/app/features/lobby/LobbyHeader.tsx` | Space header |
| `cinny/src/app/features/lobby/LobbyHero.tsx` | Hero banner area |
| `cinny/src/app/features/lobby/SpaceHierarchy.tsx` | Room tree/cards |
| `cinny/src/app/features/lobby/DnD.tsx` | Drag and drop |
| `cinny/src/app/features/lobby/RoomItem.tsx` | Room card |
| `cinny/src/app/state/closedLobbyCategories.ts` | Collapsed categories |
| `cinny/src/app/state/hooks/closedLobbyCategories.ts` | Jotai hook |
| `cinny/src/app/pages/pathUtils.ts` | `getSpaceLobbyPath`, forum routing |
| `cinny/src/app/utils/room.ts` | `shouldShowForumLobby`, `getStateEvent` |
| `cinny/src/types/matrix/room.ts` | `RoomType.Forum`, `PaarrotRoomKind` |
## Data model
| Event / field | Purpose |
| ------------------------------ | ----------------------------------------------- |
| `m.space.child` | Child room membership + `order` |
| `im.paarrot.sub_rooms` | Paarrot nested children (see sub-rooms handoff) |
| `im.paarrot.room.kind` | e.g. `forum_space` for forum behavior |
| `m.room.create` `type` | `m.forum` for forum rooms |
| Local: `closedLobbyCategories` | UI collapse state (not Matrix) |
## Dependencies
- Matrix space hierarchy events
- DnD library (see Lobby imports)
- Room power levels for reorder permission (`useCanDropLobbyItem`)
## Integration points
- **Sub-rooms**: `SpaceHierarchy` merges `im.paarrot.sub_rooms` children
- **Navigation**: `getSpaceDefaultPath` chooses lobby vs forum path
- **local-api**: `isSpaceLikeRoom` treats forum kind as space-like for channel API
## Testing
### Manual
1. Open a normal space → lobby with child rooms.
2. Collapse/expand category; reload — state should persist.
3. Drag reorder child (as admin); verify `m.space.child` order.
4. Open forum-type space; verify feed navigation not lobby cards.
5. Test with sub-rooms under a child space card.
### Automated
- None
## Known issues & gotchas
- Forum detection spans **two** signals: `m.forum` create type and `im.paarrot.room.kind`
- DnD permission logic is custom per `useCanDropLobbyItem` — read before changing
- `makeLobbyCategoryId(spaceId, childId)` keys collapse state
## Future work
- Unified hierarchy model (space.child + sub_rooms)
- Lobby theming from space avatar metadata
## Related docs
- [forum HANDOFF](../forum/HANDOFF.md) — post feed UI for forum spaces
- [sub-rooms HANDOFF](../sub-rooms/HANDOFF.md)
## Add your extra things here
- Route constant: `SPACE_LOBBY_PATH` in path utils
- `SpaceCardLobby` is the default export wrapper in `Lobby.tsx`
+108
View File
@@ -0,0 +1,108 @@
# Local HTTP API — handoff
## Summary
Paarrot exposes a localhost HTTP API (port **33384**) so external tools — Stream Deck, scripts, macros — can control the running desktop app: mute/deafen, switch rooms, send messages, and read status. The Electron main process runs an Express server; actions are forwarded to the renderer via IPC and executed against the live Matrix client and call service.
## User-facing behavior
- API starts automatically when the Electron app launches (no user setting).
- Only binds to `127.0.0.1` — not reachable from the network.
- No authentication today; security relies on localhost-only binding.
## Architecture
```
External client (curl, Stream Deck, script)
→ GET/POST http://127.0.0.1:33384/...
→ electron/api-server.js (Express)
→ IPC to renderer (executeAction)
→ cinny/src/app/paarrot-api.ts (initPaarrotAPI)
→ Matrix client / CallService / router navigate
```
Navigation for room changes uses `setPaarrotNavigate()` registered from the React router in `ClientNonUIFeatures.tsx`.
## Key files
| Path | Role |
| ---------------------------------------------------- | -------------------------------------------------------- |
| `electron/api-server.js` | Express routes, IPC bridge to renderer |
| `electron/main.js` | Starts `PaarrotAPIServer` with the main window |
| `cinny/src/app/paarrot-api.ts` | Action handlers (mute, deafen, channel, message, status) |
| `cinny/src/app/pages/client/ClientNonUIFeatures.tsx` | Calls `initPaarrotAPI()` and `setPaarrotNavigate()` |
| `test-api.js` / `test-api.sh` | Smoke tests for endpoints |
| `paarrot-api.postman_collection.json` | Postman collection (generated) |
## Data model
No persistent storage. Actions read/write ephemeral app state (current room, call mute/deafen).
### IPC actions (renderer)
| Action | Params | Returns |
| ------------------------------ | --------------------- | -------------------------------------------- |
| `get-status` | — | mute, deafen, currentRoom, connected, userId |
| `toggle-mute` / `set-mute` | `{ muted? }` | `{ muted }` |
| `toggle-deafen` / `set-deafen` | `{ deafened? }` | `{ deafened }` |
| `change-channel` | `{ roomId }` | navigation result |
| `get-channels` | — | room list |
| `send-message` | `{ roomId, message }` | send result |
| `send-message-current` | `{ message }` | send to active room |
| `get-current-room` | — | current room id |
| `get-messages-groups` | `{ limit? }` | recent messages across group channels |
| `get-messages-dms` | `{ limit? }` | recent messages across DMs |
| `get-messages-combined` | `{ limit? }` | recent messages across groups + DMs |
| `get-unreads-groups` | — | unread group conversations |
| `get-unreads-dms` | — | unread DM conversations |
| `get-unreads-combined` | — | unread groups + DMs |
## Dependencies
- `express`, `cors`, `body-parser` (Electron)
- `matrix-js-sdk` (renderer)
- Call feature: `getCallService()` from `features/call/useCall.ts`
## Integration points
- **Voice calls**: mute/deafen actions delegate to `CallService`
- **Stream Deck**: `streamdeck-plugin/` consumes this API
- **Room navigation**: uses `getHomeRoomPath`, `getDirectRoomPath`, `getSpaceRoomPath`
- **Space detection**: `isSpaceLikeRoom()` checks `im.paarrot.room.kind` and `m.forum` type
## Testing
### Manual
1. Start Paarrot desktop (`npm run dev` or built app).
2. `curl http://127.0.0.1:33384/health` → `{ "status": "ok" }`
3. `curl http://127.0.0.1:33384/status` while logged in.
4. Join a voice call; `POST /mute/toggle` and verify UI state.
5. `POST /channel` with a room id; verify navigation.
### Automated
- `node test-api.js` from repo root
## Known issues & gotchas
- Mute/deafen only work when `CallService` has an active call; otherwise handlers return a message, not an error.
- API is Electron-only; `initPaarrotAPI` no-ops when `window.electron.api` is missing (web/Tauri builds).
- Adding endpoints requires changes in **both** `api-server.js` and `paarrot-api.ts`.
## Future work
- Optional auth token for local API
- WebSocket or SSE for status push (Stream Deck polling today)
- Document all endpoints in Postman collection generator (`scripts/generate-postman-collection.js`)
## Related docs
- [API.md](../../API.md) — full endpoint reference
- [API-QUICKSTART.md](../../API-QUICKSTART.md)
- [streamdeck HANDOFF](../streamdeck/HANDOFF.md)
## Add your extra things here
- Default port: **33384** (`PaarrotAPIServer` constructor in `api-server.js`)
- `isSpaceLikeRoom` treats `forum_space` room kind and `m.forum` create type as spaces for channel listing
@@ -0,0 +1,93 @@
# Matrix client — handoff
## Summary
The Matrix client layer wraps `matrix-js-sdk`: client creation, IndexedDB crypto/sync stores, start/stop sync, logout, and React context providers. `ClientRoot` is the authenticated app bootstrapper.
## User-facing behavior
- Splash screen ("Heating up") while client initializes
- Sync status reflected in UI (`SyncStatus`, splash)
- Logout from settings or forced server logout
- Mobile: visibility-based sync restart
## Architecture
```
ClientRoot.tsx
→ getCurrentSession() → initClient(session)
→ startClient(mx)
→ Providers: MatrixClient, Capabilities, MediaConfig, Call, PluginLoader
initMatrix.ts
→ createClient + IndexedDBStore + IndexedDBCryptoStore
→ secretStorageKeys / cryptoCallbacks
```
## Key files
| Path | Role |
| --------------------------------------------------------- | --------------------------------------------- |
| `cinny/src/client/initMatrix.ts` | createClient, start/stop, logout, cache clear |
| `cinny/src/client/secretStorageKeys.ts` | SSSS / secret storage callbacks |
| `cinny/src/app/pages/client/ClientRoot.tsx` | Bootstrap, providers, title bar |
| `cinny/src/app/hooks/useMatrixClient.ts` | React context for `MatrixClient` |
| `cinny/src/app/hooks/useSyncState.ts` | Sync state subscription |
| `cinny/src/app/pages/client/SyncStatus.tsx` | Sync indicator UI |
| `cinny/src/app/components/splash-screen/SplashScreen.tsx` | Loading shell |
## Data model
| Store | Backend | Purpose |
| ---------------------- | ------------- | ------------------- |
| IndexedDB sync store | matrix-js-sdk | Room timeline cache |
| IndexedDB crypto store | matrix-js-sdk | Olm/Megolm keys |
| Session | localStorage | Auth credentials |
## Dependencies
- `matrix-js-sdk`
- IndexedDB (browser/Electron)
## Integration points
- **authentication**: session → initClient
- **state-management**: sync events feed atoms
- **background-notifications**: pushers registered after sync
- **e2e-and-devices**: crypto store, verification
- **plugins**: Matrix client exposed to plugin API
## Testing
### Manual
1. Fresh login; verify sync completes (timeline loads).
2. Reload app; session restores without re-login.
3. Logout; IndexedDB cleared appropriately.
4. Airplane mode → sync error → recovery on reconnect.
### Automated
- None
## Known issues & gotchas
- `handlingKeyConflict` flag in initMatrix for crypto key conflicts
- `deleteAllMatrixDatabases` on certain logout/clear paths — destructive
- Mobile `useVisibilitySync` restarts sync on app resume (Tauri)
- `clearCacheAndReload` utility for support scenarios
## Future work
- Lazy sync / sliding sync if migrating MSC
- Better sync error UX with retry backoff
## Related docs
- [authentication HANDOFF](../authentication/HANDOFF.md)
- [state-management HANDOFF](../state-management/HANDOFF.md)
- [e2e-and-devices HANDOFF](../e2e-and-devices/HANDOFF.md)
## Add your extra things here
- `logoutClient`, `clearLoginData`, `clearCacheAndReload` exported from initMatrix.ts
- `HttpApiEvent.SessionLoggedOut` listener in ClientRoot clears everything
@@ -0,0 +1,90 @@
# Media & URL preview — handoff
## Summary
Handles file uploads, encrypted media, image/video viewers, thumbnails, and URL preview cards (Open Graph, Giphy, etc.). Upload progress shown via upload cards in the composer.
## User-facing behavior
- Attach files via `+` button, paste, or drag-drop
- Image/video lightbox viewers
- Link URLs expand to preview cards in timeline
- Encrypted attachments decrypted client-side
- Upload progress and cancel
## Architecture
```
UploadCardRenderer / upload state atoms
→ encryptFile (utils/matrix) for encrypted rooms
→ matrix uploadContent
url-preview/ components
→ fetch OG metadata, Giphy embed
→ gated by embed-filters
image-viewer/, video-viewer/ — fullscreen media
```
## Key files
| Path | Role |
| ------------------------------------------------------------- | ----------------------------- |
| `cinny/src/app/components/upload-card/UploadCardRenderer.tsx` | Upload UI |
| `cinny/src/app/state/upload.ts` | Upload state |
| `cinny/src/app/state/room/roomInputDrafts.ts` | `TUploadItem` |
| `cinny/src/app/utils/matrix.ts` | `encryptFile`, upload helpers |
| `cinny/src/app/components/url-preview/` | Link embed cards |
| `cinny/src/app/components/image-viewer/` | Image lightbox |
| `cinny/src/app/components/video-viewer/` | Video player |
| `cinny/src/app/hooks/useMediaAuthentication.ts` | Authenticated media URLs |
| `cinny/src/app/hooks/useAuthenticatedMediaUrl.ts` | MXC → HTTP with auth |
| `cinny/src/app/components/message/content/` | Image/video/thumbnail content |
## Data model
Upload queue in Jotai atom families (per room). Media itself on homeserver as MXC.
## Dependencies
- Homeserver media repository config (`useMediaConfig`)
- `matrix-js-sdk` encryption APIs
## Integration points
- **room-timeline**: attachment messages + URL embeds
- **embed-filters**: suppress previews
- **editor-and-composer**: upload from composer
- **avatar-metadata**: separate pipeline for profile images
## Testing
### Manual
1. Upload image in encrypted room; verify decrypt on receive.
2. Post URL; preview card appears.
3. Block URL pattern via embed filter; no card.
4. Open image in viewer; zoom/navigate.
### Automated
- None
## Known issues & gotchas
- Media authentication required on some homeservers (`useMediaAuthentication`)
- Large file memory on mobile
- Giphy embed has separate CSS module
## Future work
- Resumable uploads
- Blurhash placeholders
## Related docs
- [embed-filters HANDOFF](../embed-filters/HANDOFF.md)
- [room-timeline HANDOFF](../room-timeline/HANDOFF.md)
## Add your extra things here
- `ThumbnailContent.tsx`, `VideoContent.tsx` in message/content/
- Android share materializes files into upload draft (see android handoff)
@@ -0,0 +1,89 @@
# Message rendering — handoff
## Summary
Built-in plugins parse and render message bodies: custom markdown (block + inline), HTML sanitization, syntax highlighting, matrix.to links, emoji shortcodes, bad-word filter hooks, and PDF preview support.
## User-facing behavior
- Messages render formatted text, code blocks with Prism highlighting
- Clickable matrix.to / room links
- Custom emoji from packs inline
- Spoiler/highlight/color extensions where enabled
## Architecture
```
RenderMessageContent.tsx
→ react-custom-html-parser.tsx
→ plugins/markdown/ (block + inline parsers)
→ plugins/react-prism/ReactPrism.tsx
→ plugins/emoji.ts, matrix-to.ts, color.ts
msgContent.ts — content type detection
```
## Key files
| Path | Role |
| ---------------------------------------------------- | ------------------------ |
| `cinny/src/app/components/RenderMessageContent.tsx` | Main render entry |
| `cinny/src/app/plugins/react-custom-html-parser.tsx` | HTML → React |
| `cinny/src/app/plugins/markdown/` | Markdown rules + parsers |
| `cinny/src/app/plugins/react-prism/ReactPrism.tsx` | Code highlighting |
| `cinny/src/app/plugins/emoji.ts` | Emoji shortcodes |
| `cinny/src/app/plugins/matrix-to.ts` | matrix.to link handling |
| `cinny/src/app/plugins/bad-words.ts` | Content filter hook |
| `cinny/src/app/plugins/color.ts` | Text color |
| `cinny/src/app/utils/sanitize.ts` | HTML sanitization |
| `cinny/src/app/features/room/msgContent.ts` | Message content helpers |
## Data model
None — pure functions over message content JSON.
## Dependencies
- `prismjs` (via react-prism)
- `pdfjs-dist` wrapper for PDF thumbnails
- `millify` for number formatting in embeds
## Integration points
- **room-timeline**: all message bodies
- **forum**: `forumRichText.ts`, `ForumMessageBody.tsx`
- **custom-emoji-packs**: emoji plugin reads pack data
- **embed-filters**: separate from body render — URL preview gating
## Testing
### Manual
1. Send markdown: bold, code fence, link.
2. Verify matrix.to link navigates in-app.
3. Custom emoji shortcode renders image.
4. XSS attempt in message — should sanitize.
### Automated
- None
## Known issues & gotchas
- Markdown rules split block vs inline — order matters in parser
- `bad-words.ts` may be no-op depending on config
- HTML from other clients may not match Paarrot markdown subset
## Future work
- CommonMark test suite
- Lazy-load Prism languages
## Related docs
- [room-timeline HANDOFF](../room-timeline/HANDOFF.md)
- [custom-emoji-packs HANDOFF](../custom-emoji-packs/HANDOFF.md)
## Add your extra things here
- `plugins/markdown/block/rules.ts` and `inline/rules.ts` — start here for new syntax
- `via-servers.ts` for link join hints
@@ -0,0 +1,79 @@
# Message search — handoff
## Summary
In-room and cross-room message search UI: query input, filters, result grouping, and navigation to found events. Uses Matrix `/search` or client-side APIs via `useMessageSearch`.
## User-facing behavior
- Search modal or page with text query
- Filters: room, sender, date (see SearchFilters)
- Results grouped by room/period
- Click result → jump to event in timeline
## Architecture
```
MessageSearch.tsx
→ useMessageSearch.ts
→ SearchInput, SearchFilters, SearchResultGroup
Router may mount search under client routes
```
## Key files
| Path | Role |
| ------------------------------------------------------------- | ------------ |
| `cinny/src/app/features/message-search/MessageSearch.tsx` | Main UI |
| `cinny/src/app/features/message-search/useMessageSearch.ts` | Search logic |
| `cinny/src/app/features/message-search/SearchInput.tsx` | Query field |
| `cinny/src/app/features/message-search/SearchFilters.tsx` | Filters |
| `cinny/src/app/features/message-search/SearchResultGroup.tsx` | Result list |
## Data model
Ephemeral search state in component hooks. No persistence.
## Dependencies
- `matrix-js-sdk` search API
- Homeserver must support message search (server-dependent)
## Integration points
- **routing-and-navigation**: search routes in home/space
- **room-timeline**: navigation to event id
- **global-search**: separate modal feature — see that handoff
## Testing
### Manual
1. Search known keyword; results appear.
2. Apply room filter; results scoped.
3. Click result; timeline scrolls to event.
4. Test on homeserver without search — expect graceful error.
### Automated
- None
## Known issues & gotchas
- Server-side search availability varies by deployment
- Encrypted room search limited by server/indexing policy
- Pagination in `useMessageSearch` — check for duplicate results
## Future work
- Client-side fallback search for small rooms
- Highlight match in timeline
## Related docs
- [global-search HANDOFF](../global-search/HANDOFF.md)
- [room-timeline HANDOFF](../room-timeline/HANDOFF.md)
## Add your extra things here
- Exported from `features/message-search/index.ts`
+98
View File
@@ -0,0 +1,98 @@
# Plugin system — handoff
## Summary
Paarrot extends the Matrix client with JavaScript plugins loaded from disk or the marketplace. Plugins can register slash commands, inject UI buttons in 11 locations, hook Matrix events, register themes, and run background tasks. The runtime is `@paarrot/plugin-manager`; the app wires slots in settings, nav, composer, and room UI.
## User-facing behavior
- **Settings → Plugins**: Installed, Marketplace, enable/disable, uninstall
- Plugins live in OS-specific dirs (`%APPDATA%\paarrot\plugins\`, `~/.config/Paarrot/plugins/`, etc.)
- Marketplace pulls from [Plugin Directory](https://github.com/Paarrot/Plugin-Directory) JSON index
## Architecture
```
Plugin folder (index.js + plugin-metadata.json)
→ PluginLoader (reads, validates, enables)
→ @paarrot/plugin-manager (lifecycle, API surface)
→ PluginAPI.ts (app-specific bindings: Matrix client, navigate, notifications)
→ UI slots: PluginNavSlot, PluginButtonSlot, PluginSidebarSlot, ...
```
## Key files
| Path | Role |
| --------------------------------------------------------------- | ------------------------------------- |
| `cinny/src/app/features/settings/plugins/PluginLoader.tsx` | Load/enable/disable plugins |
| `cinny/src/app/features/settings/plugins/PluginAPI.ts` | Re-exports plugin-manager + app hooks |
| `cinny/src/app/features/settings/plugins/Plugins.tsx` | Settings UI (installed + marketplace) |
| `cinny/src/app/features/settings/plugins/PluginButtonSlot.tsx` | Icon button injection |
| `cinny/src/app/features/settings/plugins/PluginNavSlot.tsx` | Nav row injection |
| `cinny/src/app/features/settings/plugins/PluginSidebarSlot.tsx` | Sidebar icon injection |
| `cinny/src/app/features/settings/plugins/types.ts` | Local types |
| `cinny/src/app/features/settings/plugins/PLUGIN_DEVELOPMENT.md` | Author-facing dev guide |
| `example-plugin/` | Reference plugin at repo root |
| `cinny/docs/PLUGIN_*.md` | API reference docs |
## Data model
- Plugin metadata: `plugin-metadata.json` per plugin (id, version, permissions, `paarrot.utils` deps)
- Enabled state: persisted via plugin-manager (Electron userData)
- No Matrix events for plugins themselves
### UI locations (`UILocation`)
`channel-list`, `home-section`, `direct-messages`, `sidebar-actions`, `text-composer-toolbar`, `composer-actions`, `room-header`, `room-menu`, `message-actions`, `user-menu`, `search-notification-section`
## Dependencies
- `@paarrot/plugin-manager` (npm)
- Electron `fs` / IPC for plugin install paths
- GitHub raw URLs for marketplace index (`PluginAPI.ts`)
## Integration points
- **Matrix client**: exposed to plugins for send/receive
- **Local API**: separate from plugins; plugins do not use HTTP API by default
- **Settings**: plugin tabs via `PluginTab`
- **All major UI surfaces**: search codebase for `PluginButtonSlot` / `PluginNavSlot` usages
## Testing
### Manual
1. Copy `example-plugin/` to plugins directory.
2. Enable in Settings → Plugins.
3. Verify slash command and injected button appear.
4. Disable plugin; verify UI cleans up.
### Automated
- None dedicated; validate via example-plugin manually
## Known issues & gotchas
- Plugin API version must match `@paarrot/plugin-manager` expectations
- `ctx.require("other-plugin-id")` for inter-plugin deps
- Marketplace cache-bust query param on index fetch
- Plugin dev guide lives inside `src/` — consider linking from handoff only
## Future work
- Sandboxing / permission prompts per capability
- Hot reload without app restart
- Signed plugin packages
## Related docs
- [PLUGINS.md](../../PLUGINS.md)
- [PLUGIN_API.md](../../PLUGIN_API.md)
- [PLUGIN_BUTTON_API.md](../../PLUGIN_BUTTON_API.md)
- [PLUGIN_SYSTEM_IMPLEMENTATION.md](../../PLUGIN_SYSTEM_IMPLEMENTATION.md)
- [PLUGIN_DEVELOPMENT.md](../../../../src/app/features/settings/plugins/PLUGIN_DEVELOPMENT.md)
## Add your extra things here
- Marketplace base: `https://raw.githubusercontent.com/Paarrot/Plugin-Directory/refs/heads/main/plugins/`
- 11 UI injection points — see README plugin table in repo root
@@ -0,0 +1,93 @@
# Room App UI — handoff
## Summary
Bots can publish a declarative UI into Matrix room state (`im.paarrot.ui`). Paarrot takes over the room view with that UI. User interactions are sent as timeline events (`im.paarrot.ui.action`), not chat messages. The bot updates state to re-render panels.
## User-facing behavior
- When a room has a valid `im.paarrot.ui` state event, opening the room shows the app UI instead of the chat timeline (forum rooms still win over app UI).
- **Show chat** returns to the normal timeline without clearing bot state; a banner offers **Show app** to go back.
- Action events are hidden from the chat timeline (same as confetti relay events).
- Room settings → Permissions includes **Set Room App UI** and **Send Room App Actions**.
## Architecture
```
Bot → state im.paarrot.ui
→ Room.tsx detects via useStateEvent
→ RoomAppView → RoomAppSchema (declarative nodes)
→ user clicks → mx.sendEvent(im.paarrot.ui.action)
→ Bot updates im.paarrot.ui → live re-render
```
## Key files
| Path | Role |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `cinny/src/types/matrix/room.ts` | `StateEvent.PaarrotUi`, `MessageEvent.PaarrotUiAction`, node types |
| `cinny/src/app/utils/room.ts` | `getPaarrotUiContent`, `hasRoomAppUi` |
| `cinny/src/app/features/room/Room.tsx` | Takeover branch + Show chat / Show app |
| `cinny/src/app/features/room-app/` | `RoomAppView`, schema renderer, CSS sanitize/scope |
| `cinny/src/app/features/room/RoomTimeline.tsx` | Hides `im.paarrot.ui.action` |
| `cinny/src/app/features/room-settings/permissions/usePermissionItems.ts` | Permission labels |
## Data model
| Event | Kind | Content |
| ---------------------- | ------------ | --------------------------------------------------------- |
| `im.paarrot.ui` | state (`""`) | `{ version, title?, css?, root }` |
| `im.paarrot.ui.action` | timeline | `{ action, component_id, value?, values?, ui_event_id? }` |
See [samples/](./samples/) for pasteable Developer Tools payloads.
MVP node types: `panel`, `row`, `text`, `button`, `input`, `select`, `image`, `spacer`.
## Dependencies
- folds UI primitives
- matrix-js-sdk `sendEvent` / state sync
- No bot-supplied JavaScript; CSS is sanitized and scoped under `[data-room-app]`
## Integration points
- Same room takeover pattern as forums (`Room.tsx` branch)
- Developer Tools can send state/events for demos without a bot process
## Testing
### Manual
1. In Developer Tools → Send State Event, type `im.paarrot.ui`, paste `samples/trivia-ui-state.json`.
2. Open the room — app UI should replace the timeline.
3. Click an answer — an `im.paarrot.ui.action` event is sent (hidden in timeline; visible in raw/dev tools).
4. Click **Show chat**, then **Show app**.
5. Clear state content / redact state to restore normal chat.
### Automated
- None yet
## Known issues & gotchas
- CSS scoping is best-effort, not a full CSS parser
- Images allow `mxc://`, `https://`, and `http://` only
- Forum rooms take priority over app UI
- `sendEvent(..., as any)` cast mirrors other custom event types
## Future work
- `form` / `tabs` / `markdown` / `progress` nodes
- Bot SDK helpers
- Stronger CSS sandbox (Shadow DOM)
- Encrypt custom action payloads helpers if needed
## Related docs
- [samples/trivia-ui-state.json](./samples/trivia-ui-state.json)
- [samples/ui-action-event.json](./samples/ui-action-event.json)
## Add your extra things here
- Power level: bots need PL ≥ `state_default` (usually 50) or an explicit level for `im.paarrot.ui`
- Action events use normal message event power levels unless overridden for `im.paarrot.ui.action`
@@ -0,0 +1,34 @@
{
"version": 1,
"title": "Poll Booth",
"root": {
"type": "panel",
"id": "poll",
"children": [
{
"type": "text",
"id": "prompt",
"text": "Where should we go for lunch?"
},
{
"type": "select",
"id": "choice",
"name": "choice",
"label": "Your vote",
"options": [
{ "label": "Ramen", "value": "ramen" },
{ "label": "Pizza", "value": "pizza" },
{ "label": "Salad", "value": "salad" }
],
"value": "ramen"
},
{
"type": "button",
"id": "vote",
"label": "Submit vote",
"action": "vote",
"variant": "Primary"
}
]
}
}
@@ -0,0 +1,88 @@
{
"version": 1,
"title": "Trivia Night",
"css": ".score { font-weight: 700; } .hint { opacity: 0.75; }",
"root": {
"type": "panel",
"id": "main",
"children": [
{
"type": "text",
"id": "q",
"text": "Capital of France?"
},
{
"type": "text",
"id": "hint",
"className": "hint",
"text": "Pick one answer below."
},
{
"type": "spacer",
"id": "sp1",
"size": 16
},
{
"type": "row",
"id": "answers",
"children": [
{
"type": "button",
"id": "a",
"label": "Paris",
"action": "answer",
"value": "paris",
"variant": "Primary"
},
{
"type": "button",
"id": "b",
"label": "Lyon",
"action": "answer",
"value": "lyon",
"variant": "Secondary"
},
{
"type": "button",
"id": "c",
"label": "Marseille",
"action": "answer",
"value": "marseille",
"variant": "Secondary"
}
]
},
{
"type": "spacer",
"id": "sp2",
"size": 24
},
{
"type": "text",
"id": "score_label",
"className": "score",
"text": "Score: 0"
},
{
"type": "input",
"id": "nick",
"name": "nickname",
"label": "Display name on the board",
"placeholder": "Optional nickname"
},
{
"type": "row",
"id": "submit_row",
"children": [
{
"type": "button",
"id": "join",
"label": "Join board",
"action": "join",
"variant": "Success"
}
]
}
]
}
}
@@ -0,0 +1,9 @@
{
"action": "answer",
"component_id": "a",
"value": "paris",
"values": {
"nickname": "Ada"
},
"ui_event_id": "$REPLACE_WITH_CURRENT_im.paarrot.ui_EVENT_ID"
}
+82
View File
@@ -0,0 +1,82 @@
# Room nav — handoff
## Summary
Room nav components render individual channel rows in sidebars and space channel lists: room items, category buttons, call participant indicators, sub-room actions, and unjoined sub-room join prompts.
## User-facing behavior
- Room row: name, avatar, unread badge, active highlight
- Context menu: add sub-room, room actions
- Call participants indicator when call active in room
- Unjoined sub-room row with join button
- Category headers with collapse
## Architecture
```
features/room-nav/
RoomNavItem → per-room row + menus
RoomNavCategoryButton → section headers
UnjoinedSubRoomItem → join flow
CallParticipantsIndicator → active call badge
Used by Home.tsx, space sidebars, forum sidebars
```
## Key files
| Path | Role |
| --------------------------------------------------------------- | ----------------- |
| `cinny/src/app/features/room-nav/RoomNavItem.tsx` | Main room row |
| `cinny/src/app/features/room-nav/RoomNavCategoryButton.tsx` | Category header |
| `cinny/src/app/features/room-nav/UnjoinedSubRoomItem.tsx` | Unjoined sub-room |
| `cinny/src/app/features/room-nav/CallParticipantsIndicator.tsx` | In-call indicator |
| `cinny/src/app/features/room-nav/styles.css.ts` | Nav styles |
## Data model
Uses room state, unread atoms, `im.paarrot.sub_rooms` permissions — no own persistence.
## Dependencies
- `usePermission` for sub-room create
- `useOpenCreateSubRoomModal` from state hooks
## Integration points
- **sub-rooms**: Add Sub-Room menu action
- **voice-calls**: participant indicator
- **create-flows**: opens create room modal with parent id
- **home-and-sidebar**: primary consumer
## Testing
### Manual
1. Right-click/context menu on room row.
2. Add sub-room when permitted / disabled when not.
3. Active call shows participant indicator.
4. Unjoined sub-room join navigates correctly.
### Automated
- None
## Known issues & gotchas
- Depth indentation for sub-rooms passed as prop — styling in CSS
- `canAddSubRoom` checks `StateEvent.PaarrotSubRooms` power level
## Future work
- Consolidate with forum sidebar items if duplicated
## Related docs
- [sub-rooms HANDOFF](../sub-rooms/HANDOFF.md)
- [home-and-sidebar HANDOFF](../home-and-sidebar/HANDOFF.md)
- [voice-calls HANDOFF](../voice-calls/HANDOFF.md)
## Add your extra things here
- Export barrel: `features/room-nav/index.ts`
@@ -0,0 +1,81 @@
# Room settings — handoff
## Summary
Per-room settings overlay: general info, permissions, members (via common-settings), sub-rooms (Paarrot), and developer tools. Opened from room header/menu without leaving the room.
## User-facing behavior
- Edit room name, topic, avatar, address, join rules, encryption
- Permissions and power levels
- Sub-rooms management (Paarrot)
- Member list and moderation actions
## Architecture
```
RoomSettingsRenderer (Router overlay)
→ RoomSettings.tsx — page nav
→ room-settings/general/, permissions/, sub-rooms/
→ delegates to common-settings/ for shared pages
roomSettings.ts atom — which page open
```
## Key files
| Path | Role |
| ------------------------------------------------------------- | -------------------- |
| `cinny/src/app/features/room-settings/RoomSettings.tsx` | Settings shell |
| `cinny/src/app/features/room-settings/general/` | General tab |
| `cinny/src/app/features/room-settings/permissions/` | Permissions |
| `cinny/src/app/features/room-settings/sub-rooms/SubRooms.tsx` | Sub-rooms (Paarrot) |
| `cinny/src/app/state/roomSettings.ts` | Modal/page state |
| `cinny/src/app/state/hooks/roomSettings.ts` | Open/close hooks |
| `cinny/src/app/features/common-settings/` | Shared setting pages |
## Data model
Standard Matrix room state events (`m.room.name`, `m.room.power_levels`, etc.) plus `im.paarrot.sub_rooms`.
## Dependencies
- `useRoomPermissions`, `usePowerLevels`
- common-settings components
## Integration points
- **sub-rooms**: Paarrot-specific tab
- **common-settings**: members, emojis, developer tools reuse
- **embed-filters**: `EmbedFilters.tsx` in common-settings general
## Testing
### Manual
1. Open room settings from ⋮ menu.
2. Change topic; verify state event.
3. Sub-rooms tab: reorder children.
4. Permissions: change power level.
### Automated
- None
## Known issues & gotchas
- Overlay vs full page on mobile — check ScreenSize branches
- `RoomSettingsRenderer` must stay mounted in Router for deep links
## Future work
- Room settings deep link URL
## Related docs
- [sub-rooms HANDOFF](../sub-rooms/HANDOFF.md)
- [common-settings HANDOFF](../common-settings/HANDOFF.md)
- [embed-filters HANDOFF](../embed-filters/HANDOFF.md)
## Add your extra things here
- `SubRoomsPage` enum in `roomSettings.ts`
@@ -0,0 +1,110 @@
# Room timeline — handoff
## Summary
The room view is the core messaging experience: virtualized timeline, message rendering, composer input, threads, reactions, pins, members drawer, and room header. Includes Paarrot-specific embed filter integration and command autocomplete.
## User-facing behavior
- Scrollable timeline with read markers, edits, redactions, reactions
- Rich composer with mentions, emoji, attachments, slash commands
- Thread side panel (`ThreadView`)
- Members drawer, room header actions, typing indicators
- Jump to time, pinned messages menu, reaction viewer
- Following mode / tombstone for upgraded rooms
## Architecture
```
Room.tsx / RoomView.tsx
→ RoomTimeline.tsx (virtualized events)
→ RoomInput.tsx + Editor
→ Message.tsx / RenderMessageContent.tsx
→ ThreadView.tsx
→ RoomViewHeader.tsx, MembersDrawer
Hooks: useVirtualPaginator, useRoomLatestRenderedEvent, useMarkAsRead
```
## Key files
| Path | Role |
| ---------------------------------------------------------------- | ----------------------- |
| `cinny/src/app/features/room/Room.tsx` | Room entry |
| `cinny/src/app/features/room/RoomView.tsx` | Main layout |
| `cinny/src/app/features/room/RoomTimeline.tsx` | Timeline |
| `cinny/src/app/features/room/RoomInput.tsx` | Composer |
| `cinny/src/app/features/room/ThreadView.tsx` | Thread panel |
| `cinny/src/app/features/room/RoomViewHeader.tsx` | Header bar |
| `cinny/src/app/features/room/message/Message.tsx` | Single message |
| `cinny/src/app/features/room/message/Reactions.tsx` | Reaction row |
| `cinny/src/app/features/room/message/MessageEditor.tsx` | Edit message |
| `cinny/src/app/features/room/CommandAutocomplete.tsx` | Slash commands |
| `cinny/src/app/features/room/reaction-viewer/ReactionViewer.tsx` | Who reacted |
| `cinny/src/app/features/room/jump-to-time/JumpToTime.tsx` | Time jump UI |
| `cinny/src/app/features/room/room-pin-menu/RoomPinMenu.tsx` | Pinned messages |
| `cinny/src/app/components/RenderMessageContent.tsx` | Content render + embeds |
| `cinny/src/app/hooks/useVirtualPaginator.ts` | Timeline pagination |
## Data model
| Source | Data |
| ------------------------------- | ---------------------------------------- |
| Matrix sync | `m.room.message`, edits, reactions, pins |
| Room account data | drafts (`roomInputDrafts`) |
| `im.paarrot.embed_filters` | Personal embed blocks |
| `im.paarrot.room.embed_filters` | Room-wide embed blocks |
## Dependencies
- `matrix-js-sdk` timeline APIs
- Slate editor (composer)
- Embed filter hooks
- Plugin button slots in header/composer/message actions
## Integration points
- **editor-and-composer**: RoomInput uses Editor
- **embed-filters**: timeline + thread embed gating
- **message-rendering**: markdown/HTML parse pipeline
- **media-and-url-preview**: attachments and link cards
- **plugins**: message-actions, composer-actions slots
- **voice-calls**: header call controls
## Testing
### Manual
1. Send text, image, reply, edit, delete.
2. Open thread; reply in thread.
3. Add reaction; open reaction viewer.
4. Pin message; open pin menu.
5. Block embed domain; verify no preview.
6. Slash command from plugin.
### Automated
- None
## Known issues & gotchas
- Virtual paginator complexity — scroll position bugs common regression area
- Encrypted rooms: render path differs for `m.room.encrypted`
- `RoomViewFollowing` auto-scroll behavior vs manual scroll
- Large threads performance
## Future work
- Timeline unit tests for edit/redaction grouping
- Improved read receipt aggregation
## Related docs
- [editor-and-composer HANDOFF](../editor-and-composer/HANDOFF.md)
- [embed-filters HANDOFF](../embed-filters/HANDOFF.md)
- [message-rendering HANDOFF](../message-rendering/HANDOFF.md)
- [media-and-url-preview HANDOFF](../media-and-url-preview/HANDOFF.md)
## Add your extra things here
- `msgContent.ts` — message content helpers
- `useRoomNavigate` for permalink jumps
@@ -0,0 +1,96 @@
# Routing & navigation — handoff
## Summary
React Router drives all app navigation: auth routes, client shell, home/direct/space/inbox/explore paths, room views, lobby/forum feeds, and modal overlays (settings, search, create). Supports hash router mode via client config.
## User-facing behavior
- URL reflects current room, space, inbox tab, explore server
- Mobile vs desktop route layouts (`MobileFriendly` wrappers)
- Deep links and `matrix.to` style joins via join route
- After-login redirect preserves intended destination
- View transitions on supported platforms
## Architecture
```
App.tsx → createRouter(clientConfig, screenSize)
→ Auth routes | ClientLayout + SidebarNav + Outlet
paths.ts — route constants
pathUtils.ts — path builders (getHomeRoomPath, getSpaceDefaultPath, ...)
Router.tsx — route tree + loaders/guards
```
## Key files
| Path | Role |
| ------------------------------------------------- | -------------------------- |
| `cinny/src/app/pages/Router.tsx` | Full route tree |
| `cinny/src/app/pages/paths.ts` | Path constants |
| `cinny/src/app/pages/pathUtils.ts` | Path builder utilities |
| `cinny/src/app/pages/App.tsx` | RouterProvider setup |
| `cinny/src/app/pages/client/ClientLayout.tsx` | Authenticated layout shell |
| `cinny/src/app/pages/client/SidebarNav.tsx` | Left sidebar tabs |
| `cinny/src/app/pages/MobileFriendly.tsx` | Mobile nav adapters |
| `cinny/src/app/hooks/useRoomNavigate.ts` | Imperative room navigation |
| `cinny/src/app/hooks/useNavToActivePathMapper.ts` | Restore last path |
| `cinny/src/app/pages/afterLoginRedirectPath.ts` | Login redirect |
| `cinny/src/app/components/AnimatedOutlet.tsx` | Route transitions |
## Data model
| Key | Purpose |
| ---------------------- | ------------------------ |
| `navToActivePath` atom | Per-context last URL |
| URL path params | roomId, spaceId, eventId |
## Dependencies
- `react-router-dom` v6
- `clientConfig.hashRouter` for Electron/file protocol
## Integration points
- **forum**: `ForumAwareSpaceLayout`, `ForumFeedPage` routes
- **lobby-forums**: `_LOBBY_PATH`, `Lobby` component
- **join-before-navigate**: `_JOIN_PATH` route
- **local-api**: `setPaarrotNavigate` uses same path utils
- **settings/room-settings**: overlay renderers on client routes
## Testing
### Manual
1. Navigate home → room → back; URL updates correctly.
2. Open space; forum vs lobby path per room type.
3. Hash router mode (if enabled in config).
4. Mobile breakpoints: sidebar vs full-page nav.
5. Refresh on deep room URL — lands in same room.
### Automated
- None
## Known issues & gotchas
- `getSpaceDefaultPath` branches forum vs lobby — must stay in sync with forum handoff
- Hash router needed for some Electron `file://` deployments
- Many path helpers — prefer using `pathUtils` over string concat
## Future work
- Route-level code splitting audit
- Unified join/link handler
## Related docs
- [forum HANDOFF](../forum/HANDOFF.md)
- [lobby-forums HANDOFF](../lobby-forums/HANDOFF.md)
- [join-before-navigate HANDOFF](../join-before-navigate/HANDOFF.md)
- [home-and-sidebar HANDOFF](../home-and-sidebar/HANDOFF.md)
## Add your extra things here
- Key paths: `HOME_PATH`, `DIRECT_PATH`, `SPACE_PATH`, `INBOX_PATH`, `EXPLORE_PATH`, `_FEED_PATH`, `_LOBBY_PATH`
- `getAppPathFromHref` for parsing external links
@@ -0,0 +1,73 @@
# Space settings — handoff
## Summary
Per-space settings overlay analogous to room settings: general space profile, permissions, and shared common-settings pages. Used for Matrix spaces (and forum spaces).
## User-facing behavior
- Edit space name, topic, avatar, visibility
- Space permissions and power levels
- Child space management via common flows
## Architecture
```
SpaceSettingsRenderer (Router overlay)
→ space-settings/SpaceSettings.tsx
→ general/, permissions/
spaceSettings.ts atom
```
## Key files
| Path | Role |
| --------------------------------------------------------- | -------------- |
| `cinny/src/app/features/space-settings/SpaceSettings.tsx` | Settings shell |
| `cinny/src/app/features/space-settings/general/` | General tab |
| `cinny/src/app/features/space-settings/permissions/` | Permissions |
| `cinny/src/app/state/spaceSettings.ts` | Open state |
| `cinny/src/app/state/hooks/spaceSettings.ts` | Hooks |
## Data model
Matrix space state: `m.space.child`, `m.room.name`, power levels, etc.
## Dependencies
- Same permission patterns as room settings
## Integration points
- **lobby-forums**: space metadata shown in lobby hero
- **create-flows**: add existing rooms to space
- **common-settings**: shared pages
## Testing
### Manual
1. Open space settings.
2. Edit space name and avatar.
3. Change join rules / visibility.
### Automated
- None
## Known issues & gotchas
- Forum spaces may expose different settings entry points — verify `ForumSpaceLayout`
## Future work
- Space-level embed filter defaults
## Related docs
- [common-settings HANDOFF](../common-settings/HANDOFF.md)
- [lobby-forums HANDOFF](../lobby-forums/HANDOFF.md)
## Add your extra things here
- `usePermissionItems` in space-settings/permissions/
@@ -0,0 +1,99 @@
# State management — handoff
## Summary
Client UI state uses **Jotai** atoms: room lists, unread counts, settings, modals, drafts, navigation memory, and sidebar collapse. Many atoms sync to localStorage via `atomWithLocalStorage`.
## User-facing behavior
- Room list order, collapsed categories, sidebar folders persist across sessions
- Message drafts and upload queues per room persist locally
- Settings (theme, emoji style, zoom) persist locally
- Unread badges drive favicon and sidebar indicators
## Architecture
```
JotaiProvider (App.tsx)
→ atoms in state/
→ hooks in state/hooks/ wrap atoms for components
ClientBindAtoms.tsx binds Matrix events → atom updates
```
## Key files
| Path | Role |
| --------------------------------------------------- | ---------------------------- |
| `cinny/src/app/state/settings.ts` | User settings atom |
| `cinny/src/app/state/sessions.ts` | Auth sessions |
| `cinny/src/app/state/room-list/roomList.ts` | `allRoomsAtom`, ordering |
| `cinny/src/app/state/room/roomToUnread.ts` | Unread counts |
| `cinny/src/app/state/room/roomInputDrafts.ts` | Composer drafts + uploads |
| `cinny/src/app/state/room/roomToParents.ts` | Space parent mapping |
| `cinny/src/app/state/mDirectList.ts` | Direct message index |
| `cinny/src/app/state/navToActivePath.ts` | Last active path per context |
| `cinny/src/app/state/closedNavCategories.ts` | Collapsed nav sections |
| `cinny/src/app/state/closedLobbyCategories.ts` | Collapsed lobby categories |
| `cinny/src/app/state/createRoomModal.ts` | Create room modal state |
| `cinny/src/app/state/createSpaceModal.ts` | Create space modal state |
| `cinny/src/app/state/searchModal.ts` | Global search modal |
| `cinny/src/app/state/utils/atomWithLocalStorage.ts` | Persistence helper |
| `cinny/src/app/pages/client/ClientBindAtoms.ts` | Matrix → atom bindings |
## Data model
Most state is **local only** (not Matrix). Exceptions: settings that also write account data (notification prefs via separate hooks).
| Atom area | Persists? |
| --------------- | -------------------------- |
| settings | localStorage |
| room list order | localStorage |
| drafts | localStorage |
| unread | memory (derived from sync) |
| modals | memory |
## Dependencies
- `jotai`
- `@tanstack/react-query` (separate from Jotai, used in App.tsx)
## Integration points
- **matrix-client**: sync updates room/unread atoms via ClientBindAtoms
- **home-and-sidebar**: room list atoms
- **room-timeline**: draft atoms
- **routing-and-navigation**: navToActivePath
## Testing
### Manual
1. Type draft, reload — draft should restore.
2. Collapse category, reload — stays collapsed.
3. Reorder rooms; verify order persists.
4. Logout — verify which atoms clear vs persist.
### Automated
- None
## Known issues & gotchas
- Logout clears **all** localStorage in session-logout handler — wipes settings too
- Atom families (`roomIdToMsgDraftAtomFamily`) — memory growth in many rooms
- `ClientBindAtoms` must mount early or UI shows stale unreads
## Future work
- Selective localStorage clear on logout (keep non-sensitive prefs)
- Document atom dependency graph
## Related docs
- [matrix-client HANDOFF](../matrix-client/HANDOFF.md)
- [home-and-sidebar HANDOFF](../home-and-sidebar/HANDOFF.md)
## Add your extra things here
- `useSetting` hook in `state/hooks/settings.ts` — primary settings accessor
- `joiningProgress.ts` — room join UX state
@@ -0,0 +1,82 @@
# Stream Deck integration — handoff
## Summary
The Elgato Stream Deck plugin (`streamdeck-plugin/`) controls Paarrot via the local HTTP API: toggle mute/deafen, switch channels, send messages, and show status. It is a separate package from the main app but ships in the same monorepo.
## User-facing behavior
- User installs `.streamDeckPlugin` or copies `com.paarrot.streamdeck.sdPlugin` into Stream Deck plugins folder
- Requires Paarrot desktop running with API on `http://127.0.0.1:33384`
- Actions: Toggle Mute, Toggle Deafen, Change Channel, Send Message, Get Status
## Architecture
```
Stream Deck button press
→ com.paarrot.streamdeck.sdPlugin/plugin/index.js
→ fetch http://127.0.0.1:33384/...
→ Paarrot Electron API (see local-api handoff)
```
## Key files
| Path | Role |
| --------------------------------------------------------------------- | -------------------------------- |
| `streamdeck-plugin/com.paarrot.streamdeck.sdPlugin/manifest.json` | Plugin manifest |
| `streamdeck-plugin/com.paarrot.streamdeck.sdPlugin/plugin/index.js` | Action implementations |
| `streamdeck-plugin/com.paarrot.streamdeck.sdPlugin/plugin/index.html` | Property inspector UI |
| `streamdeck-plugin/build.js` | Build `.streamDeckPlugin` bundle |
| `streamdeck-plugin/validate.js` | Manifest validation |
| `streamdeck-plugin/README.md` | User install guide |
| `streamdeck-plugin/QUICKSTART.md` | Dev quickstart |
## Data model
None — stateless HTTP client. Channel list and status come from Paarrot API responses.
## Dependencies
- Elgato Stream Deck software 6.0+
- Paarrot local API (port 33384)
- Node build tooling in `streamdeck-plugin/package.json`
## Integration points
- **local-api**: sole backend; breaking API changes require Stream Deck plugin update
- Icons: `streamdeck-plugin/.../images/paarrot.svg`, `status.svg`
## Testing
### Manual
1. Run Paarrot; confirm `/health` responds.
2. Load plugin in Stream Deck developer mode.
3. Map Toggle Mute to a key; join a call; press key.
4. Map Change Channel; verify room switch in Paarrot.
### Automated
- `node streamdeck-plugin/validate.js`
## Known issues & gotchas
- Plugin repo README still references placeholder GitHub URLs in places — update on publish
- No auth on API; same machine trust model
- Deafen/mute only meaningful during active calls
## Future work
- Auto-discover rooms without manual room id entry in property inspector
- Connection status indicator on Stream Deck key
## Related docs
- [local-api HANDOFF](../local-api/HANDOFF.md)
- [API.md](../../API.md)
- [streamdeck-plugin/README.md](../../../../streamdeck-plugin/README.md)
## Add your extra things here
- Bundle id: `com.paarrot.streamdeck`
- Build output: `.streamDeckPlugin` via `npm run build` in `streamdeck-plugin/`
@@ -0,0 +1,93 @@
# Sub-rooms — handoff
## Summary
Sub-rooms let a parent room own an ordered list of child rooms, displayed nested in the home channel list and manageable in room settings. Hierarchy is stored in Matrix room state (`im.paarrot.sub_rooms`), not only `m.space.child`, so channels can nest under a room without full space semantics.
## User-facing behavior
- Nested channels under a room in **Home** sidebar (indented tree)
- **Add Sub-Room** from room nav context menu (requires power level on `im.paarrot.sub_rooms`)
- **Room settings → Sub-rooms** to reorder/remove children
- Creating a sub-room from parent updates parent's `children` array
- Unjoined sub-rooms show as `UnjoinedSubRoomItem` with join affordance
## Architecture
```
Room state: im.paarrot.sub_rooms { children: string[] }
→ useRoomSubRooms hook
→ Home.tsx flatten tree (addRoomAndSubRooms)
→ RoomNavItem "Add Sub-Room" → CreateRoomModal
→ SubRooms.tsx settings editor
→ SpaceHierarchy.tsx (lobby) reads same state
```
## Key files
| Path | Role |
| ------------------------------------------------------------- | ------------------------------------ |
| `cinny/src/app/hooks/useRoomSubRooms.ts` | Hook + `PaarrotSubRoomsContent` type |
| `cinny/src/types/matrix/room.ts` | `StateEvent.PaarrotSubRooms` |
| `cinny/src/app/pages/client/home/Home.tsx` | Renders nested list |
| `cinny/src/app/features/room-nav/RoomNavItem.tsx` | Add sub-room action |
| `cinny/src/app/features/room-nav/UnjoinedSubRoomItem.tsx` | Unjoined child UI |
| `cinny/src/app/features/room-settings/sub-rooms/SubRooms.tsx` | Settings page |
| `cinny/src/app/features/create-room/CreateRoomModal.tsx` | Appends new room to parent state |
| `cinny/src/app/features/lobby/SpaceHierarchy.tsx` | Lobby hierarchy integration |
## Data model
| Event | State key | Content |
| ---------------------- | ------------ | ---------------------------------------------------- |
| `im.paarrot.sub_rooms` | `""` (empty) | `{ children: string[] }` — room IDs in display order |
Power levels: treat like other state events; editors need `state_default` or explicit level for `im.paarrot.sub_rooms`.
## Dependencies
- `matrix-js-sdk` state events
- Parent room must exist and user must have permission to send state
## Integration points
- **Home navigation**: primary consumer of tree flattening
- **Lobby/forums**: `SpaceHierarchy` reads sub-rooms for display
- **Create room flow**: auto-updates parent on sub-room create
- Distinct from **m.space.child** space hierarchy (may coexist)
## Testing
### Manual
1. In a room where you have admin, add sub-room from nav menu.
2. Verify child appears indented under parent in Home.
3. Reorder in Room settings → Sub-rooms.
4. Leave child room; verify unjoined state UI.
5. Check lobby view shows hierarchy when applicable.
### Automated
- None
## Known issues & gotchas
- Only **joined** sub-rooms appear in home tree; unjoined listed separately
- Top-level filter: rooms that appear in any parent's `children` are excluded from root list
- Creating sub-room sends state event on **parent** — failure leaves orphan room
- `StateEvent.PaarrotSubRooms as any` casts in sendStateEvent — typing debt
## Future work
- Sync with `m.space.child` for federation-friendly hierarchy
- Drag-and-drop reorder in nav (DnD exists in lobby, not necessarily sub-rooms settings)
- Depth limits / circular reference guards
## Related docs
- [lobby-forums HANDOFF](../lobby-forums/HANDOFF.md)
## Add your extra things here
- Interface: `PaarrotSubRoomsContent { children: string[] }` in `useRoomSubRooms.ts`
- Permission check pattern: `permissions.stateEvent(StateEvent.PaarrotSubRooms, userId)`
@@ -0,0 +1,89 @@
# Themes & appearance — handoff
## Summary
Theming covers light/dark/system themes, custom CSS variables, font choices, page zoom, message spacing, and view transitions. Themes can be extended by plugins.
## User-facing behavior
- Theme toggle in settings (light / dark / system)
- Page zoom slider (General settings)
- Message spacing density
- View transitions on navigation (where supported)
- Plugin-registered custom themes
## Architecture
```
ThemeManager.tsx — auth vs client theme application
settings.ts — theme, zoom, spacing in settingsAtom
useTheme.ts — read/apply theme
ClientNonUIFeatures — PageZoomFeature, EmojiStyleFeature
vanilla-extract / folds tokens in colors.css.ts
```
## Key files
| Path | Role |
| ---------------------------------------------------- | -------------------------------- |
| `cinny/src/app/pages/ThemeManager.tsx` | Route-level theme |
| `cinny/src/app/state/settings.ts` | Settings including theme |
| `cinny/src/app/hooks/useTheme.ts` | Theme hook |
| `cinny/src/colors.css.ts` | Color tokens |
| `cinny/src/app/pages/client/ClientNonUIFeatures.tsx` | Page zoom CSS |
| `cinny/src/app/hooks/useViewTransitions.ts` | View transitions |
| `cinny/src/app/hooks/useMessageSpacing.ts` | Message density |
| `cinny/public/themes/` | Bundled theme files (if present) |
## Data model
| Key | Storage |
| -------------- | ------------------------------------------- |
| `settingsAtom` | theme, pageZoom, messageSpacing, emojiStyle |
## Dependencies
- `folds` design system
- `@vanilla-extract/css` for component styles
- CSS `prefers-color-scheme` for system theme
## Integration points
- **plugins**: `registerTheme` API
- **user-settings**: General tab controls
- **forum**: `forumTheme.css.ts` forum-specific styling
## Testing
### Manual
1. Switch dark/light; all pages consistent.
2. System theme follows OS.
3. Page zoom 80–150%; layout usable.
4. Plugin theme applies without breaking contrast.
### Automated
- None
## Known issues & gotchas
- Separate `AuthRouteThemeManager` and client theme — auth pages may differ
- Zoom uses `font-size` on `documentElement` — may affect rem layout globally
- Forum theme partially separate from global tokens
## Future work
- High contrast accessibility theme
- Per-room wallpaper from avatar metadata banner
## Related docs
- [user-settings HANDOFF](../user-settings/HANDOFF.md)
- [plugins HANDOFF](../plugins/HANDOFF.md)
- [avatar-metadata HANDOFF](../avatar-metadata/HANDOFF.md)
## Add your extra things here
- `EmojiStyle` enum affects `--font-emoji` CSS variable
- `useViewTransitions` tied to browser View Transitions API support
@@ -0,0 +1,94 @@
# User settings — handoff
## Summary
Global user settings modal: general preferences, account profile, notifications, audio devices, sessions/devices, emojis, plugins, developer tools, and about. Accessed from sidebar Settings tab.
## User-facing behavior
- **General**: theme, language, page zoom, emoji style, message spacing
- **Account**: display name, avatar (with Paarrot metadata), matrix id
- **Notifications**: push rules, keywords, system permission
- **Audio**: input/output device selection for calls
- **Devices**: verify sessions, key backup, cross-signing
- **Plugins**: see plugins handoff
- **About**: version info
## Architecture
```
Settings.tsx — tabbed modal
→ general/, account/, notifications/, audio/, devices/, emojis-stickers/, plugins/, developer-tools/, about/
SettingsPages enum
```
## Key files
| Path | Role |
| ----------------------------------------------------- | ------------------------- |
| `cinny/src/app/features/settings/Settings.tsx` | Settings modal shell |
| `cinny/src/app/features/settings/general/General.tsx` | General prefs |
| `cinny/src/app/features/settings/account/Profile.tsx` | Profile + avatar metadata |
| `cinny/src/app/features/settings/notifications/` | Notification rules |
| `cinny/src/app/features/settings/audio/Audio.tsx` | Call audio devices |
| `cinny/src/app/features/settings/devices/` | Sessions & verification |
| `cinny/src/app/features/settings/about/About.tsx` | About page |
| `cinny/src/app/state/settings.ts` | Settings atom |
| `cinny/src/app/pages/client/sidebar/SettingsTab.tsx` | Entry point |
## Data model
| Key | Storage |
| -------------- | --------------------------------------------- |
| `settingsAtom` | localStorage (theme, zoom, emoji style, etc.) |
| Profile | Matrix account data + avatar MXC |
| Push rules | Homeserver account data |
## Dependencies
- `folds` modal/page components
- Notification API, MediaDevices API
## Integration points
- **avatar-metadata**: profile color in avatar upload
- **emoji-stickers**: emojis tab
- **plugins**: plugins tab
- **e2e-and-devices**: devices tab overlaps
- **background-notifications**: notification settings
- **voice-calls**: audio device prefs
## Testing
### Manual
1. Change theme; persists reload.
2. Page zoom 125%; UI scales.
3. Notification keyword add; trigger match.
4. Audio device switch during call.
### Automated
- None
## Known issues & gotchas
- Settings modal vs mobile full-page — `useScreenSizeContext`
- Logout dialog from settings clears session
## Future work
- Settings search
- Export/import settings JSON
## Related docs
- [avatar-metadata HANDOFF](../avatar-metadata/HANDOFF.md)
- [emoji-stickers HANDOFF](../emoji-stickers/HANDOFF.md)
- [plugins HANDOFF](../plugins/HANDOFF.md)
- [e2e-and-devices HANDOFF](../e2e-and-devices/HANDOFF.md)
- [themes-and-appearance HANDOFF](../themes-and-appearance/HANDOFF.md)
## Add your extra things here
- `SettingsPages` enum lists all tabs — add new pages here + menu item
@@ -0,0 +1,97 @@
# Voice & video calls — handoff
## Summary
Paarrot supports Matrix RTC voice/video calls via MSC3401 (`org.matrix.msc3401.call.member`) and LiveKit. Calls can be docked in the sidebar, support screen share, remote cursors, mute/deafen, and are wired to the local HTTP API for external control.
## User-facing behavior
- Join/start calls from room UI (when homeserver exposes RTC/LiveKit via `.well-known`)
- Docked call panel in sidebar; full overlay mode
- Mute, deafen, camera, screen share controls
- Call participants shown in room nav (`CallParticipantsIndicator`)
## Architecture
```
useCallService (CallProvider)
→ CallService (LiveKit room, Matrix call member state)
→ useRtcConfig: .well-known m.rtc + LiveKit focus
→ UI: CallOverlay, DockedCallPanel, SidebarDockedCallPanel
→ getCallService() global ref for Electron API (paarrot-api.ts)
```
## Key files
| Path | Role |
| --------------------------------------------------------------- | ------------------------------------- |
| `cinny/src/app/features/call/useCall.ts` | React context, global CallService ref |
| `cinny/src/app/features/call/CallService.ts` | Core call logic |
| `cinny/src/app/features/call/types.ts` | CallState, ActiveCall, events |
| `cinny/src/app/features/call/useRtcConfig.ts` | Homeserver RTC / LiveKit discovery |
| `cinny/src/app/features/call/CallOverlay.tsx` | Full-screen call UI |
| `cinny/src/app/features/call/DockedCallPanel.tsx` | Docked UI |
| `cinny/src/app/features/call/SidebarDockedCallPanel.tsx` | Sidebar variant |
| `cinny/src/app/features/call/useRemoteCursor.ts` | Screen-share cursor sync |
| `cinny/src/app/features/call/CallSounds.ts` | Join/leave sounds |
| `cinny/src/app/features/room-nav/CallParticipantsIndicator.tsx` | Nav badge |
| `cinny/src/types/matrix/room.ts` | `StateEvent.CallMember` |
## Data model
| Key | Scope | Notes |
| -------------------------------- | ---------- | ------------------------- |
| `org.matrix.msc3401.call.member` | Room state | Call membership |
| LiveKit JWT / room | Ephemeral | From homeserver RTC focus |
Call mute/deafen/video state lives in `CallService` memory, not Matrix account data.
## Dependencies
- `livekit-client` (verify in package.json)
- Homeserver `.well-known` RTC configuration
- Browser/Electron media permissions (mic, camera, screen capture)
- Electron `desktopCapturer` for screen share (main process)
## Integration points
- **local-api**: mute/deafen/status endpoints
- **Stream Deck**: uses call mute/deafen via API
- **Room nav**: participant indicators
- **Electron main**: screen capture IPC if applicable
## Testing
### Manual
1. Use a homeserver with Matrix RTC + LiveKit configured.
2. Start voice call in a room; verify audio both ways.
3. Toggle mute/deafen; verify API `/status` reflects state.
4. Screen share; verify remote cursor if enabled.
5. Dock/undock call panel.
### Automated
- None identified
## Known issues & gotchas
- `callSupported` false until `.well-known` RTC fetch completes — UI should hide call buttons when unsupported
- `getCallService()` must be set before API mute actions work
- Platform differences: screen capture APIs differ Electron vs browser vs Android
## Future work
- Call recording, noise suppression settings
- Better reconnection / call transfer
- MSC3401 spec tracking as it stabilizes
## Related docs
- [local-api HANDOFF](../local-api/HANDOFF.md)
- Matrix MSC3401 (upstream spec)
## Add your extra things here
- `fetchWellKnownWithRTC`, `getLiveKitFocus`, `getLiveKitHomeserverPriority` in `useRtcConfig.ts`
- Global singleton: `globalCallServiceInstance` in `useCall.ts` for non-React consumers
+139
View File
@@ -0,0 +1,139 @@
import { createRequire } from 'node:module';
import { fixupConfigRules } from '@eslint/compat';
import globals from 'globals';
import js from '@eslint/js';
import airbnb from 'eslint-config-airbnb';
import prettier from 'eslint-config-prettier';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import jsxAllyPlugin from 'eslint-plugin-jsx-a11y';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
const require = createRequire(import.meta.url);
// Config entries without `files` only match .js/.mjs, so every entry needs the same file set.
const files = ['**/*.js', '**/*.mjs', '**/*.cjs', '**/*.ts', '**/*.tsx'];
// eslint-config-airbnb 19 is legacy-only: `extends` are paths to rule modules and flat config
// rejects `extends`/`env`/`parserOptions`, so take their rules and set the env here instead.
const airbnbRules = (config) =>
(config.extends || []).flatMap((p) => airbnbRules(require(p))).concat(config);
// Plugins are registered once (redefining a plugin is an error) and fixed up so the legacy
// rules that call context.getFilename still work.
export default [
...fixupConfigRules([
{
files,
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'@typescript-eslint': tsPlugin,
import: importPlugin,
'jsx-a11y': jsxAllyPlugin,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
globals: { ...globals.browser, ...globals.es2021, JSX: 'readonly' },
},
},
]),
...[
js.configs.recommended,
reactPlugin.configs.flat.recommended,
reactHooksPlugin.configs.flat.recommended,
tsPlugin.configs['flat/eslint-recommended'],
tsPlugin.configs['flat/recommended'],
...airbnbRules(airbnb),
prettier,
{
rules: {
'linebreak-style': 0,
'no-underscore-dangle': 0,
'no-shadow': 'off',
'no-console': 'off',
// The build uses the automatic JSX runtime, so this rule asks for imports the code never needs.
'react/react-in-jsx-scope': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
'react/jsx-filename-extension': [
'error',
{
extensions: ['.tsx', '.jsx'],
},
],
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react-hooks/rules-of-hooks': 'error',
// The 9 findings were restructured to a reactive source where one exists. The 3 left have
// none: a 1s poll counter in useTheme.ts and a mount-only effect in RoomTimeline.tsx.
'react-hooks/exhaustive-deps': 'off',
// The build does not run React Compiler, so these rules report advice about a compiler
// that never runs. Keep the two rules above, which catch real bugs.
'react-hooks/set-state-in-effect': 'off',
'react-hooks/set-state-in-render': 'off',
'react-hooks/refs': 'off',
'react-hooks/immutability': 'off',
'react-hooks/incompatible-library': 'off',
'react-hooks/preserve-manual-memoization': 'off',
'react-hooks/purity': 'off',
'react-hooks/use-memo': 'off',
// Genuine shift and mask work in discordCollectibles.ts and cryptE2ERoomKeys.js.
'no-bitwise': 'off',
// 60 of the 61 findings are property mutations on objects the caller passes in, and the
// callers depend on the mutation. Reassigning the parameter itself is still a finding.
'no-param-reassign': ['error', { props: false }],
// The sequential awaits here are deliberate: the rate-limit delays in Permissions.tsx and
// the endpoint poll loop in backgroundSync.ts break if the awaits are parallelised.
'no-await-in-loop': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-shadow': 'error',
// The 14 findings left are vendored plugin API types that declare any, event keys chosen at
// runtime, and msgContent builders that cannot produce RoomMessageEventContent.
'@typescript-eslint/no-explicit-any': 'off',
// Matrix video events carry no caption field, so there is no caption source to read.
'jsx-a11y/media-has-caption': 'off',
// Prism tokens are not unique within a line, so the array index is the only key available.
'react/no-array-index-key': 'off',
},
},
].flatMap((config) =>
(Array.isArray(config) ? config : [config]).map((config) => ({
files,
rules: config.rules || {},
...(config.settings ? { settings: config.settings } : {}),
})),
),
// Type-only references (React.DragEvent, PermissionState) are not runtime globals, so no-undef
// has to be off for the TS files too, not just *.ts. The base no-unused-vars also double-fires on
// type-signature params and enum members, which @typescript-eslint/no-unused-vars handles instead.
{
files: ['**/*.ts', '**/*.tsx'],
rules: { 'no-undef': 'off', 'no-unused-vars': 'off' },
},
];
+11 -7
View File
@@ -1,10 +1,13 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<base href="./" /> <base href="./" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover" /> <meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover"
/>
<title>Paarrot</title> <title>Paarrot</title>
<meta name="name" content="Paarrot" /> <meta name="name" content="Paarrot" />
<meta name="author" content="Ajay Bura" /> <meta name="author" content="Ajay Bura" />
@@ -12,10 +15,7 @@
name="description" name="description"
content="A Matrix client where you can enjoy the conversation using simple, elegant and secure interface protected by e2ee with the power of open source." content="A Matrix client where you can enjoy the conversation using simple, elegant and secure interface protected by e2ee with the power of open source."
/> />
<meta <meta name="keywords" content="paarrot, matrix, matrix client, matrix.org, element" />
name="keywords"
content="paarrot, matrix, matrix client, matrix.org, element"
/>
<meta property="og:title" content="Paarrot" /> <meta property="og:title" content="Paarrot" />
<meta property="og:url" content="https://github.com/Paarrot/Paarrot-Desktop" /> <meta property="og:url" content="https://github.com/Paarrot/Paarrot-Desktop" />
@@ -27,6 +27,10 @@
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<link id="favicon" rel="shortcut icon" href="./public/favicon.ico" /> <link id="favicon" rel="shortcut icon" href="./public/favicon.ico" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Space+Grotesk:wght@400;600;700&display=swap"
/>
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
@@ -86,7 +90,7 @@
href="./public/res/apple/apple-touch-icon-180x180.png" href="./public/res/apple/apple-touch-icon-180x180.png"
/> />
</head> </head>
<body id="appBody" style="background-color: #262626;"> <body id="appBody" style="background-color: #262626">
<script> <script>
window.global ||= window; window.global ||= window;
</script> </script>
+6073 -5421
View File
File diff suppressed because it is too large Load Diff
+90 -83
View File
@@ -9,7 +9,7 @@
}, },
"scripts": { "scripts": {
"start": "vite", "start": "vite",
"build": "vite build", "build": "node scripts/generate-update-manifest.mjs && vite build",
"lint": "yarn check:eslint && yarn check:prettier", "lint": "yarn check:eslint && yarn check:prettier",
"check:eslint": "eslint src/*", "check:eslint": "eslint src/*",
"check:prettier": "prettier --check .", "check:prettier": "prettier --check .",
@@ -20,105 +20,112 @@
"author": "Ajay Bura", "author": "Ajay Bura",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"dependencies": { "dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "1.1.6", "@atlaskit/pragmatic-drag-and-drop": "2.0.1",
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "1.3.0", "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "3.0.0",
"@atlaskit/pragmatic-drag-and-drop-hitbox": "1.0.3", "@atlaskit/pragmatic-drag-and-drop-hitbox": "2.0.0",
"@fontsource/inter": "4.5.14", "@fontsource-variable/inter": "5.2.8",
"@fontsource/caveat": "5.3.0",
"@fontsource/inter": "5.2.8",
"@paarrot/plugin-manager": "git+http://synbox.ruv.wtf:8418/litruv/plugin-manager.git", "@paarrot/plugin-manager": "git+http://synbox.ruv.wtf:8418/litruv/plugin-manager.git",
"@tanstack/react-query": "5.24.1", "@tanstack/react-query": "5.101.2",
"@tanstack/react-query-devtools": "5.24.1", "@tanstack/react-query-devtools": "5.101.2",
"@tanstack/react-virtual": "3.2.0", "@tanstack/react-virtual": "3.14.5",
"@tauri-apps/api": "2.9.1", "@tauri-apps/api": "2.11.1",
"@tauri-apps/plugin-dialog": "2.6.0",
"@tauri-apps/plugin-fs": "2.4.5",
"@tauri-apps/plugin-http": "2.5.7",
"@tauri-apps/plugin-notification": "2.3.3",
"@tauri-apps/plugin-opener": "2",
"@tauri-apps/plugin-process": "2.3.1",
"@tauri-apps/plugin-updater": "2.10.0",
"@types/pako": "2.0.4", "@types/pako": "2.0.4",
"@vanilla-extract/css": "1.9.3", "@vanilla-extract/css": "1.21.1",
"@vanilla-extract/recipes": "0.3.0", "@vanilla-extract/recipes": "0.5.7",
"@vanilla-extract/vite-plugin": "3.7.1", "@vanilla-extract/vite-plugin": "5.2.4",
"await-to-js": "3.0.0", "await-to-js": "3.0.0",
"badwords-list": "2.0.1-4", "badwords-list": "2.0.1-4",
"blurhash": "2.0.4", "blurhash": "2.0.5",
"browser-encrypt-attachment": "0.3.0", "browser-encrypt-attachment": "0.3.0",
"chroma-js": "3.1.2", "chroma-js": "3.2.0",
"classnames": "2.3.2", "classnames": "2.5.1",
"dateformat": "5.0.3", "dateformat": "5.0.3",
"dayjs": "1.11.10", "dayjs": "1.11.21",
"domhandler": "5.0.3", "domhandler": "6.0.1",
"emojibase": "15.3.1", "emojibase": "17.0.0",
"emojibase-data": "15.3.2", "emojibase-data": "17.0.0",
"file-saver": "2.0.5", "file-saver": "2.0.5",
"focus-trap-react": "10.0.2", "focus-trap-react": "12.0.3",
"folds": "2.4.0", "folds": "2.7.0",
"gif.js": "0.2.0", "gif.js": "0.2.0",
"html-dom-parser": "4.0.0", "html-dom-parser": "8.0.0",
"html-react-parser": "4.2.0", "html-react-parser": "6.1.4",
"i18next": "23.12.2", "i18next": "26.3.5",
"i18next-browser-languagedetector": "8.0.0", "i18next-browser-languagedetector": "8.2.1",
"i18next-http-backend": "2.5.2", "i18next-http-backend": "4.0.0",
"immer": "9.0.16", "immer": "11.1.11",
"is-hotkey": "0.2.0", "is-hotkey": "0.2.0",
"jotai": "2.6.0", "jotai": "2.20.1",
"linkify-react": "4.1.3", "linkify-react": "4.3.3",
"linkifyjs": "4.1.3", "linkifyjs": "4.3.3",
"livekit-client": "2.17.0", "livekit-client": "2.20.0",
"lottie-web": "5.13.0", "lottie-web": "5.13.0",
"matrix-js-sdk": "38.2.0", "lucide-react": "1.23.0",
"matrix-js-sdk": "41.9.0",
"millify": "6.1.0", "millify": "6.1.0",
"pako": "2.1.0", "pako": "3.0.1",
"pdfjs-dist": "4.2.67", "pdfjs-dist": "6.1.200",
"prismjs": "1.30.0", "prismjs": "1.30.0",
"react": "18.2.0", "react": "19.2.7",
"react-aria": "3.29.1", "react-aria": "3.50.0",
"react-blurhash": "0.2.0", "react-blurhash": "0.3.0",
"react-colorful": "5.6.1", "react-colorful": "5.7.0",
"react-dom": "18.2.0", "react-dom": "19.2.7",
"react-error-boundary": "4.0.13", "react-error-boundary": "6.1.2",
"react-google-recaptcha": "2.1.0", "react-google-recaptcha": "3.1.0",
"react-i18next": "15.0.0", "react-i18next": "17.0.8",
"react-range": "1.8.14", "react-markdown": "10.1.0",
"react-router-dom": "6.20.0", "react-range": "1.10.0",
"sanitize-html": "2.12.1", "react-router-dom": "7.18.1",
"slate": "0.112.0", "remark-gfm": "4.0.1",
"slate-dom": "0.112.2", "sanitize-html": "2.17.5",
"slate-history": "0.110.3", "slate": "0.124.1",
"slate-react": "0.112.1", "slate-dom": "0.124.1",
"ua-parser-js": "1.0.35" "slate-history": "0.113.1",
"slate-react": "0.125.1",
"ua-parser-js": "2.0.10"
}, },
"devDependencies": { "devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "0.2.3", "@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rollup/plugin-inject": "5.0.3", "@eslint/compat": "2.1.1",
"@rollup/plugin-wasm": "6.1.1", "@eslint/js": "10.0.1",
"@types/chroma-js": "3.1.1", "@monaco-editor/react": "4.7.0",
"@types/file-saver": "2.0.5", "@rollup/plugin-inject": "5.0.5",
"@rollup/plugin-wasm": "6.2.2",
"@types/chroma-js": "3.1.2",
"@types/file-saver": "2.0.7",
"@types/is-hotkey": "0.1.10", "@types/is-hotkey": "0.1.10",
"@types/node": "18.11.18", "@types/node": "26.1.1",
"@types/prismjs": "1.26.0", "@types/prismjs": "1.26.6",
"@types/react": "18.2.39", "@types/react": "19.2.17",
"@types/react-dom": "18.2.17", "@types/react-dom": "19.2.3",
"@types/react-google-recaptcha": "2.1.8", "@types/react-google-recaptcha": "2.1.9",
"@types/sanitize-html": "2.9.0", "@types/sanitize-html": "2.16.1",
"@types/ua-parser-js": "0.7.36", "@types/ua-parser-js": "0.7.39",
"@typescript-eslint/eslint-plugin": "5.46.1", "@typescript-eslint/eslint-plugin": "8.63.0",
"@typescript-eslint/parser": "5.46.1", "@typescript-eslint/parser": "8.63.0",
"@vitejs/plugin-react": "4.2.0", "@vitejs/plugin-react": "6.0.3",
"buffer": "6.0.3", "buffer": "6.0.3",
"eslint": "8.29.0", "eslint": "10.6.0",
"eslint-config-airbnb": "19.0.4", "eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.5.0", "eslint-config-prettier": "10.1.8",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.32.0",
"eslint-plugin-jsx-a11y": "6.6.1", "eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-react": "7.31.11", "eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-hooks": "7.1.1",
"prettier": "2.8.1", "globals": "17.13.0",
"typescript": "4.9.4", "monaco-editor": "0.52.2",
"vite": "5.4.19", "prettier": "3.9.4",
"vite-plugin-pwa": "0.20.5", "typescript": "6.0.3",
"vite-plugin-static-copy": "1.0.4", "vite": "8.1.3",
"vite-plugin-top-level-await": "1.4.4" "vite-plugin-pwa": "1.3.0",
"vite-plugin-static-copy": "4.1.1",
"vite-plugin-top-level-await": "1.6.0"
},
"allowScripts": {
"@swc/core@1.15.43": true,
"esbuild@0.28.1": true
} }
} }
+857 -1
View File
File diff suppressed because one or more lines are too long
+16
View File
@@ -0,0 +1,16 @@
---
version: 4.11.175
title: Stability & polish
date: 2026-08-10
summary: Desktop update flow improvements and UI refinements.
---
## Desktop updates
- Smoother download and install flow in the title bar updater.
- Better handling when an update is already downloading.
## UI polish
- Refined spacing and contrast in settings panels.
- Improved mobile layout for room headers and notifications.
+22
View File
@@ -0,0 +1,22 @@
---
version: 4.11.177
title: Profile colors & banners
date: 2026-08-23
summary: Username colors now follow MSC4522 with separate dark and light theme pickers.
---
## Profile colors (MSC4522)
Username colors are now stored on your Matrix profile instead of inside avatar images. In turn **will need to be updated in your Account settings**, this is now cross compatible with Element + Cinny
- Set **separate colors for dark and light themes** in Settings → Account → Profile.
- Per-room username overrides are read from member profile data when available.
![Paarrot](./images/usernamecolors.png)
## Profile banners (MSC4133)
Profile banners now live on your Matrix profile via `m.banner_url` (MSC4133), not embedded in avatar metadata.
- Upload or remove a banner independently from your avatar.
- Other clients that support MSC4133 can read your banner directly.
+21
View File
@@ -0,0 +1,21 @@
---
version: 4.11.185
title: Discord collectibles
date: 2026-08-24
summary: Add Discord-style profile effects, nameplates, and avatar decorations to Paarrot profiles.
---
## Discord collectibles
- Browse and apply profile effects, animated nameplates, and avatar decorations in Settings → Account → Profile.
- Collectible assets are uploaded to your Matrix profile, so other Paarrot users can see them without Discord.
- The catalog now comes from a public git, and no Discord token is required in Paarrot for the cosmetics.
- Profile-effect previews play their intro and loop animations, with a mini profile preview for each effect.
![Discord Cosmetics 1](./images/discordcosmetics1.png) ![Discord Cosmetics 2](./images/discordcosmetics2.png)
## Profile presentation
- Avatar decorations render in messages, profile cards, and the bottom sidebar avatar.
- Nameplates to the right of messages, beneath timestamps and can be displayed behind the bottom sidebar avatar with opacity settings.
- Customize the sidebar nameplate opacity in Settings → General → Collectibles.
+14
View File
@@ -0,0 +1,14 @@
---
version: 4.11.193
title: Profile caching
date: 2026-10-06
summary: Profile colour, banner, and collectibles now share one cache, so opening a profile makes one request instead of three.
---
## Profile caching
- Colour, banner, and collectibles all come from the same profile endpoint, and they now read through one shared cache with a single TTL instead of keeping three separate caches with different expiries.
- Opening a profile view costs one request, and concurrent viewers of the same user share it instead of each firing their own.
- Banner and collectible images are kept as cached blob URLs and reused across views, instead of being re-downloaded and discarded every time a profile opens.
- Profile cards read the sync-cached user when it is available and only fetch when both the SDK cache and the shared cache are cold.
- A redundant database scan was removed from the crypto startup path, which shaves a little off launch.
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 889 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

+23
View File
@@ -0,0 +1,23 @@
{
"current": "currentupdate.md",
"older": [
{
"file": "4.11.185.md",
"version": "4.11.185",
"title": "Discord collectibles",
"date": "2026-08-24"
},
{
"file": "4.11.177.md",
"version": "4.11.177",
"title": "Profile colors & banners",
"date": "2026-08-23"
},
{
"file": "4.11.175.md",
"version": "4.11.175",
"title": "Stability & polish",
"date": "2026-08-10"
}
]
}
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/env bash
# Files one open Gitea issue per rule key, deduped by the marker line in the issue body.
# Never exits non-zero: findings are reported, not enforced.
set -u
API_BASE="${API_BASE:?API_BASE is required}"
REPO="${REPO:?REPO is required}"
TOKEN="${TOKEN:?TOKEN is required}"
SHA="${SHA:-}"
BASE="${WEB_BASE:-${API_BASE%/api/v1}}"
LABEL="ci-checks"
SHOW="${SHOW:-50}"
cd "$(dirname "$0")/.."
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT
FINDINGS="$WORK/findings.tsv"
: > "$FINDINGS"
# key<TAB>violation, one line per finding.
npx eslint src --format json > "$WORK/eslint.json" || true
jq -r --arg root "$PWD" '.[] | .filePath as $f | .messages[] | select(.ruleId) | "eslint/" + .ruleId + "\t" + (($f | ltrimstr($root + "/")) + ":" + (.line | tostring))' "$WORK/eslint.json" >> "$FINDINGS"
npx prettier --check . > "$WORK/prettier.log" 2>&1 || true
# Prettier forces colour in CI, so strip the ANSI codes before matching.
sed -E 's/\x1b\[[0-9;]*m//g' "$WORK/prettier.log" | sed -nE 's/^\[warn\] (.*)$/prettier\t\1/p' >> "$FINDINGS"
npx tsc --noEmit > "$WORK/tsc.log" 2>&1 || true
sed -E 's/\x1b\[[0-9;]*m//g' "$WORK/tsc.log" | sed -nE 's/^(.*)\(([0-9]+),([0-9]+)\): error (TS[0-9]+):.*/tsc\/\4\t\1(\2,\3)/p' >> "$FINDINGS"
api() { # api METHOD PATH [JSON] -> response body on stdout, non-zero on HTTP failure
local method=$1 path=$2 data=${3-} code
code=$(curl -sS -o "$WORK/resp" -w '%{http_code}' -X "$method" \
-H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
${data:+-d "$data"} "$API_BASE/repos/$REPO$path") || return 1
case "$code" in
200 | 201) cat "$WORK/resp" ;;
*) echo "HTTP $code $method $path: $(cat "$WORK/resp")" >&2; return 1 ;;
esac
}
body() { # body KEY HASH VIOLATIONS_FILE
printf '<!-- ci-check: %s -->\n<!-- ci-check-hash: %s -->\n\n`%s`: %d violations.\n\n```text\n' \
"$1" "$2" "$1" "$(wc -l < "$3")"
head -n "$SHOW" "$3"
printf '```\n'
}
LABEL_ID=$(api GET "/labels?limit=100" | jq -r --arg n "$LABEL" '[.[] | select(.name == $n) | .id] | first // empty')
if [ -z "$LABEL_ID" ]; then
LABEL_ID=$(api POST "/labels" "$(jq -n --arg n "$LABEL" '{name: $n, color: "006060"}')" | jq -r '.id')
fi
# Gitea caps per_page at 50, so paging is required or dedupe misses issues past the first page.
# Accumulate as JSONL: passing the accumulated set as a jq program argument overflows argv.
OPEN="$WORK/open.jsonl"
: > "$OPEN"
for page in 1 2 3 4 5 6 7 8; do
api GET "/issues?state=open&limit=50&page=$page" | jq -c --arg l "$LABEL" '[.[] | select((.labels // []) | any(.name == $l))]' > "$WORK/page.json"
n=$(jq -r 'length' "$WORK/page.json")
[ -z "$n" ] && break
jq -c '.[]' "$WORK/page.json" >> "$OPEN"
[ "$n" -lt 50 ] && break
done
for key in $(cut -f1 "$FINDINGS" | sort -u); do
vf="$WORK/violations.tsv"
awk -F'\t' -v k="$key" '$1 == k' "$FINDINGS" | sort > "$vf"
hash=$(sha256sum < "$vf" | cut -d' ' -f1)
row=$(jq -c --arg k "$key" 'select((.body // "") | contains("<!-- ci-check: " + $k + " -->"))' "$OPEN" | head -1)
if [ -z "$row" ]; then
api POST "/issues" "$(jq -n --arg t "ci-check: $key" --arg b "$(body "$key" "$hash" "$vf")" --argjson l "$LABEL_ID" '{title: $t, body: $b, labels: [$l]}')" > /dev/null
elif ! echo "$row" | jq -e --arg h "$hash" '(.body // "") | contains("<!-- ci-check-hash: " + $h + " -->")' > /dev/null; then
api PATCH "/issues/$(jq -r '.number' <<< "$row")" "$(jq -n --arg b "$(body "$key" "$hash" "$vf")" '{body: $b}')" > /dev/null
fi
done
jq -r '[((.body // "") | capture("<!-- ci-check: (?<k>[^ ]+) -->").k), .number] | @tsv' "$OPEN" > "$WORK/keys.tsv"
while IFS=$'\t' read -r key number; do
if ! grep -qF -- "$key"$'\t' "$FINDINGS"; then
if [ -n "$SHA" ]; then
api POST "/issues/$number/comments" "$(jq -n --arg b "Fixed in [$(printf '%s' "$SHA" | cut -c1-7)]($BASE/$REPO/commit/$SHA)." '{body: $b}')" > /dev/null
fi
api PATCH "/issues/$number" '{"state": "closed"}' > /dev/null
fi
done < "$WORK/keys.tsv"
exit 0
+112
View File
@@ -0,0 +1,112 @@
#!/usr/bin/env node
/**
* Regenerates public/update/manifest.json from markdown files.
*
* - currentupdate.md is always the "current" entry
* - Other *.md files matching X.Y.Z.md become "older" (sorted newest first)
* - title, date, version come from YAML frontmatter when present
*/
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const ROOT = path.resolve(__dirname, '..');
const UPDATE_DIR = path.join(ROOT, 'public', 'update');
const MANIFEST_PATH = path.join(UPDATE_DIR, 'manifest.json');
const CURRENT_FILE = 'currentupdate.md';
const VERSION_FILE_RE = /^(\d+\.\d+\.\d+)\.md$/;
const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
function parseFrontmatter(source) {
const match = FRONTMATTER_RE.exec(source.trimStart());
if (!match) return {};
const frontmatter = {};
match[1].split('\n').forEach((line) => {
const colon = line.indexOf(':');
if (colon <= 0) return;
const key = line.slice(0, colon).trim();
const raw = line.slice(colon + 1).trim();
frontmatter[key] = raw.replace(/^['"]|['"]$/g, '');
});
return frontmatter;
}
function compareVersions(a, b) {
const pa = a.split('.').map((part) => Number.parseInt(part, 10));
const pb = b.split('.').map((part) => Number.parseInt(part, 10));
const len = Math.max(pa.length, pb.length);
for (let i = 0; i < len; i += 1) {
const na = pa[i] ?? 0;
const nb = pb[i] ?? 0;
if (na !== nb) return nb - na;
}
return 0;
}
function readMarkdownMeta(fileName) {
const filePath = path.join(UPDATE_DIR, fileName);
const source = fs.readFileSync(filePath, 'utf8');
const frontmatter = parseFrontmatter(source);
const versionFromName = VERSION_FILE_RE.exec(fileName)?.[1];
return {
file: fileName,
version: frontmatter.version ?? versionFromName,
title: frontmatter.title,
date: frontmatter.date,
};
}
function buildManifest() {
if (!fs.existsSync(UPDATE_DIR)) {
throw new Error(`Update directory not found: ${UPDATE_DIR}`);
}
const currentPath = path.join(UPDATE_DIR, CURRENT_FILE);
if (!fs.existsSync(currentPath)) {
throw new Error(`Missing ${CURRENT_FILE} in ${UPDATE_DIR}`);
}
const older = fs
.readdirSync(UPDATE_DIR, { withFileTypes: true })
.filter((entry) => entry.isFile() && VERSION_FILE_RE.test(entry.name))
.map((entry) => readMarkdownMeta(entry.name))
.filter((entry) => entry.version)
.sort((a, b) => compareVersions(a.version, b.version));
return {
current: CURRENT_FILE,
older: older.map(({ file, version, title, date }) => {
const item = { file };
if (version) item.version = version;
if (title) item.title = title;
if (date) item.date = date;
return item;
}),
};
}
function main() {
const manifest = buildManifest();
const json = `${JSON.stringify(manifest, null, 2)}\n`;
let previous = null;
if (fs.existsSync(MANIFEST_PATH)) {
previous = fs.readFileSync(MANIFEST_PATH, 'utf8');
}
if (previous === json) {
console.log('[update-manifest] manifest.json is already up to date');
return;
}
fs.writeFileSync(MANIFEST_PATH, json, 'utf8');
console.log(`[update-manifest] wrote manifest.json (${manifest.older.length} older version(s))`);
}
main();
+5 -6
View File
@@ -2,12 +2,10 @@ import React, { FormEventHandler, useCallback, useEffect, useMemo, useRef, useSt
import { import {
Box, Box,
Text, Text,
Icon,
Icons,
IconButton, IconButton,
Input, Input,
Button, Button,
TextArea as TextAreaComponent, TextArea,
color, color,
Spinner, Spinner,
Chip, Chip,
@@ -15,6 +13,7 @@ import {
config, config,
} from 'folds'; } from 'folds';
import { MatrixError } from 'matrix-js-sdk'; import { MatrixError } from 'matrix-js-sdk';
import { Icon, Icons } from './icons';
import { Cursor } from '../plugins/text-area'; import { Cursor } from '../plugins/text-area';
import { syntaxErrorPosition } from '../utils/dom'; import { syntaxErrorPosition } from '../utils/dom';
import { AsyncStatus, useAsyncCallback } from '../hooks/useAsyncCallback'; import { AsyncStatus, useAsyncCallback } from '../hooks/useAsyncCallback';
@@ -54,7 +53,7 @@ function AccountDataEdit({
const { handleKeyDown, operations, getTarget } = useTextAreaCodeEditor( const { handleKeyDown, operations, getTarget } = useTextAreaCodeEditor(
textAreaRef, textAreaRef,
EDITOR_INTENT_SPACE_COUNT EDITOR_INTENT_SPACE_COUNT,
); );
const [submitState, submit] = useAsyncCallback<void, MatrixError, [string, object]>(submitChange); const [submitState, submit] = useAsyncCallback<void, MatrixError, [string, object]>(submitChange);
@@ -167,7 +166,7 @@ function AccountDataEdit({
<Box shrink="No"> <Box shrink="No">
<Text size="L400">JSON Content</Text> <Text size="L400">JSON Content</Text>
</Box> </Box>
<TextAreaComponent <TextArea
ref={textAreaRef} ref={textAreaRef}
name="contentTextArea" name="contentTextArea"
style={{ style={{
@@ -276,7 +275,7 @@ export function AccountDataEditor({
const contentJSONStr = useMemo( const contentJSONStr = useMemo(
() => JSON.stringify(data.content, null, EDITOR_INTENT_SPACE_COUNT), () => JSON.stringify(data.content, null, EDITOR_INTENT_SPACE_COUNT),
[data.content] [data.content],
); );
return ( return (
+6 -6
View File
@@ -24,7 +24,7 @@ export function AngleSelector({
onChange, onChange,
size = 80, size = 80,
disabled = false, disabled = false,
}: AngleSelectorProps): JSX.Element { }: AngleSelectorProps): React.JSX.Element {
const containerRef = useRef<HTMLDivElement>(null); const containerRef = useRef<HTMLDivElement>(null);
const [isDragging, setIsDragging] = useState(false); const [isDragging, setIsDragging] = useState(false);
@@ -52,7 +52,7 @@ export function AngleSelector({
return Math.round(angle); return Math.round(angle);
}, },
[value] [value],
); );
/** /**
@@ -67,7 +67,7 @@ export function AngleSelector({
const newAngle = calculateAngle(e.clientX, e.clientY); const newAngle = calculateAngle(e.clientX, e.clientY);
onChange(newAngle); onChange(newAngle);
}, },
[disabled, calculateAngle, onChange] [disabled, calculateAngle, onChange],
); );
/** /**
@@ -79,7 +79,7 @@ export function AngleSelector({
const newAngle = calculateAngle(e.clientX, e.clientY); const newAngle = calculateAngle(e.clientX, e.clientY);
onChange(newAngle); onChange(newAngle);
}, },
[isDragging, disabled, calculateAngle, onChange] [isDragging, disabled, calculateAngle, onChange],
); );
/** /**
@@ -90,7 +90,7 @@ export function AngleSelector({
}, []); }, []);
// Calculate line endpoint position // Calculate line endpoint position
const lineLength = (size / 2) - 8; const lineLength = size / 2 - 8;
const radians = ((value - 90) * Math.PI) / 180; const radians = ((value - 90) * Math.PI) / 180;
const lineX = Math.cos(radians) * lineLength; const lineX = Math.cos(radians) * lineLength;
const lineY = Math.sin(radians) * lineLength; const lineY = Math.sin(radians) * lineLength;
@@ -160,7 +160,7 @@ export function AngleSelector({
{/* Cardinal direction markers */} {/* Cardinal direction markers */}
{[0, 90, 180, 270].map((deg) => { {[0, 90, 180, 270].map((deg) => {
const markerRadians = ((deg - 90) * Math.PI) / 180; const markerRadians = ((deg - 90) * Math.PI) / 180;
const markerDist = (size / 2) - 3; const markerDist = size / 2 - 3;
const markerX = Math.cos(markerRadians) * markerDist; const markerX = Math.cos(markerRadians) * markerDist;
const markerY = Math.sin(markerRadians) * markerDist; const markerY = Math.sin(markerRadians) * markerDist;
return ( return (
+42 -5
View File
@@ -1,16 +1,53 @@
import React from 'react'; import React, { useMemo } from 'react';
import { Outlet, useLocation } from 'react-router-dom'; import { Outlet, useLocation } from 'react-router-dom';
const decodeSegment = (segment: string): string => {
let decoded = segment;
try {
let next = decodeURIComponent(decoded);
while (next !== decoded) {
decoded = next;
next = decodeURIComponent(decoded);
}
} catch {
// keep partially decoded value
}
return decoded;
};
/** /**
* Wrapper for Outlet that adds route-based animation * Room routes are `:roomIdOrAlias/:eventId?/`. Jumping to an event (or clearing it)
* Forces remount on route change by using location as key * changes the pathname but not the room — keep the outlet mounted so we don't replay
* the route enter animation or remount drawers like Shared Media.
*
* Path segments are decoded so `!room:server` and `%21room%3Aserver` share a key.
*/
const getOutletTransitionKey = (pathname: string): string => {
const segments = pathname.split('/').filter(Boolean).map(decodeSegment);
if (segments.length === 0) return pathname;
// Matrix event IDs start with `$`
if (segments[segments.length - 1].startsWith('$')) {
segments.pop();
}
return `/${segments.join('/')}/`;
};
/**
* Wrapper for Outlet that adds route-based animation.
* Remounts (and animates) when leaving a room / switching rooms, not on same-room event hops.
*/ */
export function AnimatedOutlet() { export function AnimatedOutlet() {
const location = useLocation(); const location = useLocation();
const transitionKey = useMemo(
() => getOutletTransitionKey(location.pathname),
[location.pathname],
);
return ( return (
<div <div
key={location.pathname} key={transitionKey}
data-route-transition="true" data-route-transition="true"
style={{ style={{
flex: 1, flex: 1,
+1 -1
View File
@@ -45,7 +45,7 @@ export function AuthFlowsLoader({ fallback, error, children }: AuthFlowsLoaderPr
}; };
return authFlows; return authFlows;
}, [mx]) }, [mx]),
); );
useEffect(() => { useEffect(() => {
+3 -78
View File
@@ -1,86 +1,11 @@
import { ReactNode, useCallback } from 'react'; import { ReactNode } from 'react';
import { matchPath, useLocation, useNavigate } from 'react-router-dom'; import { useBackRoute } from '../hooks/useBackRoute';
import {
getDirectPath,
getExplorePath,
getHomePath,
getInboxPath,
getSpacePath,
} from '../pages/pathUtils';
import { DIRECT_PATH, EXPLORE_PATH, HOME_PATH, INBOX_PATH, SPACE_PATH } from '../pages/paths';
type BackRouteHandlerProps = { type BackRouteHandlerProps = {
children: (onBack: () => void) => ReactNode; children: (onBack: () => void) => ReactNode;
}; };
export function BackRouteHandler({ children }: BackRouteHandlerProps) { export function BackRouteHandler({ children }: BackRouteHandlerProps) {
const navigate = useNavigate(); const { goBack } = useBackRoute();
const location = useLocation();
const goBack = useCallback(() => {
if (
matchPath(
{
path: HOME_PATH,
caseSensitive: true,
end: false,
},
location.pathname
)
) {
navigate(getHomePath());
return;
}
if (
matchPath(
{
path: DIRECT_PATH,
caseSensitive: true,
end: false,
},
location.pathname
)
) {
navigate(getDirectPath());
return;
}
const spaceMatch = matchPath(
{
path: SPACE_PATH,
caseSensitive: true,
end: false,
},
location.pathname
);
if (spaceMatch?.params.spaceIdOrAlias) {
navigate(getSpacePath(spaceMatch.params.spaceIdOrAlias));
return;
}
if (
matchPath(
{
path: EXPLORE_PATH,
caseSensitive: true,
end: false,
},
location.pathname
)
) {
navigate(getExplorePath());
return;
}
if (
matchPath(
{
path: INBOX_PATH,
caseSensitive: true,
end: false,
},
location.pathname
)
) {
navigate(getInboxPath());
}
}, [navigate, location]);
return children(goBack); return children(goBack);
} }
+2 -3
View File
@@ -7,9 +7,7 @@ import {
Button, Button,
color, color,
config, config,
Icon,
IconButton, IconButton,
Icons,
Menu, Menu,
percent, percent,
PopOut, PopOut,
@@ -19,6 +17,7 @@ import {
Text, Text,
} from 'folds'; } from 'folds';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import { Icon, Icons } from './icons';
import { BackupProgressStatus, backupRestoreProgressAtom } from '../state/backupRestore'; import { BackupProgressStatus, backupRestoreProgressAtom } from '../state/backupRestore';
import { InfoCard } from './info-card'; import { InfoCard } from './info-card';
import { AsyncStatus, useAsyncCallback } from '../hooks/useAsyncCallback'; import { AsyncStatus, useAsyncCallback } from '../hooks/useAsyncCallback';
@@ -157,7 +156,7 @@ export function BackupRestoreTile({ crypto }: BackupRestoreTileProps) {
setRestoreProgress(progress); setRestoreProgress(progress);
}, },
}); });
}, [crypto, setRestoreProgress]) }, [crypto, setRestoreProgress]),
); );
const handleRestore = () => { const handleRestore = () => {
+3 -3
View File
@@ -6,8 +6,8 @@ type ConfirmPasswordMatchProps = {
children: ( children: (
match: boolean, match: boolean,
doMatch: () => void, doMatch: () => void,
passRef: RefObject<HTMLInputElement>, passRef: RefObject<HTMLInputElement | null>,
confPassRef: RefObject<HTMLInputElement> confPassRef: RefObject<HTMLInputElement | null>,
) => ReactNode; ) => ReactNode;
}; };
export function ConfirmPasswordMatch({ initialValue, children }: ConfirmPasswordMatchProps) { export function ConfirmPasswordMatch({ initialValue, children }: ConfirmPasswordMatchProps) {
@@ -28,7 +28,7 @@ export function ConfirmPasswordMatch({ initialValue, children }: ConfirmPassword
{ {
wait: 500, wait: 500,
immediate: false, immediate: false,
} },
); );
return children(match, doMatch, passRef, confPassRef); return children(match, doMatch, passRef, confPassRef);
+1 -3
View File
@@ -12,9 +12,7 @@ import {
config, config,
Dialog, Dialog,
Header, Header,
Icon,
IconButton, IconButton,
Icons,
Overlay, Overlay,
OverlayBackdrop, OverlayBackdrop,
OverlayCenter, OverlayCenter,
@@ -22,6 +20,7 @@ import {
Text, Text,
} from 'folds'; } from 'folds';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import { Icon, Icons } from './icons';
import { import {
useVerificationRequestPhase, useVerificationRequestPhase,
useVerificationRequestReceived, useVerificationRequestReceived,
@@ -137,7 +136,6 @@ function CompareEmoji({ sasData }: { sasData: ShowSasCallbacks }) {
> >
{sasData.sas.emoji?.map(([emoji, name], index) => ( {sasData.sas.emoji?.map(([emoji, name], index) => (
<Box <Box
// eslint-disable-next-line react/no-array-index-key
key={`${emoji}${name}${index}`} key={`${emoji}${name}${index}`}
direction="Column" direction="Column"
gap="100" gap="100"
+11 -23
View File
@@ -1,21 +1,9 @@
import React, { FormEventHandler, forwardRef, useCallback, useState } from 'react'; import React, { FormEventHandler, forwardRef, useCallback, useState } from 'react';
import { import { Dialog, Header, Box, Text, IconButton, config, Button, Chip, color, Spinner } from 'folds';
Dialog,
Header,
Box,
Text,
IconButton,
Icon,
Icons,
config,
Button,
Chip,
color,
Spinner,
} from 'folds';
import FileSaver from 'file-saver'; import FileSaver from 'file-saver';
import to from 'await-to-js'; import to from 'await-to-js';
import { AuthDict, IAuthData, MatrixError, UIAuthCallback } from 'matrix-js-sdk'; import { AuthDict, IAuthData, MatrixError, UIAuthCallback } from 'matrix-js-sdk';
import { Icon, Icons } from './icons';
import { PasswordInput } from './password-input'; import { PasswordInput } from './password-input';
import { ContainerColor } from '../styles/ContainerColor.css'; import { ContainerColor } from '../styles/ContainerColor.css';
import { copyToClipboard } from '../utils/dom'; import { copyToClipboard } from '../utils/dom';
@@ -27,7 +15,7 @@ import { useAlive } from '../hooks/useAlive';
import { UseStateProvider } from './UseStateProvider'; import { UseStateProvider } from './UseStateProvider';
type UIACallback<T> = ( type UIACallback<T> = (
authDict: AuthDict | null authDict: AuthDict | null,
) => Promise<[IAuthData, undefined] | [undefined, T]>; ) => Promise<[IAuthData, undefined] | [undefined, T]>;
type PerformAction<T> = (authDict: AuthDict | null) => Promise<T>; type PerformAction<T> = (authDict: AuthDict | null) => Promise<T>;
@@ -42,7 +30,7 @@ function makeUIAAction<T>(
authData: IAuthData, authData: IAuthData,
performAction: PerformAction<T>, performAction: PerformAction<T>,
resolve: (data: T) => void, resolve: (data: T) => void,
reject: (error?: any) => void reject: (error?: unknown) => void,
): UIAAction<T> { ): UIAAction<T> {
const action: UIAAction<T> = { const action: UIAAction<T> = {
authData, authData,
@@ -91,7 +79,7 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
setNextAuthData(authData); setNextAuthData(authData);
} }
}, },
[uiaAction, alive] [uiaAction, alive],
); );
const resetUIA = useCallback(() => { const resetUIA = useCallback(() => {
@@ -118,7 +106,7 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
(err) => { (err) => {
resetUIA(); resetUIA();
reject(err); reject(err);
} },
); );
if (alive()) { if (alive()) {
setUIAAction(action); setUIAAction(action);
@@ -130,7 +118,7 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
reject(error); reject(error);
}); });
}), }),
[alive, resetUIA] [alive, resetUIA],
); );
const [setupState, setup] = useAsyncCallback<void, Error, [string | undefined]>( const [setupState, setup] = useAsyncCallback<void, Error, [string | undefined]>(
@@ -159,8 +147,8 @@ function SetupVerification({ onComplete }: SetupVerificationProps) {
onComplete(recoveryKeyData.encodedPrivateKey); onComplete(recoveryKeyData.encodedPrivateKey);
}, },
[mx, onComplete, authUploadDeviceSigningKeys] [mx, onComplete, authUploadDeviceSigningKeys],
) ),
); );
const loading = setupState.status === AsyncStatus.Loading; const loading = setupState.status === AsyncStatus.Loading;
@@ -314,7 +302,7 @@ export const DeviceVerificationSetup = forwardRef<HTMLDivElement, DeviceVerifica
</Box> </Box>
</Dialog> </Dialog>
); );
} },
); );
type DeviceVerificationResetProps = { type DeviceVerificationResetProps = {
onCancel: () => void; onCancel: () => void;
@@ -371,5 +359,5 @@ export const DeviceVerificationReset = forwardRef<HTMLDivElement, DeviceVerifica
)} )}
</Dialog> </Dialog>
); );
} },
); );
+49
View File
@@ -0,0 +1,49 @@
import FocusTrap from 'focus-trap-react';
import { useAtom } from 'jotai';
import { Box, Button, Dialog, Overlay, OverlayBackdrop, OverlayCenter, config, Text } from 'folds';
import { dialogAtom } from '../state/dialog';
import { stopPropagation } from '../utils/keyboard';
export function DialogHost() {
const [dialog, setDialog] = useAtom(dialogAtom);
if (!dialog) return null;
const close = (answer: boolean) => {
setDialog(null);
dialog.resolve(answer);
};
return (
<Overlay open backdrop={<OverlayBackdrop />}>
<OverlayCenter>
<FocusTrap
focusTrapOptions={{
initialFocus: false,
onDeactivate: () => close(false),
clickOutsideDeactivates: true,
escapeDeactivates: stopPropagation,
}}
>
<Dialog variant="Surface">
<Box style={{ padding: config.space.S400 }} direction="Column" gap="400">
<Text priority="400" style={{ whiteSpace: 'pre-line' }}>
{dialog.message}
</Text>
<Box direction="Row" gap="200">
{dialog.confirm && (
<Button variant="Secondary" onClick={() => close(false)} radii="300">
<Text size="B300">Cancel</Text>
</Button>
)}
<Button variant="Primary" onClick={() => close(dialog.confirm)} radii="300">
<Text size="B300">{dialog.confirm ? 'Confirm' : 'OK'}</Text>
</Button>
</Box>
</Box>
</Dialog>
</FocusTrap>
</OverlayCenter>
</Overlay>
);
}
+6 -18
View File
@@ -1,20 +1,8 @@
import React, { MouseEventHandler, useCallback, useMemo, useState } from 'react'; import React, { MouseEventHandler, useCallback, useMemo, useState } from 'react';
import { import { config, Box, MenuItem, Text, RectCords, PopOut, Menu, Button, Spinner } from 'folds';
config,
Box,
MenuItem,
Text,
Icon,
Icons,
IconSrc,
RectCords,
PopOut,
Menu,
Button,
Spinner,
} from 'folds';
import { JoinRule } from 'matrix-js-sdk'; import { JoinRule } from 'matrix-js-sdk';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import { Icon, Icons, IconSrc } from './icons';
import { stopPropagation } from '../utils/keyboard'; import { stopPropagation } from '../utils/keyboard';
export type ExtraJoinRules = 'knock_restricted'; export type ExtraJoinRules = 'knock_restricted';
@@ -31,7 +19,7 @@ export const useRoomJoinRuleIcon = (): JoinRuleIcons =>
[JoinRule.Public]: Icons.HashGlobe, [JoinRule.Public]: Icons.HashGlobe,
[JoinRule.Private]: Icons.HashLock, [JoinRule.Private]: Icons.HashLock,
}), }),
[] [],
); );
export const useSpaceJoinRuleIcon = (): JoinRuleIcons => export const useSpaceJoinRuleIcon = (): JoinRuleIcons =>
useMemo( useMemo(
@@ -43,7 +31,7 @@ export const useSpaceJoinRuleIcon = (): JoinRuleIcons =>
[JoinRule.Public]: Icons.SpaceGlobe, [JoinRule.Public]: Icons.SpaceGlobe,
[JoinRule.Private]: Icons.SpaceLock, [JoinRule.Private]: Icons.SpaceLock,
}), }),
[] [],
); );
type JoinRuleLabels = Record<ExtendedJoinRules, string>; type JoinRuleLabels = Record<ExtendedJoinRules, string>;
@@ -57,7 +45,7 @@ export const useRoomJoinRuleLabel = (): JoinRuleLabels =>
[JoinRule.Public]: 'Public', [JoinRule.Public]: 'Public',
[JoinRule.Private]: 'Invite Only', [JoinRule.Private]: 'Invite Only',
}), }),
[] [],
); );
type JoinRulesSwitcherProps<T extends ExtendedJoinRules[]> = { type JoinRulesSwitcherProps<T extends ExtendedJoinRules[]> = {
@@ -89,7 +77,7 @@ export function JoinRulesSwitcher<T extends ExtendedJoinRules[]>({
setCords(undefined); setCords(undefined);
onChange(selectedRule); onChange(selectedRule);
}, },
[onChange] [onChange],
); );
return ( return (
+3 -3
View File
@@ -21,13 +21,13 @@ export const LogoutDialog = forwardRef<HTMLDivElement, LogoutDialogProps>(
const verificationStatus = useDeviceVerificationStatus( const verificationStatus = useDeviceVerificationStatus(
mx.getCrypto(), mx.getCrypto(),
mx.getSafeUserId(), mx.getSafeUserId(),
mx.getDeviceId() ?? undefined mx.getDeviceId() ?? undefined,
); );
const [logoutState, logout] = useAsyncCallback<void, Error, []>( const [logoutState, logout] = useAsyncCallback<void, Error, []>(
useCallback(async () => { useCallback(async () => {
await logoutClient(mx); await logoutClient(mx);
}, [mx]) }, [mx]),
); );
const ongoingLogout = logoutState.status === AsyncStatus.Loading; const ongoingLogout = logoutState.status === AsyncStatus.Loading;
@@ -85,5 +85,5 @@ export const LogoutDialog = forwardRef<HTMLDivElement, LogoutDialogProps>(
</Box> </Box>
</Dialog> </Dialog>
); );
} },
); );
+5 -16
View File
@@ -1,18 +1,7 @@
import React, { MouseEventHandler, ReactNode, useCallback, useState } from 'react'; import React, { MouseEventHandler, ReactNode, useCallback, useState } from 'react';
import { import { Box, Text, Chip, RectCords, PopOut, Menu, config, MenuItem, color } from 'folds';
Box,
Text,
Chip,
Icon,
Icons,
RectCords,
PopOut,
Menu,
config,
MenuItem,
color,
} from 'folds';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import { Icon, Icons } from './icons';
import { stopPropagation } from '../utils/keyboard'; import { stopPropagation } from '../utils/keyboard';
import { SettingTile } from './setting-tile'; import { SettingTile } from './setting-tile';
import { SecretStorageKeyContent } from '../../types/matrix/accountData'; import { SecretStorageKeyContent } from '../../types/matrix/accountData';
@@ -126,7 +115,7 @@ export function ManualVerificationTile({
const [method, setMethod] = useState( const [method, setMethod] = useState(
hasPassphrase hasPassphrase
? ManualVerificationMethod.RecoveryPassphrase ? ManualVerificationMethod.RecoveryPassphrase
: ManualVerificationMethod.RecoveryKey : ManualVerificationMethod.RecoveryKey,
); );
const verifyAndRestoreBackup = useCallback( const verifyAndRestoreBackup = useCallback(
@@ -143,11 +132,11 @@ export function ManualVerificationTile({
await crypto.loadSessionBackupPrivateKeyFromSecretStorage(); await crypto.loadSessionBackupPrivateKeyFromSecretStorage();
}, },
[mx, secretStorageKeyId] [mx, secretStorageKeyId],
); );
const [verifyState, handleDecodedRecoveryKey] = useAsyncCallback<void, Error, [Uint8Array]>( const [verifyState, handleDecodedRecoveryKey] = useAsyncCallback<void, Error, [Uint8Array]>(
verifyAndRestoreBackup verifyAndRestoreBackup,
); );
const verifying = verifyState.status === AsyncStatus.Loading; const verifying = verifyState.status === AsyncStatus.Loading;
+4
View File
@@ -1,7 +1,9 @@
import React, { ReactNode, useCallback, useState } from 'react'; import React, { ReactNode, useCallback, useState } from 'react';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import { useAtomValue } from 'jotai';
import { Modal, Overlay, OverlayBackdrop, OverlayCenter, PopOutContainerProvider } from 'folds'; import { Modal, Overlay, OverlayBackdrop, OverlayCenter, PopOutContainerProvider } from 'folds';
import { stopPropagation } from '../utils/keyboard'; import { stopPropagation } from '../utils/keyboard';
import { releaseNotesDialogAtom } from '../state/releaseNotes';
type Modal500Props = { type Modal500Props = {
requestClose: () => void; requestClose: () => void;
@@ -10,11 +12,13 @@ type Modal500Props = {
export function Modal500({ requestClose, children }: Modal500Props) { export function Modal500({ requestClose, children }: Modal500Props) {
const [modalEl, setModalEl] = useState<HTMLDivElement | null>(null); const [modalEl, setModalEl] = useState<HTMLDivElement | null>(null);
const modalRef = useCallback((el: HTMLDivElement | null) => setModalEl(el), []); const modalRef = useCallback((el: HTMLDivElement | null) => setModalEl(el), []);
const releaseNotesOpen = useAtomValue(releaseNotesDialogAtom).open;
return ( return (
<Overlay open backdrop={<OverlayBackdrop />}> <Overlay open backdrop={<OverlayBackdrop />}>
<OverlayCenter> <OverlayCenter>
<FocusTrap <FocusTrap
active={!releaseNotesOpen}
focusTrapOptions={{ focusTrapOptions={{
initialFocus: false, initialFocus: false,
clickOutsideDeactivates: true, clickOutsideDeactivates: true,
+12 -9
View File
@@ -1,5 +1,3 @@
/* eslint-disable no-param-reassign */
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
import React, { FormEventHandler, MouseEventHandler, useEffect, useRef, useState } from 'react'; import React, { FormEventHandler, MouseEventHandler, useEffect, useRef, useState } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { import {
@@ -7,9 +5,7 @@ import {
Button, Button,
Chip, Chip,
Header, Header,
Icon,
IconButton, IconButton,
Icons,
Input, Input,
Menu, Menu,
PopOut, PopOut,
@@ -21,7 +17,8 @@ import {
config, config,
} from 'folds'; } from 'folds';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import FileSaver from 'file-saver'; import { Icon, Icons } from '../icons';
import { saveMediaBlob } from '../../utils/saveMedia';
import * as css from './PdfViewer.css'; import * as css from './PdfViewer.css';
import { AsyncStatus } from '../../hooks/useAsyncCallback'; import { AsyncStatus } from '../../hooks/useAsyncCallback';
import { useZoom } from '../../hooks/useZoom'; import { useZoom } from '../../hooks/useZoom';
@@ -43,7 +40,7 @@ export const PdfViewer = as<'div', PdfViewerProps>(
const [pdfJSState, loadPdfJS] = usePdfJSLoader(); const [pdfJSState, loadPdfJS] = usePdfJSLoader();
const [docState, loadPdfDocument] = usePdfDocumentLoader( const [docState, loadPdfDocument] = usePdfDocumentLoader(
pdfJSState.status === AsyncStatus.Success ? pdfJSState.data : undefined, pdfJSState.status === AsyncStatus.Success ? pdfJSState.data : undefined,
src src,
); );
const isLoading = const isLoading =
pdfJSState.status === AsyncStatus.Loading || docState.status === AsyncStatus.Loading; pdfJSState.status === AsyncStatus.Loading || docState.status === AsyncStatus.Loading;
@@ -77,8 +74,14 @@ export const PdfViewer = as<'div', PdfViewerProps>(
} }
}, [docState, pageNo, zoom]); }, [docState, pageNo, zoom]);
const handleDownload = () => { const handleDownload = async () => {
FileSaver.saveAs(src, name); try {
const res = await fetch(src);
if (!res.ok) throw new Error('Failed to fetch PDF');
await saveMediaBlob(await res.blob(), name);
} catch (error) {
console.warn('[PdfViewer] Failed to download:', error);
}
}; };
const handleJumpSubmit: FormEventHandler<HTMLFormElement> = (evt) => { const handleJumpSubmit: FormEventHandler<HTMLFormElement> = (evt) => {
@@ -257,5 +260,5 @@ export const PdfViewer = as<'div', PdfViewerProps>(
)} )}
</Box> </Box>
); );
} },
); );
+55 -36
View File
@@ -1,4 +1,4 @@
import React from 'react'; import React, { KeyboardEvent, MouseEvent } from 'react';
import { MsgType } from 'matrix-js-sdk'; import { MsgType } from 'matrix-js-sdk';
import { HTMLReactParserOptions } from 'html-react-parser'; import { HTMLReactParserOptions } from 'html-react-parser';
import { Opts } from 'linkifyjs'; import { Opts } from 'linkifyjs';
@@ -25,7 +25,14 @@ import {
VideoContent, VideoContent,
VideoFrameThumbnail, VideoFrameThumbnail,
} from './message'; } from './message';
import { UrlPreviewCard, UrlPreviewHolder, YouTubeEmbed, isYouTubeUrl, TikTokEmbed, isTikTokUrl, GiphyEmbed, isGiphyUrl } from './url-preview'; import {
UrlPreviewCard,
UrlPreviewHolder,
YouTubeEmbed,
isYouTubeUrl,
GiphyEmbed,
isGiphyUrl,
} from './url-preview';
import { Image, MediaControl, Video } from './media'; import { Image, MediaControl, Video } from './media';
import { ImageViewer } from './image-viewer'; import { ImageViewer } from './image-viewer';
import { VideoViewer } from './video-viewer'; import { VideoViewer } from './video-viewer';
@@ -49,6 +56,12 @@ type RenderMessageContentProps = {
linkifyOpts: Opts; linkifyOpts: Opts;
outlineAttachment?: boolean; outlineAttachment?: boolean;
disabledEmbedPatterns?: string[]; disabledEmbedPatterns?: string[];
targetEventId?: string;
onJumboEmojiClick?: (
targetEventId: string,
body: string,
event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>,
) => void;
}; };
export function RenderMessageContent({ export function RenderMessageContent({
displayName, displayName,
@@ -63,6 +76,8 @@ export function RenderMessageContent({
linkifyOpts, linkifyOpts,
outlineAttachment, outlineAttachment,
disabledEmbedPatterns, disabledEmbedPatterns,
targetEventId,
onJumboEmojiClick,
}: RenderMessageContentProps) { }: RenderMessageContentProps) {
const renderUrlsPreview = (urls: string[]) => { const renderUrlsPreview = (urls: string[]) => {
let filteredUrls = urls.filter((url) => !testMatrixTo(url)); let filteredUrls = urls.filter((url) => !testMatrixTo(url));
@@ -71,9 +86,8 @@ export function RenderMessageContent({
// Separate special URLs from generic ones // Separate special URLs from generic ones
const youtubeUrls = filteredUrls.filter(isYouTubeUrl); const youtubeUrls = filteredUrls.filter(isYouTubeUrl);
const tiktokUrls = filteredUrls.filter(isTikTokUrl);
const giphyUrls = filteredUrls.filter(isGiphyUrl); const giphyUrls = filteredUrls.filter(isGiphyUrl);
const otherUrls = filteredUrls.filter((url) => !isYouTubeUrl(url) && !isTikTokUrl(url) && !isGiphyUrl(url)); const otherUrls = filteredUrls.filter((url) => !isYouTubeUrl(url) && !isGiphyUrl(url));
return ( return (
<> <>
@@ -81,10 +95,6 @@ export function RenderMessageContent({
{youtubeUrls.map((url) => ( {youtubeUrls.map((url) => (
<YouTubeEmbed key={url} url={url} /> <YouTubeEmbed key={url} url={url} />
))} ))}
{/* Render TikTok embeds */}
{tiktokUrls.map((url) => (
<TikTokEmbed key={url} url={url} />
))}
{/* Render Giphy embeds */} {/* Render Giphy embeds */}
{giphyUrls.map((url) => ( {giphyUrls.map((url) => (
<GiphyEmbed key={url} url={url} /> <GiphyEmbed key={url} url={url} />
@@ -100,6 +110,11 @@ export function RenderMessageContent({
</> </>
); );
}; };
const handleJumboEmojiClick =
targetEventId && onJumboEmojiClick
? (body: string, event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) =>
onJumboEmojiClick(targetEventId, body, event)
: undefined;
const renderCaption = () => { const renderCaption = () => {
const content: IImageContent = getContent(); const content: IImageContent = getContent();
if (content.filename && content.filename !== content.body) { if (content.filename && content.filename !== content.body) {
@@ -164,9 +179,10 @@ export function RenderMessageContent({
const customRendererEarly = pluginRegistry.getRenderer('message'); const customRendererEarly = pluginRegistry.getRenderer('message');
if (customRendererEarly) { if (customRendererEarly) {
try { try {
const contentEarly = getContent();
const messageDataEarly = { const messageDataEarly = {
msgtype: msgType, msgtype: msgType,
...getContent(), ...(typeof contentEarly === 'object' && contentEarly !== null ? contentEarly : {}),
}; };
const customContentEarly = customRendererEarly(messageDataEarly, () => null); const customContentEarly = customRendererEarly(messageDataEarly, () => null);
if (customContentEarly) { if (customContentEarly) {
@@ -182,6 +198,7 @@ export function RenderMessageContent({
<MText <MText
edited={edited} edited={edited}
content={getContent()} content={getContent()}
onJumboEmojiClick={handleJumboEmojiClick}
renderBody={(props) => ( renderBody={(props) => (
<RenderBody <RenderBody
{...props} {...props}
@@ -201,6 +218,7 @@ export function RenderMessageContent({
displayName={displayName} displayName={displayName}
edited={edited} edited={edited}
content={getContent()} content={getContent()}
onJumboEmojiClick={handleJumboEmojiClick}
renderBody={(props) => ( renderBody={(props) => (
<RenderBody <RenderBody
{...props} {...props}
@@ -219,6 +237,7 @@ export function RenderMessageContent({
<MNotice <MNotice
edited={edited} edited={edited}
content={getContent()} content={getContent()}
onJumboEmojiClick={handleJumboEmojiClick}
renderBody={(props) => ( renderBody={(props) => (
<RenderBody <RenderBody
{...props} {...props}
@@ -259,8 +278,9 @@ export function RenderMessageContent({
content={getContent()} content={getContent()}
renderAsFile={renderFile} renderAsFile={renderFile}
renderVideoContent={({ body, info, mimeType, url, encInfo, ...props }) => { renderVideoContent={({ body, info, mimeType, url, encInfo, ...props }) => {
const hasValidThumbnail = const hasValidThumbnail =
(typeof info.thumbnail_file?.url === 'string' || typeof info.thumbnail_url === 'string') && (typeof info.thumbnail_file?.url === 'string' ||
typeof info.thumbnail_url === 'string') &&
typeof info.thumbnail_info?.mimetype === 'string'; typeof info.thumbnail_info?.mimetype === 'string';
return ( return (
@@ -274,23 +294,24 @@ export function RenderMessageContent({
{...props} {...props}
renderThumbnail={ renderThumbnail={
mediaAutoLoad mediaAutoLoad
? () => hasValidThumbnail ? ( ? () =>
<ThumbnailContent hasValidThumbnail ? (
info={info} <ThumbnailContent
renderImage={(src) => ( info={info}
<Image alt={body} title={body} src={src} loading="lazy" /> renderImage={(src) => (
)} <Image alt={body} title={body} src={src} loading="lazy" />
/> )}
) : ( />
<VideoFrameThumbnail ) : (
mimeType={mimeType} <VideoFrameThumbnail
url={url} mimeType={mimeType}
encInfo={encInfo} url={url}
renderImage={(src) => ( encInfo={encInfo}
<Image alt={body} title={body} src={src} loading="lazy" /> renderImage={(src) => (
)} <Image alt={body} title={body} src={src} loading="lazy" />
/> )}
) />
)
: undefined : undefined
} }
renderViewer={(p) => <VideoViewer {...p} />} renderViewer={(p) => <VideoViewer {...p} />}
@@ -338,19 +359,17 @@ export function RenderMessageContent({
console.log('[RenderMessageContent] customRenderer function:', typeof customRenderer); console.log('[RenderMessageContent] customRenderer function:', typeof customRenderer);
if (customRenderer) { if (customRenderer) {
try { try {
const content = getContent();
const messageData = { const messageData = {
msgtype: msgType, msgtype: msgType,
...getContent(), ...(typeof content === 'object' && content !== null ? content : {}),
}; };
console.log('[RenderMessageContent] Calling customRenderer with msgtype:', msgType); console.log('[RenderMessageContent] Calling customRenderer with msgtype:', msgType);
console.log('[RenderMessageContent] messageData:', messageData); console.log('[RenderMessageContent] messageData:', messageData);
const customContent = customRenderer( const customContent = customRenderer(messageData, () => {
messageData, console.log('[RenderMessageContent] defaultRenderer called');
() => { return null;
console.log('[RenderMessageContent] defaultRenderer called'); });
return null;
}
);
console.log('[RenderMessageContent] customRenderer returned:', customContent); console.log('[RenderMessageContent] customRenderer returned:', customContent);
console.log('[RenderMessageContent] customContent type:', typeof customContent); console.log('[RenderMessageContent] customContent type:', typeof customContent);
if (customContent) { if (customContent) {
@@ -1,6 +1,7 @@
import { Box, config, Icon, Menu, MenuItem, PopOut, RectCords, Text } from 'folds'; import { Box, config, Menu, MenuItem, PopOut, RectCords, Text } from 'folds';
import React, { MouseEventHandler, ReactNode, useMemo, useState } from 'react'; import React, { MouseEventHandler, ReactNode, useMemo, useState } from 'react';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import { Icon } from './icons';
import { stopPropagation } from '../utils/keyboard'; import { stopPropagation } from '../utils/keyboard';
import { import {
getRoomNotificationModeIcon, getRoomNotificationModeIcon,
@@ -17,7 +18,7 @@ const useRoomNotificationModes = (): RoomNotificationMode[] =>
RoomNotificationMode.SpecialMessages, RoomNotificationMode.SpecialMessages,
RoomNotificationMode.Mute, RoomNotificationMode.Mute,
], ],
[] [],
); );
const useRoomNotificationModeStr = (): Record<RoomNotificationMode, string> => const useRoomNotificationModeStr = (): Record<RoomNotificationMode, string> =>
@@ -28,7 +29,7 @@ const useRoomNotificationModeStr = (): Record<RoomNotificationMode, string> =>
[RoomNotificationMode.SpecialMessages]: 'Mention & Keywords', [RoomNotificationMode.SpecialMessages]: 'Mention & Keywords',
[RoomNotificationMode.Mute]: 'Mute', [RoomNotificationMode.Mute]: 'Mute',
}), }),
[] [],
); );
type NotificationModeSwitcherProps = { type NotificationModeSwitcherProps = {
@@ -37,7 +38,7 @@ type NotificationModeSwitcherProps = {
children: ( children: (
handleOpen: MouseEventHandler<HTMLButtonElement>, handleOpen: MouseEventHandler<HTMLButtonElement>,
opened: boolean, opened: boolean,
changing: boolean changing: boolean,
) => ReactNode; ) => ReactNode;
}; };
export function RoomNotificationModeSwitcher({ export function RoomNotificationModeSwitcher({
+34 -35
View File
@@ -1,49 +1,47 @@
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { useLocation } from 'react-router-dom'; import { useLocation } from 'react-router-dom';
import { css } from '@vanilla-extract/css'; import { keyframes, style } from '@vanilla-extract/css';
const transitionContainer = css({ const transitionContainer = style({
position: 'relative', position: 'relative',
width: '100%', width: '100%',
height: '100%', height: '100%',
overflow: 'hidden', overflow: 'hidden',
}); });
const transitionContent = css({ const transitionContent = style({
width: '100%', width: '100%',
height: '100%', height: '100%',
}); });
const animateIn = css({ const routeFadeSlideIn = keyframes({
animation: 'routeFadeSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1)', from: {
'@keyframes': { opacity: 0,
routeFadeSlideIn: { transform: 'translateX(12px)',
from: { },
opacity: 0, to: {
transform: 'translateX(12px)', opacity: 1,
}, transform: 'translateX(0)',
to: {
opacity: 1,
transform: 'translateX(0)',
},
},
}, },
}); });
const animateOut = css({ const animateIn = style({
animation: 'routeFadeSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards', animation: `${routeFadeSlideIn} 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,
'@keyframes': { });
routeFadeSlideOut: {
from: { const routeFadeSlideOut = keyframes({
opacity: 1, from: {
transform: 'translateX(0)', opacity: 1,
}, transform: 'translateX(0)',
to: {
opacity: 0,
transform: 'translateX(-12px)',
},
},
}, },
to: {
opacity: 0,
transform: 'translateX(-12px)',
},
});
const animateOut = style({
animation: `${routeFadeSlideOut} 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards`,
}); });
interface RouteTransitionProps { interface RouteTransitionProps {
@@ -57,7 +55,7 @@ export function RouteTransition({ children }: RouteTransitionProps) {
const location = useLocation(); const location = useLocation();
const [displayLocation, setDisplayLocation] = useState(location); const [displayLocation, setDisplayLocation] = useState(location);
const [transitionStage, setTransitionStage] = useState<'entering' | 'exiting' | 'idle'>('idle'); const [transitionStage, setTransitionStage] = useState<'entering' | 'exiting' | 'idle'>('idle');
const timeoutRef = useRef<ReturnType<typeof setTimeout>>(); const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);
useEffect(() => { useEffect(() => {
if (location.pathname !== displayLocation.pathname) { if (location.pathname !== displayLocation.pathname) {
@@ -88,11 +86,12 @@ export function RouteTransition({ children }: RouteTransitionProps) {
}; };
}, [location, displayLocation]); }, [location, displayLocation]);
const className = transitionStage === 'entering' let className = transitionContent;
? `${transitionContent} ${animateIn}` if (transitionStage === 'entering') {
: transitionStage === 'exiting' className = `${transitionContent} ${animateIn}`;
? `${transitionContent} ${animateOut}` } else if (transitionStage === 'exiting') {
: transitionContent; className = `${transitionContent} ${animateOut}`;
}
return ( return (
<div className={transitionContainer}> <div className={transitionContainer}>
+14 -7
View File
@@ -1,6 +1,7 @@
import React, { FormEventHandler, useCallback } from 'react'; import React, { FormEventHandler, useCallback } from 'react';
import { Box, Text, Button, Spinner, color } from 'folds'; import { Box, Text, Button, Spinner, color } from 'folds';
import { decodeRecoveryKey, deriveRecoveryKeyFromPassphrase } from 'matrix-js-sdk/lib/crypto-api'; import { decodeRecoveryKey, deriveRecoveryKeyFromPassphrase } from 'matrix-js-sdk/lib/crypto-api';
import { SecretStorageKeyDescriptionAesV1 } from 'matrix-js-sdk/lib/secret-storage';
import { PasswordInput } from './password-input'; import { PasswordInput } from './password-input';
import { import {
SecretStorageKeyContent, SecretStorageKeyContent,
@@ -36,10 +37,13 @@ export function SecretStorageRecoveryPassphrase({
passphrase, passphrase,
salt, salt,
iterations, iterations,
bits bits,
); );
const match = await mx.secretStorage.checkKey(decodedRecoveryKey, keyContent as any); const match = await mx.secretStorage.checkKey(
decodedRecoveryKey,
keyContent as SecretStorageKeyDescriptionAesV1,
);
if (!match) { if (!match) {
throw new Error('Invalid recovery passphrase.'); throw new Error('Invalid recovery passphrase.');
@@ -47,8 +51,8 @@ export function SecretStorageRecoveryPassphrase({
return decodedRecoveryKey; return decodedRecoveryKey;
}, },
[mx, keyContent] [mx, keyContent],
) ),
); );
const drivingKey = driveKeyState.status === AsyncStatus.Loading; const drivingKey = driveKeyState.status === AsyncStatus.Loading;
@@ -131,7 +135,10 @@ export function SecretStorageRecoveryKey({
async (recoveryKey) => { async (recoveryKey) => {
const decodedRecoveryKey = decodeRecoveryKey(recoveryKey); const decodedRecoveryKey = decodeRecoveryKey(recoveryKey);
const match = await mx.secretStorage.checkKey(decodedRecoveryKey, keyContent as any); const match = await mx.secretStorage.checkKey(
decodedRecoveryKey,
keyContent as SecretStorageKeyDescriptionAesV1,
);
if (!match) { if (!match) {
throw new Error('Invalid recovery key.'); throw new Error('Invalid recovery key.');
@@ -139,8 +146,8 @@ export function SecretStorageRecoveryKey({
return decodedRecoveryKey; return decodedRecoveryKey;
}, },
[mx, keyContent] [mx, keyContent],
) ),
); );
const drivingKey = driveKeyState.status === AsyncStatus.Loading; const drivingKey = driveKeyState.status === AsyncStatus.Loading;
+2 -2
View File
@@ -34,7 +34,7 @@ export function ServerConfigsLoader({ children }: ServerConfigsLoaderProps) {
if (authMetadata) { if (authMetadata) {
try { try {
validatedAuthMetadata = validateAuthMetadata(authMetadata); validatedAuthMetadata = validateAuthMetadata(authMetadata);
} catch (e) { } catch {
// Server returned auth metadata but it failed validation — ignore silently. // Server returned auth metadata but it failed validation — ignore silently.
} }
} }
@@ -44,7 +44,7 @@ export function ServerConfigsLoader({ children }: ServerConfigsLoaderProps) {
mediaConfig, mediaConfig,
authMetadata: validatedAuthMetadata, authMetadata: validatedAuthMetadata,
}; };
}, [mx]) }, [mx]),
); );
const configs: ServerConfigs = const configs: ServerConfigs =
@@ -21,7 +21,7 @@ export function SpaceChildDirectsProvider({
const childDirects = useSpaceChildren( const childDirects = useSpaceChildren(
allRoomsAtom, allRoomsAtom,
spaceId, spaceId,
useChildDirectScopeFactory(mx, mDirects, roomToParents) useChildDirectScopeFactory(mx, mDirects, roomToParents),
); );
return children(childDirects); return children(childDirects);
@@ -21,7 +21,7 @@ export function SpaceChildRoomsProvider({
const childRooms = useSpaceChildren( const childRooms = useSpaceChildren(
allRoomsAtom, allRoomsAtom,
spaceId, spaceId,
useChildRoomScopeFactory(mx, mDirects, roomToParents) useChildRoomScopeFactory(mx, mDirects, roomToParents),
); );
return children(childRooms); return children(childRooms);
+2 -2
View File
@@ -15,7 +15,7 @@ export function SpecVersionsLoader({
children, children,
}: SpecVersionsLoaderProps) { }: SpecVersionsLoaderProps) {
const [state, load] = useAsyncCallback( const [state, load] = useAsyncCallback(
useCallback(() => specVersions(fetch, baseUrl), [baseUrl]) useCallback(() => specVersions(fetch, baseUrl), [baseUrl]),
); );
const [ignoreError, setIgnoreError] = useState(false); const [ignoreError, setIgnoreError] = useState(false);
@@ -38,6 +38,6 @@ export function SpecVersionsLoader({
? state.data ? state.data
: { : {
versions: [], versions: [],
} },
); );
} }
+1 -2
View File
@@ -7,12 +7,11 @@ import {
Text, Text,
TooltipProvider, TooltipProvider,
Tooltip, Tooltip,
Icons,
Icon,
Chip, Chip,
IconButton, IconButton,
} from 'folds'; } from 'folds';
import FocusTrap from 'focus-trap-react'; import FocusTrap from 'focus-trap-react';
import { Icons, Icon } from './icons';
export type UIAFlowOverlayProps = { export type UIAFlowOverlayProps = {
currentStep: number; currentStep: number;

Some files were not shown because too many files have changed in this diff Show More