Skip to content

Commit 374f598

Browse files
JohnMcLearclaude
andauthored
fix(mobile): responsive dialogs + safe-area + workspace events + X-Frame fallback + https auto-prefix (Phase 7 fixes) (#37)
* fix(mobile): responsive dialogs + safe-area insets + workspace events + X-Frame fallback + https:// auto-prefix Six device-test issues from real-hardware run: 1. Dialogs (AddWorkspace / OpenPad / etc.) overflowed phone viewports — DialogShell width now `min(${width}px, calc(100vw - 16px))` so a 420 panel caps at viewport-16 on phones. Tighter padding under 480px. 2. Bare hostname URLs were rejected — AddWorkspaceDialog auto-prefixes `https://` when the input has no `://` scheme. 3. (Same as #1 — OpenPadDialog uses DialogShell.) 4. "Black screen" on pad open — likely X-Frame-Options DENY/SAMEORIGIN from the server. PadIframeStack now starts a 6s timeout per iframe; if no onLoad fires, an opaque overlay surfaces with an "Open in browser" button that hands the URL off to @capacitor/browser. 5. Status bar overlapped the rail — shell-root-wrapper now applies `env(safe-area-inset-*)` padding. Zero visual change on desktop; stops mobile WebView from drawing under the status bar / notch. 6. Newly added workspaces didn't appear in the rail — mobile platform's `events.onWorkspacesChanged` was a noop. workspace-store now owns a tiny listener Set; CapacitorPlatform wires it through so the shell's `onWorkspacesChanged` handler in App.tsx receives the new `{workspaces, order}` after every add / update / remove / reorder. DialogShell width-test dropped (jsdom can't parse CSS `min()`; behaviour is exercised in Playwright on real Chromium). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(mobile): icons + collapse handle + auto-collapse + userName + pad-history + Ctrl-K hint + tests Round 2 of device feedback: - App icons: regenerated all five mipmap densities + adaptive foregrounds from packages/desktop/build/icons/icon-512.png. The Capacitor default icon is gone; Etherpad branding everywhere. - Removed the always-visible PadActionsOverlay (share is redundant with Etherpad's own UI; the "open in browser" button forced over content). - Collapse handle now flush to left edge, 14px wide (was 22 + 3px gap), right-flat border so it reads as a tab sticking out. - Tab.open auto-collapses the workspace rail (mobile UX) — fires only on the open event, doesn't fight subsequent manual expands. - Tab.open upserts pad-history so QuickSwitcher's name search finds the pad. Wired events.onPadHistoryChanged through. - Settings.userName threads into the iframe src as `&userName=` so the user's name applies to existing + new pads (Etherpad reads the query param at join time). - "Tip: Ctrl+K opens this from anywhere" hidden via `@media (pointer: coarse)` — touch devices can't issue keyboard shortcuts anyway. - Tests: 8 mobile Playwright cases now (added 3 — auto-collapse, pad-history populate, userName in src). X-Frame detection removed (Chromium fires onLoad even for blocked iframes; needs the native WebChromeClient hook in Phase 6b). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(mobile): swipe gestures + Android back-button + upsert error logging - Edge-swipe right from left edge expands the rail; swipe left from inside collapses it. Touch-only — doesn't fire when a dialog is open (dialogs handle their own gestures). - Android hardware/gesture back: dismiss open dialog first, else collapse rail, else minimise the app. Mirrors stock Android navigation expectations. - padHistory.upsert errors now log to console.warn instead of being swallowed by `void`. Earlier logcat confirmed upsert is firing and writing 'Jehejej' to SharedPreferences as expected. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3c13426 commit 374f598

30 files changed

Lines changed: 351 additions & 154 deletions

packages/mobile/android/app/capacitor.build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ android {
1010
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
1111
dependencies {
1212
implementation project(':capacitor-app')
13+
implementation project(':capacitor-browser')
14+
implementation project(':capacitor-preferences')
15+
implementation project(':capacitor-share')
1316

1417
}
1518

-14 Bytes
Loading
1.29 KB
Loading
-1.8 KB
Loading
-100 Bytes
Loading
858 Bytes
Loading
-1.03 KB
Loading
-200 Bytes
Loading
1.32 KB
Loading
-3.14 KB
Loading

0 commit comments

Comments
 (0)