Skip to content

fix(mobile): iOS tap-to-edit, safe areas and themed status bar - #562

Merged
SamTV12345 merged 1 commit into
mainfrom
fix/ios-pad
Nov 24, 2026
Merged

SamTV12345 merged 1 commit into
mainfrom
fix/ios-pad

Conversation

@SamTV12345

Copy link
Copy Markdown
Member

Fixes the issues reported on a real iPhone (18 Pro Max):

  • Tap on the empty area did nothing. #editorcontainer now has a click fallback: if the tap is not on text with a caret already in a line, it focuses #innerdocbody and puts the caret at the end of the last line — synchronously inside the click, which iOS requires to open the keyboard.
  • White area around the Dynamic Island. viewport-fit=cover plus env(safe-area-inset-*) paddings for the pad toolbar, bottom bar, chat FAB, timeslider and sheet title bar. apple-mobile-web-app-status-bar-style is black-translucent for dark toolbars, default otherwise; the web manifest's theme/background colour follows the pad theme (white for etherpad-go, green for colibris).
  • Typed text never reached the server. Root cause is in the editor: iOS inline predictions start a composition that may never get compositionend, so inInternationalComposition stays pending and no changes are committed. Fixed in fix(editor): a composition always ends (iOS) webcomponents#19 — needs a release and a version bump here afterwards.

Tests: Go tests for the manifest colours and the head metas; new Playwright test that a tap below the text focuses the editor and typing lands in the pad. mobile_layout, sheet_mobile, theme_color pass locally.


Generated by Claude Code

- Tapping the empty area below the text now focuses the editor and puts
  the caret at the end, synchronously inside the click so iOS opens the
  keyboard.
- viewport-fit=cover plus env(safe-area-inset-*) paddings for the pad,
  timeslider and sheet, so the page fills the area around the notch /
  Dynamic Island.
- apple-mobile-web-app-status-bar-style follows the toolbar theme, and the
  manifest colours follow the pad theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012RMvvMtnCwj6ycD9fwLYVu
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Fix iOS tap-to-edit and mobile safe-area presentation

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Focus the pad editor when users tap empty space, placing the caret at the last line.
• Extend pad and spreadsheet chrome into iOS safe areas while keeping controls clear.
• Match installed-app status bar and manifest colours to the selected theme.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 5 capabilities

  • 5 affected capabilities span independent functional scopes: PWA installation presentation, pad mobile editing experience, spreadsheet mobile experience, web mobile/PWA shell.
  • The changed Meta component is the shared producer for page-level viewport and web-app metadata.
  • Its effect is one bounded shell behavior across pages, not separate capabilities per generated file or page component.
  • These rules coordinate the pad body and its mobile chrome around the same safe-area layout outcome.
  • They do not create separate capabilities for each toolbar or icon because all are presentation consumers of the pad layout.
  • This is a distinct user outcome within the pad editing integration: converting an empty-space tap into an editor focus and caret placement.
  • It shares the pad scope with layout changes but does not affect storage or collaboration protocol behavior.
  • The template, title-bar CSS, mobile theme CSS, and generated template jointly implement one spreadsheet chrome layout behavior.
  • They are implementation hops of the same bounded spreadsheet capability.
  • This changes the installed web-app window and splash colors based on the resolved theme.
  • It is independent of in-page pad editing and spreadsheet interaction because it affects installation/browser chrome presentation rather than document behavior.
Sources

ui/src/js/sheet/sheetEditor.ts[56-56]

.sheet-titlebar { display: flex; align-items: center; gap: 8px; height: calc(36px + env(safe-area-inset-top, 0px)); box-sizing: border-box; flex: none; padding: env(safe-area-inset-top, 0px) calc(12px + env(safe-area-inset-right, 0px)) 0 calc(12px + env(safe-area-inset-left, 0px)); background: var(--sheet-accent, #107c41); color: var(--sheet-on-accent, #fff); font: 14px system-ui, sans-serif; }
Behavioral complexity 🟡 Medium 🧩 Compatibility cases

  • Before: pages used a conventional viewport declaration and did not emit the new installability/status-bar metadata.
  • After: the shell combines viewport-fit, installability flags, and a pad-only runtime status-bar choice.
  • New correctness condition: browsers and home-screen modes must interpret the metadata consistently, while the pad script must tolerate absent localStorage, absent classes, and runtime DOM errors.
  • This is a compatibility interaction across browser modes rather than a new data algorithm.
Potential damage 🟡 Medium 🩹 Recoverable

  • If the changed interaction regresses, empty-space taps may fail to focus, open the keyboard, or place the caret correctly, while existing direct line editing and other pad operations remain available.
  • The consequence is recoverable by another interaction, page reload, or code rollback; no document data is lost by the handler itself.
  • Users can retry by tapping a line or using another focus path.
  • Reverting the client code restores the prior interaction; no persistent state repair or external compensation is required.
Assessed commit 4ffa8e1
Diagram

graph TD
  PadHead["Pad head"] --> PadLayout["Pad safe areas"]
  SheetHead["Sheet head"] --> SheetTitlebar["Sheet title bar"]
  EditorClick["Empty-area tap"] --> EditorCaret["Editor caret"]
  PadHead --> AppChrome["Installed-app chrome"]
  SheetHead --> AppChrome
  Manifest["Theme manifest"] --> AppChrome
Loading
High-Level Assessment

Keep the synchronous click fallback and page-specific safe-area rules: they address distinct iOS behaviours without restructuring the existing pad and spreadsheet layouts. The reported iOS composition issue is not fixed in this diff; it remains dependent on an upstream release and subsequent version bump.

Files changed (12) +172 / -20

Bug fix (9) +118 / -20
mobile.cssKeep pad controls clear of iOS safe areas +27/-1

Keep pad controls clear of iOS safe areas

• Adds top and side inset spacing for the pad body and toolbar, including the timeslider. Adjusts bottom-toolbar horizontal padding and chat-button placement around side insets.

assets/css/static/pad/mobile.css

head.templEnable edge-to-edge pad display and themed iOS status bar +25/-1

Enable edge-to-edge pad display and themed iOS status bar

• Adds viewport-fit and mobile web-app metadata. Pad and timeslider pages select the initial iOS status-bar style from toolbar classes and the saved dark-mode preference.

assets/head/head.templ

head_templ.goRegenerate pad head template output +15/-9

Regenerate pad head template output

• Updates the generated Go renderer to emit the new mobile metadata and pad-only status-bar script. Adjusts generated template source locations.

assets/head/head_templ.go

sheet.templEnable edge-to-edge spreadsheet display +7/-1

Enable edge-to-edge spreadsheet display

• Adds viewport-fit and mobile web-app metadata to the spreadsheet page. Sets a translucent iOS status bar so its title-bar colour can extend beneath the status area.

assets/sheet/sheet.templ

sheet_templ.goRegenerate spreadsheet page template output +4/-4

Regenerate spreadsheet page template output

• Updates the generated renderer with the spreadsheet viewport and status-bar metadata, along with shifted template source locations.

assets/sheet/sheet_templ.go

manifest.goSet manifest colours from the resolved pad theme +8/-2

Set manifest colours from the resolved pad theme

• Uses white theme and background colours for etherpad-go instead of the previously fixed green. Retains green for colibris and other resolved themes.

lib/api/static/manifest.go

pad_editor.tsFocus the editor when empty pad space is clicked +30/-0

Focus the editor when empty pad space is clicked

• Adds a synchronous editor-container click fallback that focuses editable content and places the caret at the end of its last line. Preserves line-number clicks and existing in-line selections.

ui/src/js/pad_editor.ts

sheetEditor.tsOffset the spreadsheet title bar from device insets +1/-1

Offset the spreadsheet title bar from device insets

• Extends the title bar beneath the top safe area while padding its controls away from top and side insets.

ui/src/js/sheet/sheetEditor.ts

sheetTheme.tsPreserve spreadsheet title-bar insets on phones +1/-1

Preserve spreadsheet title-bar insets on phones

• Updates the mobile title-bar override to retain top and side safe-area spacing at narrow widths.

ui/src/js/sheet/sheetTheme.ts

Tests (3) +54 / -0
head_test.goTest rendered pad mobile metadata +15/-0

Test rendered pad mobile metadata

• Adds a rendering test that checks for viewport-fit, iOS web-app capability, and the status-bar-style script in the pad head.

assets/head/head_test.go

manifest_theme_test.goTest installed-app manifest theme colours +18/-0

Test installed-app manifest theme colours

• Adds coverage for the white etherpad-go manifest colours and green colibris theme colour.

lib/api/static/manifest_theme_test.go

mobile_layout.spec.tsTest typing after an empty-area editor tap +21/-0

Test typing after an empty-area editor tap

• Adds a phone-sized browser test that clicks below the text, checks editor focus and caret placement within a line, then verifies typed text appears in the pad.

playwright/specs/mobile_layout.spec.ts

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (6) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Blank taps leave the caret in an old line 🐞 Bug ≡ Correctness
Description
padeditor.init returns when the editor is active and its existing selection is in a line, without
checking whether the new click hit that line. After a user has placed a caret, a tap on blank space
below the text can leave subsequent typing at the old position instead of moving it to the final
line.
Code

ui/src/js/pad_editor.ts[69]

+        if (document.activeElement === inner && caretInLine()) return;
Evidence
The second guard ignores the click target, while the intended end-of-document range and focus occur
only after it. The editor layout provides blank area below short text.

ui/src/js/pad_editor.ts[63-77]
assets/css/static/pad/layout.css[44-61]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The existing-caret guard prevents blank-area taps from moving the caret after the editor has focus.
## Fix Focus Areas
- ui/src/js/pad_editor.ts[63-77]
- playwright/specs/mobile_layout.spec.ts[162-180]
## Recommended Fix
Preserve native selection for clicks on text, but do not return solely because the editor is active with an old selection. Test a blank-area tap after first placing the caret earlier in the document.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. The launcher header reaches the notch 🐞 Bug ≡ Correctness
Description
head.Meta enables viewport-fit=cover for every page, including the launcher, but the launcher's
header has fixed horizontal padding rather than safe-area insets. In landscape on a notched iPhone,
its brand can occupy the unsafe edge that the previous viewport kept clear.
Code

assets/head/head.templ[95]

+	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, viewport-fit=cover"/>
Evidence
The launcher renders the shared head component, while its header positions the brand using a fixed
28px side padding and has no safe-area offset.

assets/welcome/main.templ[19-23]
assets/welcome/main.templ[55-61]
assets/css/welcome/main.css[26-38]
assets/head/head.templ[92-97]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The shared full-bleed viewport setting also applies to the launcher, whose header does not account for landscape display cutouts.
## Fix Focus Areas
- assets/head/head.templ[92-97]
- assets/css/welcome/main.css[12-38]
## Recommended Fix
Either limit the full-bleed viewport setting to pages with safe-area-aware layouts or add safe-area offsets to the launcher header and other edge-aligned launcher content.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Sheet rows remain beneath the notch 🐞 Bug ≡ Correctness
Description
SheetIndex enables a full-bleed viewport, but only the sheet title bar receives horizontal
safe-area padding. In landscape, the grid starts at the viewport edge and its row headers stick at
left: 0, leaving those controls in the display-cutout area.
Code

assets/sheet/sheet.templ[35]

+			<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
Evidence
The changed viewport allows content into horizontal unsafe areas. The title bar alone adds side
insets; the grid host has no such inset and the row headers explicitly stick to its left edge.

assets/sheet/sheet.templ[32-38]
ui/src/js/sheet/sheetEditor.ts[44-56]
ui/src/js/sheet/sheetView.ts[76-90]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The full-bleed sheet protects the title bar but not its edge-aligned, sticky grid headers.
## Fix Focus Areas
- assets/sheet/sheet.templ[32-38]
- ui/src/js/sheet/sheetEditor.ts[44-48]
- ui/src/js/sheet/sheetView.ts[76-90]
## Recommended Fix
Give the sheet content safe horizontal bounds in landscape while preserving grid scrolling and sticky row-header alignment.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Sheet grids lose space above the home bar 🐞 Bug ≡ Correctness
Description
SheetIndex now activates full-bleed safe-area layout, exposing a sheet status-bar rule that adds
the bottom inset to both its height and its padding. Because that bar uses content-box sizing, a
device with a bottom inset reserves it twice and reduces the remaining grid viewport.
Code

assets/sheet/sheet.templ[35]

+			<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
Evidence
The mobile rule adds env(safe-area-inset-bottom) to height and padding-bottom, while the status
bar has no border-box declaration. The grid host flexes into the space left by the page chrome.

assets/sheet/sheet.templ[32-38]
ui/src/js/sheet/sheetTheme.ts[102-105]
ui/src/js/sheet/sheetEditor.ts[44-48]
ui/src/js/sheet/sheetEditor.ts[61-61]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The full-bleed viewport makes an existing sheet status-bar rule double-count the bottom safe-area inset.
## Fix Focus Areas
- assets/sheet/sheet.templ[32-38]
- ui/src/js/sheet/sheetTheme.ts[103-105]
- ui/src/js/sheet/sheetEditor.ts[60-61]
## Recommended Fix
Make the status bar's inset-aware height include its bottom padding, such as by using border-box sizing, and verify the grid retains the expected viewport height.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (2)
5. The iOS status bar mismatches the pad 🐞 Bug ≡ Correctness
Description
head.Meta sets the status-bar style once from initial classes or ep_darkMode, whereas later
theme changes update only the toolbar classes and theme-color. Switching themes leaves the new
meta stale; a stored dark preference can also select black-translucent on a pad whose dark mode is
disabled.
Code

assets/head/head.templ[R139-144]

+					var dark = el.classList.contains('super-dark-toolbar') || el.classList.contains('dark-toolbar') ||
+						localStorage.getItem('ep_darkMode') === 'true';
+					var m = document.createElement('meta');
+					m.name = 'apple-mobile-web-app-status-bar-style';
+					m.content = dark ? 'black-translucent' : 'default';
+					document.head.appendChild(m);
Evidence
The new script appends a fixed status-bar meta and treats stored dark mode as sufficient. Pad
startup gates dark mode, while the theme-switch path changes classes and updates only theme-color
metas.

assets/head/head.templ[135-145]
ui/src/js/pad.ts[673-677]
ui/src/js/pad_editor.ts[136-150]
ui/src/js/skin_variants.ts[18-30]
ui/src/js/skin_variants.ts[42-65]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new status-bar meta can disagree with the displayed toolbar at startup or after a theme switch.
## Fix Focus Areas
- assets/head/head.templ[130-147]
- ui/src/js/skin_variants.ts[18-65]
- ui/src/js/pad.ts[673-677]
## Recommended Fix
Derive the initial style from the theme actually applied to this pad, including dark-mode eligibility, and keep the status-bar meta synchronized wherever toolbar variants change.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Dark pads get a white app splash 🐞 Bug ≡ Correctness
Description
buildManifest assigns white to every resolved etherpad-go theme without examining its configured
toolbar variant. An installation configured with super-dark-toolbar therefore receives a white
manifest background and theme color although its toolbar color is #111827.
Code

lib/api/static/manifest.go[R36-39]

+	themeColor := "#0f775b"
+	if s.PadTheme.Resolved(s.SkinName) == settings.PadThemeEtherpadGo {
+		themeColor = "#ffffff"
+	}
Evidence
Theme resolution determines only the theme name. The existing color helper separately resolves
toolbar variants, including the dark etherpad-go color, but the new manifest branch always chooses
white.

lib/api/static/manifest.go[34-51]
lib/skin/colors.go[38-68]
assets/head/head.templ[57-65]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new manifest color ignores configured toolbar variants, including dark variants.
## Fix Focus Areas
- lib/api/static/manifest.go[34-51]
- lib/skin/colors.go[38-68]
## Recommended Fix
Resolve the manifest's configured theme color using the existing toolbar-color logic and `SkinVariants`, then cover a dark configured variant in the manifest test.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@SamTV12345
SamTV12345 merged commit a0c869f into main Nov 24, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant