Commit Graph
1047 Commits
Author SHA1 Message Date
Jannis Braun 0d9ee44eee feat: add federation badges to mobile surfaces
Globe/amber badge on federated space icons, @domain on federated
DM users, home instance on the You screen profile card.
2026-03-23 19:27:39 +01:00
Jannis Braun 32be1bceab feat: add voice participant context menus on mobile
Long-press on voice participants shows moderation items (space mute,
deafen, disconnect, move) and local audio controls (mute, volume).
Skips self and DM calls.
2026-03-23 19:25:41 +01:00
Jannis Braun 937c4b68b2 feat: add leave group context menu on MobileDmsScreen
Long-press on group DMs shows Leave Group option.
2026-03-23 19:24:17 +01:00
Jannis Braun f84b1726bf feat: add context menus to MobileSpacesScreen
Add onContextMenu handlers for space icons (invite, folder management,
transfer, leave), channel items (settings, delete), and category headers
(settings, delete). Includes full folder management handlers.
2026-03-23 19:21:14 +01:00
Jannis Braun 8f104e1c5b fix: derive spaceId from voice channel in buildVoiceModMenuItems
Use channelToSpaceMap.get(channelId) for permission checks instead of
currentSpaceId from the navigation store. On mobile, UI navigation
decouples from the active voice session.
2026-03-23 16:32:47 +01:00
Jannis Braun fd6be8c713 fix: suppress native iOS callout on mobile long-press
Add -webkit-touch-callout: none on mobile viewports to prevent the
native iOS copy/lookup popup from racing with our context menu.
Clear any text selection when the long-press timer fires.
2026-03-23 15:26:09 +01:00
Jannis Braun ce33d8f7ea feat: global long-press context menus for all mobile touch targets
Add useGlobalLongPress to ContextMenuRenderer that detects 500ms hold
with <10px movement and dispatches a synthetic contextmenu event on the
touched element. All existing onContextMenu handlers (spaces, channels,
voice users, messages, etc.) now work on touch devices automatically.

Remove per-message useLongPress integration from Message.tsx since the
global handler covers it.
2026-03-23 15:12:58 +01:00
Jannis Braun 05a4b23d88 fix: prevent scroll snap-back during mobile momentum scrolling
ResizeObserver and media load callbacks were using isNearBottomRef
(5000px threshold) to decide whether to auto-scroll to bottom. On
mobile, inertial flick scrolling hadn't moved far enough to clear
that threshold before the observer fired, snapping the user back.

Now these callbacks check actual scroll distance at fire time with
a tight 150px threshold — only auto-scrolls if truly at the bottom.
2026-03-23 15:04:44 +01:00
Jannis Braun 2c372a5d34 fix: three mobile bugs — scroll, GeneralPanel loading, activity tab
1. Chat scroll: add flex flex-col to MobileChatScreen messages wrapper
   so MessageList's flex-1 actually works (parent must be flex container)

2. Instance General panel: add fetchInstanceSettings/fetchStreamingLimits
   to MobileInstancePanel mount (mirrors desktop InstancePanel useEffect)

3. Friends activity: add Activity tab to mobile FriendsPage showing
   friends grouped by activity status (active, online, offline)
2026-03-23 14:56:07 +01:00
Jannis Braun f90cf91760 fix: immediately clean up voice state when voice-active socket disconnects
Previously, voice cleanup only happened in finalizeDisconnect after a
5-second grace period, and only when ALL connections closed. If a user
was logged in on multiple devices and closed the one in voice, the
voice state was never cleaned up — creating a permanent ghost in the
channel sidebar.

Now removeConnection checks if the closing socket is the voice-active
one (tracked via voiceWs map) and immediately cleans up voice state,
broadcasts the leave event, and notifies remaining tabs.
2026-03-23 14:30:57 +01:00
Jannis Braun 319832ebc8 feat: clear voiceWs on all voice leave paths 2026-03-23 14:27:42 +01:00
Jannis Braun cc10876b93 feat: wire setVoiceWs into voice join and DM call handlers
Adds device-switch guardrail to handleVoiceJoin: if the user already
has a voice session on a different WebSocket, that old socket receives
a voice_disconnected/displaced event before the new session takes over.
Also binds voiceWs on the caller socket in handleDmCallStart and on
the acceptor socket in handleDmCallAccept.
2026-03-23 14:25:42 +01:00
Jannis Braun 357ba8b4d9 refactor: thread ws parameter through handleClientEvent to voice handlers 2026-03-23 14:23:48 +01:00
Jannis Braun 80c32ae1e6 feat: add long-press context menus for mobile messages
Create useLongPress hook with 500ms delay, 10px movement cancellation
(Euclidean distance), and ghost click suppression. Integrate into
Message component to trigger the existing context menu bottom sheet
on touch devices.
2026-03-23 14:22:38 +01:00
Jannis Braun 876326e7b7 feat: add voiceWs map and accessors to ConnectionManager 2026-03-23 14:22:28 +01:00
Jannis Braun 77a1a7920c feat: add standalone MobileMembersScreen replacing blank member panel
Create MobileMembersScreen that renders space members grouped by role
without depending on desktop memberListOpen flag or hidden md:block.
Add members button to voice full screen header for space channels.
2026-03-23 14:20:06 +01:00
Jannis Braun 54b367924d feat: add drill-down navigation for Instance settings on mobile
Replace inline InstancePanel render with MobileInstancePanel that shows
a navigation list for General, Streaming, Storage, and Users sub-panels.
Each sub-panel pushes onto the mobile screen stack with MobileScreenHeader.
2026-03-23 14:16:56 +01:00
Jannis Braun 7c40a230bc feat: add reusable MobileScreenHeader component
Extracts the back-button header pattern used across all mobile screens
into a single component. Props: title (string), rightActions (ReactNode).
2026-03-23 14:15:04 +01:00
Jannis Braun d8c5e7ff16 fix: restore mobile chat scrolling by fixing height constraint chain
Add overflow-hidden to MobileScreenStack stacked screen wrapper to
establish block formatting context. Add min-h-0 to MobileChatScreen
messages wrapper to override flex min-height: auto default.
2026-03-23 14:14:18 +01:00
Jannis Braun 58f6fb1baa fix: raise upload rate limit from 10 to 30 per minute 2026-03-23 02:55:00 +01:00
Jannis Braun 9a5e613331 feat: add upload progress bars and error toasts
Adds uploadWithProgress() using XMLHttpRequest for real-time upload
progress events. MessageInput now shows per-file progress bars with
percentage overlay during upload. Failed uploads show toast warnings
with the specific error instead of silently failing. Upload timeout
raised to 10 minutes for large files.
2026-03-23 02:51:56 +01:00
Jannis Braun fdc8732ba7 fix: raise upload size cap from 500 MB to 5 GB
The 500 MB cap was arbitrary. Self-hosted admins should decide based
on their own disk space. Global multipart ceiling raised to 5 GB,
validation cap to 5120 MB.
2026-03-23 02:36:22 +01:00
Jannis Braun 9044bfd26f fix: use toasts instead of inline banners for Storage panel feedback
Replaces the layout-shifting error banner at the bottom of the panel
with non-intrusive toast notifications. Upload limit save, cleanup
success, and all error feedback now use the existing toast system.
Cleanup preview results stay inline as expected contextual responses.
2026-03-23 02:32:57 +01:00
Jannis Braun 7ba6c4074e feat: add upload limit setting and media retention cleanup to Storage panel 2026-03-23 02:24:25 +01:00
Jannis Braun 4807bfeeb1 feat: read/write maxUploadSizeMb in instance settings API 2026-03-23 02:22:22 +01:00
Jannis Braun 5be2e73c8a fix: use per-request upload limit from DB and fix silent truncation
Reads max_upload_size_bytes from instance_settings per-request and
passes it to request.file() so Fastify kills the stream at the
admin's configured limit. Checks file.truncated to properly reject
files that exceed the limit instead of saving corrupted data.
2026-03-23 02:22:15 +01:00
Jannis Braun ee11408060 feat: add age-based media cleanup endpoint
Adds cleanupOldMedia() to the storage janitor and a new endpoint
POST /api/admin/storage/cleanup-media { maxAgeDays, dryRun }.
Deletes chat attachments older than the specified threshold while
preserving profile images.
2026-03-23 02:20:28 +01:00
Jannis Braun eb743ca2ca feat: add max_upload_size_bytes column and shared type 2026-03-23 02:19:42 +01:00
Jannis Braun 3c2c333a56 feat: show dangling attachment count in Storage panel
Adds a 'Dangling Records' card to the storage overview grid and
includes dangling records in the cleanup eligibility check.
2026-03-23 01:56:51 +01:00
Jannis Braun f634f35450 fix: add FK constraint to attachments.dm_message_id via table rebuild
Rebuilds the attachments table with ON DELETE CASCADE on dm_message_id.
Dangling records are excluded during copy — their files become standard
disk orphans detectable by the storage janitor. Also updates the raw SQL
in index.ts to include width/height/duration columns for fresh installs.
2026-03-23 01:55:26 +01:00
Jannis Braun 8bcb5cc977 fix: wrap DM message deletion in transaction for atomicity
Matches the space message delete handler pattern. Prevents inconsistent
state if the server crashes between individual delete operations.
2026-03-23 01:54:42 +01:00
Jannis Braun d687988ba8 fix: use explicit counter for danglingFilesOnDisk in referencedFiles calc
Matches the orphanedFiles counting pattern and avoids a subtle
discrepancy if two dangling records shared the same filename.
2026-03-23 01:53:25 +01:00
Jannis Braun b40999995b feat: detect and clean up dangling attachment records in storage janitor
Adds getDanglingAttachments() to find attachment records whose
messageId/dmMessageId points to a deleted message. Updates stats
to show dangling count and cleanup to delete them.
2026-03-23 01:49:41 +01:00
Jannis Braun 4494209779 feat: add danglingAttachments/danglingSize to StorageStats type 2026-03-23 01:47:42 +01:00
Jannis Braun b3d4747126 chore: remove unused ConnectedInstance type import from federationOps 2026-03-23 00:57:36 +01:00
Jannis Braun aa2c6f7aa1 feat: add 'Sync now' button for connected instances with pending password sync 2026-03-23 00:53:48 +01:00
Jannis Braun 95cb9d4df2 feat: add background retry scheduler for federation password sync
Replace the give-up-after-3-retries path with a persistent background
scheduler: 10 retries every 30s (5 min), then 12 retries every 5 min
(1 hr). Active timers are keyed by origin so rapid password changes
cancel and replace the previous loop. All timers are cleared on logout
via clearPasswordSyncTimers() called from instanceStore.reset().
2026-03-23 00:52:40 +01:00
Jannis Braun 678e1bf358 refactor: make pendingSyncOrigins reactive in Zustand store
Add `pendingSyncOrigins: string[]` to InstanceState so components re-render
when pending password-sync flags change. Hydrate from localStorage on
autoConnectAll, clear on reset, and remove the localStorage-only read path
from `hasPendingPasswordSync`.
2026-03-23 00:50:58 +01:00
Jannis Braun 1bd684a6b0 feat: self-healing login for federated users with stale password hashes
When a federated user's local password hash is stale (e.g. they changed
their password on the home instance and sync failed), the login handler
now falls back to verifying credentials against the home instance. If the
home instance accepts the password, the local hash is silently updated
without touching passwordChangedAt, so existing valid JWTs remain valid.
2026-03-23 00:48:32 +01:00
Jannis Braun 41caf5f90c fix: skip currentPassword check for federated users on change-password 2026-03-23 00:48:02 +01:00
Jannis Braun a888828941 chore: gitignore installers and include pending web changes
Add installers/ to .gitignore and remove from tracking — binaries
should not be in git.

Also includes:
- Re-push Electron activities after WebSocket reconnect (sleep/wake)
- Merge activity map instead of replacing to preserve local state
- Nori mascot design plan
2026-03-23 00:25:31 +01:00
Jannis Braun 100ac15939 fix: deduplicate keybind actions when native hook and web fallback both fire
When the app is focused and the native uiohook hook is active, both the
IPC bridge and the web fallback capture the same keypress, dispatching
the toggle action twice (~0-20ms apart). This double-toggles mute/deafen
back to the original state.

Add a 100ms dedup window in dispatchKeybindAction to suppress the second
dispatch. Safe for human input (key repeat starts at ~500ms).
2026-03-22 23:55:59 +01:00
Jannis Braun e4f6f9a4c4 fix: translate uiohook keycodes to match web UI keybind hashes
The web UI records keybinds as djb2 hashes of DOM event.code strings
(e.g. "KeyM" → 2090563626), but uiohook fires native scan codes
(e.g. M → 50). These never matched, so global keybinds only worked
in-focus via the web fallback, never out-of-focus via the native hook.

Add a uiohook-to-DOM-code mapping table and pre-compute the djb2
hashes so pressedKeys uses the same numbering as the keybind store.
2026-03-22 23:50:02 +01:00
Jannis Braun 313ff4ef87 feat: add Nori mascot to mobile empty states 2026-03-22 23:39:16 +01:00
Jannis Braun b3051c25cd feat: add lonely Nori mascot to empty Explore page 2026-03-22 23:39:15 +01:00
Jannis Braun 4e23cb5bf9 feat: add sleeping Nori mascot to empty DM sidebar 2026-03-22 23:39:13 +01:00
Jannis Braun a4ebd52900 feat: replace Wumpus empty states with Nori mascot on Friends page 2026-03-22 23:37:15 +01:00
Jannis Braun 43eaceadc0 fix: improve animation hook robustness
- Add .catch handler to scheduleNext to prevent unhandled promise
  rejections from killing the scheduling loop
- Replace `as unknown as Animation` cast with Cancellable interface
  for type-safe cleanup handles
2026-03-22 23:31:50 +01:00
Jannis Braun 977983eed1 feat: add useMascotAnimation hook with WAAPI state machine 2026-03-22 23:26:53 +01:00
Jannis Braun e5495ac0d8 fix: resolve TS2322 ref type error and Tailwind class conflict in Mascot
- Change SvgProps.svgRef to React.Ref<SVGSVGElement> for React 18 compat
- className now replaces default w-32/h-32 instead of appending (avoids
  Tailwind specificity conflicts)
- Replace inline style={{ position: 'relative' }} with Tailwind 'relative'
2026-03-22 23:22:06 +01:00