Commit Graph
1509 Commits
Author SHA1 Message Date
Jannis Braun e0861597bc fix(web): portal overlays into fullscreenElement so they render in voice fullscreen
requestFullscreen() on the voice container puts only its descendants in the
browser's top layer; overlays portaled to document.body were rendered outside
that layer and stayed invisible — most visibly the right-click context menu on
stream tiles and voice user panels.

Add usePortalContainer() hook returning document.fullscreenElement ?? document.body
and re-rendering on fullscreenchange. Migrate every overlay reachable during a
call: ContextMenuRenderer (desktop, submenu, mobile sheet), Tooltip,
ConfirmDialog, ConnectionInfoPopover, ScreenShareSettingsPopover, and
ScreenSharePicker (which previously rendered inline at App root).
2026-04-29 23:32:14 +02:00
Jannis Braun 1ed70a90b1 fix(dm): render system messages in sidebar preview instead of raw JSON
DmLastMessagePreview lacked a `type` field, so the sidebar rendered
`lastMessage.content` verbatim — surfacing JSON like
`{"event":"space_invite",...}` for space invites and member-add events.

Adds `type` to the preview payload (populated server-side from
`dm_messages.type`) and routes all sidebar call sites through a single
`formatDmSidebarPreview` helper that renders human-readable text for
each system event and skips the group `Sender:` prefix on system rows.
2026-04-29 23:13:09 +02:00
Jannis Braun 9aa97f4552 fix(web): joinByCode normalizes explicit home origin to local
When a caller passes the user's own instance origin (e.g. from an invite
snapshot's spaceInstanceOrigin), strip it to undefined before the remote
branch so the local api path is taken instead of erroneously failing with
NotConnectedError. Mirrors inviteParser's identical normalization.
2026-04-29 22:52:47 +02:00
Jannis Braun 85987a891c fix(web): SpaceInviteCard navigates to /channels/:spaceId (not the non-existent /spaces/:id) 2026-04-29 22:44:35 +02:00
Jannis Braun d8b08d8990 fix(web): SpaceInviteCard navigates to space on already-member instead of showing error 2026-04-29 22:41:49 +02:00
Jannis Braun bc66ddc633 fix(server): canonicalize spaceInstanceOrigin before storing payload
Empty-string (local) origin is now stored as the absolute home origin
so relayed DM space-invite cards carry the correct value to remote
recipients instead of resolving against the wrong instance.
2026-04-29 22:35:34 +02:00
Jannis Braun 44e9a4234c fix(server): local-fast-path for invite snapshot — skip HTTP self-reach
POST /api/dm/space-invite was hanging 5s and returning invite_invalid
for any local-space invite. fetchSpaceInviteSnapshot was being called
against our own public domain from inside the backspace container, which
fails (Docker NAT loopback) and aborts on timeout.

Add getLocalInviteSnapshot — reads the snapshot directly from the DB —
and branch in dm.ts so local invites bypass the HTTP roundtrip entirely.
Cross-instance invites still go through fetchSpaceInviteSnapshot with
its existing SSRF guard.

Also refactor the GET /api/spaces/invite/:code/preview handler to use
the same helper, keeping the snapshot shape in one place.

Tests assert fetchSpaceInviteSnapshot is NOT called for the local case
(critical regression guard) and that the cross-instance path still hits
the HTTP fetch.
2026-04-29 22:29:44 +02:00
Jannis Braun 5481eb9e7e fix(server): SSRF guard on cross-instance invite preview fetch 2026-04-29 22:19:10 +02:00
Jannis Braun 4476c55963 docs: invite friends overhaul — space_invite system message, relay type field, in-instance /join interception 2026-04-29 22:11:56 +02:00
Jannis Braun 65ca54f556 feat(web): useDeepLinkHandler also subscribes to onOpenInternalRoute 2026-04-29 22:09:20 +02:00
Jannis Braun 7d98558816 feat(web): push connected-instance origins to Electron main process 2026-04-29 22:08:30 +02:00
Jannis Braun b00d21df0e feat(desktop): preload exposes setConnectedOrigins + onOpenInternalRoute 2026-04-29 22:07:26 +02:00
Jannis Braun eb57d2fd5c feat(desktop): intercept own-instance /join URLs in setWindowOpenHandler 2026-04-29 22:05:50 +02:00
Jannis Braun a46d35f5f8 feat(web): InviteModal — friend picker + restyled share-link footer, drop deep link 2026-04-29 22:02:23 +02:00
Jannis Braun 1859f2963c feat(web): SystemMessage dispatches space_invite to SpaceInviteCard 2026-04-29 21:55:06 +02:00
Jannis Braun e351d53dd5 fix(web): SpaceInviteCard — real embed idiom and correct getApiForOrigin import path 2026-04-29 21:52:20 +02:00
Jannis Braun 82533c1434 feat(web): SpaceInviteCard component with snapshot/live/revoked render states
Renders space invite system messages in DMs as embed-style cards on the chat
surface. Three render states: snapshot-only on mount (Join enabled, loading
dot), live-confirmed (memberCount refreshed from preview), revoked (gray-out
+ glass-pill indicator). Join targets the space's home origin via
joinByCode(code, spaceInstanceOrigin || undefined) — the three-way
federation correctness rule. Re-exports getApiForOrigin from api/client to
expose the cross-store resolver under a natural import surface.
2026-04-29 21:50:01 +02:00
Jannis Braun 657cc0e1b9 feat(web): add dm.spaceInvite() api client method 2026-04-29 21:44:40 +02:00
Jannis Braun 7303c23b20 test(server): integration tests for POST /api/dm/space-invite 2026-04-29 21:43:25 +02:00
Jannis Braun 5cb0aa9d66 feat(server): POST /api/dm/space-invite endpoint with rate-limited per-friend invite
Adds POST /api/dm/space-invite which fetches a space-invite snapshot
server-to-server from the space's home instance, ensures a 1-on-1 DM
between the caller and a friend, and posts a type='system' message
carrying SpaceInviteSystemPayload. Snapshot is never trusted from the
client. Rate-limited 30/60s per caller. Federation relay queued when the
recipient is on a remote instance (system message type forwarded by
Tasks 1-3).

Adds an `ensureOneOnOneDmChannel` helper that mirrors the dedup-or-create
behavior of the existing POST /api/dm handler — including federatedId
computation and the dm_channel_created notification payload — without
modifying that handler. Duplication is intentional; consolidation is a
separate follow-up.
2026-04-29 21:37:44 +02:00
Jannis Braun 855410f88c feat(shared): add SpaceInviteRequest / SpaceInviteResponse / SpaceInviteSystemPayload 2026-04-29 21:34:07 +02:00
Jannis Braun 889dfe9b4a feat(server): add fetchSpaceInviteSnapshot helper for cross-instance preview fetch 2026-04-29 21:33:19 +02:00
Jannis Braun c4f84f8c68 test(federation): buildRelayPayload type-field forwarding 2026-04-29 21:31:56 +02:00
Jannis Braun a995bd4148 feat(federation): processCreateEvent inserts system-typed messages from relay 2026-04-29 21:30:51 +02:00
Jannis Braun 6c68b4b574 feat(federation): buildRelayPayload forwards system-typed messages 2026-04-29 21:30:01 +02:00
Jannis Braun 04c66c4bcf feat(federation): add optional type field to FederationRelayEvent.message 2026-04-29 21:29:01 +02:00
Jannis Braun 281e01713b Merge feat/registration-invites: registration toggles + invite links
Adds registrationOpen / federatedRegistrationOpen split, full invite-link
CRUD (create, edit, revoke, reinstate, delete, redemptions viewer),
RegisterPage invite UX with URL + manual entry, federation banner in
Connections, and design polish aligning the panel with PEERED INSTANCES
+ ConnectInstanceModal patterns.
2026-04-29 03:07:44 +02:00
Jannis Braun d31a9cf579 refactor(web): RegistrationPanel — glass-bubble modal buttons + clearer Revoke copy 2026-04-29 03:01:47 +02:00
Jannis Braun f0ac847d9e refactor(web): RegistrationPanel sibling parity — Edit/Reinstate redesign + Redemptions header 2026-04-29 02:51:44 +02:00
Jannis Braun a52bab4c16 refactor(web): CreateInviteModal — icon-badge header + uppercase section labels + dominant submit 2026-04-29 02:47:44 +02:00
Jannis Braun 526043a3b4 feat(web): RegistrationPanel sort + status filter via FilterDropdown 2026-04-29 02:44:32 +02:00
Jannis Braun b91bc89c58 refactor(web): RegistrationPanel InviteRow → collapsed/expanded model 2026-04-29 02:40:33 +02:00
Jannis Braun 3fdf501620 refactor(web): RegistrationPanel tab strip restyle + count badges 2026-04-29 02:36:52 +02:00
Jannis Braun 33547038f4 feat(invites): expose lastRedeemedAt on InviteLinkSummary 2026-04-29 02:33:49 +02:00
Jannis Braun 5abe13166a docs(systems): document invite-links + split registration gate 2026-04-29 01:57:58 +02:00
Jannis Braun a7c321a9d4 feat(web): show federated-registration warning banner in Connections add-instance form 2026-04-29 01:49:32 +02:00
Jannis Braun 641d4efcb9 fix(web): RegisterPage invite-fallback validation, IIFE preference, open-registration silence 2026-04-29 01:46:48 +02:00
Jannis Braun 0dae217787 feat(web): RegisterPage invite-token URL pickup + manual entry + closed-state UX 2026-04-29 01:38:52 +02:00
Jannis Braun 5b51980278 fix(web): make ConfirmDialog Escape capture-phase to prevent leaking to ancestor modals 2026-04-29 01:26:38 +02:00
Jannis Braun bde4d829ef feat(web): RegistrationPanel Edit/Revoke/Reinstate/Delete + Redemptions 2026-04-29 01:21:14 +02:00
Jannis Braun ba5c84fc6b fix(web): add Custom… expiry preset to CreateInviteModal per spec §4.2 2026-04-29 01:13:22 +02:00
Jannis Braun 234ec8e70d feat(web): RegistrationPanel Create-invite modal 2026-04-29 01:06:48 +02:00
Jannis Braun 42d1be54fa fix(web): guard RegistrationPanel invite-list against stale-fetch race 2026-04-29 00:57:57 +02:00
Jannis Braun dcd3daf390 feat(web): RegistrationPanel invite-list with Active/Archived tabs 2026-04-29 00:53:39 +02:00
Jannis Braun 7dd6bd6263 refactor(web): move registrationOpen toggle out of GeneralPanel 2026-04-29 00:44:35 +02:00
Jannis Braun cad6c50bff feat(web): RegistrationPanel scaffold with both registration toggles 2026-04-29 00:40:04 +02:00
Jannis Braun 7edfd8ae26 refactor(web): rename invites.patch → invites.update for codebase consistency
Other namespaces use 'update' (users.update, spaces.update, channels.update,
roles.update); the new 'invites.patch' breaks the pattern. Renamed before
Tasks 17-19 import it. Plan updated to match.
2026-04-28 21:11:43 +02:00
Jannis Braun 50756b3e65 feat(web): add invites + checkInvite to api client 2026-04-28 21:08:12 +02:00
Jannis Braun dbcc399ebb test(settings): tighten 'preserves field when omitted' to actually prove preservation
The original test seeded the DB with the schema default (1) and asserted
the response was true after a partial PATCH. That passes both for
'untouched' and 'reset to default' — doesn't distinguish them. Now the
test toggles the DB column to false BEFORE the PATCH, then asserts the
false value survives both in the response AND in the DB row directly.
2026-04-28 21:06:05 +02:00
Jannis Braun 8d7ba33c21 feat(settings): expose federatedRegistrationOpen in /settings/instance + /instance/info
Surfaces the federatedRegistrationOpen flag (Task 1 schema column) on the
admin settings GET/PATCH endpoints and the public /api/instance/info
endpoint. Closes the 3 deferred TypeScript errors from Task 2 by
populating the now-required InstanceAdminSettings/InstanceInfoResponse
field.

Adds smoke tests (routes/instance.test.ts, routes/settings.test.ts) that
lock in the JSON contract the Connections UI (Task 21) and admin
RegistrationPanel (Task 15) consume, plus boolean-validation coverage
for the PATCH path. Updates docs/systems/admin.md with the new field in
both InstanceAdminSettings and the public info response schema.
2026-04-28 21:01:50 +02:00