Skip to content

Add Lockdown Mode warning sheet for iOS editor#418

Merged
jkmassel merged 3 commits intotrunkfrom
jkmassel/ios-lockdown-banner
Apr 10, 2026
Merged

Add Lockdown Mode warning sheet for iOS editor#418
jkmassel merged 3 commits intotrunkfrom
jkmassel/ios-lockdown-banner

Conversation

@jkmassel
Copy link
Copy Markdown
Contributor

@jkmassel jkmassel commented Apr 2, 2026

Summary

Ref CMM-2014.

  • Detects iOS Lockdown Mode via WKWebpagePreferences.isLockdownModeEnabled after WebView navigation completes
  • Presents a dismissible half-sheet warning with a "Learn More" link to Apple's support article on excluding apps
  • Re-checks lockdown mode status when the app returns to foreground to handle Settings changes
  • All user-facing strings routed through EditorLocalization so host apps can provide translations
IMG_0003

Test plan

  • Verify the warning sheet appears when Lockdown Mode is enabled on device
  • Verify "Learn More" opens the Apple support article
  • Verify "Dismiss" closes the sheet and focuses the editor
  • Verify toggling Lockdown Mode exclusion in Settings and returning to the app updates state correctly
  • Verify editor autofocus is skipped when lockdown mode is active so the keyboard doesn't overlap the sheet
  • Verify normal editor behavior is unaffected when lockdown mode is disabled
  • Run LockdownModeMonitorTests (CI will do this)

Known issue

Type some text then switch to settings and back – the contents of the editor are lost.

🤖 Generated with Claude Code

@jkmassel jkmassel force-pushed the jkmassel/ios-lockdown-banner branch 5 times, most recently from af5e39b to 657bc97 Compare April 2, 2026 21:50
@jkmassel jkmassel requested a review from dcalhoun April 2, 2026 21:52
@jkmassel jkmassel self-assigned this Apr 2, 2026
@jkmassel jkmassel marked this pull request as ready for review April 2, 2026 21:52
@jkmassel jkmassel force-pushed the jkmassel/ios-lockdown-banner branch from 657bc97 to 16f3b4d Compare April 3, 2026 02:00
Copy link
Copy Markdown
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks solid, but I shared a few concerns regarding the experience. I'm curious of your thoughts on those.

Comment thread ios/Sources/GutenbergKit/Sources/Views/LockdownModeSheet.swift
Comment thread ios/Sources/GutenbergKit/Sources/Services/LockdownModeMonitor.swift Outdated
Comment thread ios/Sources/GutenbergKit/Sources/Views/LockdownModeBannerView.swift Outdated
Comment thread ios/Sources/GutenbergKit/Sources/Services/LockdownModeMonitor.swift
When iOS Lockdown Mode is enabled, WebKit JIT compilation is disabled,
which can degrade the editor's performance and functionality. This adds
detection via WKWebpagePreferences and presents a warning sheet with a
link to Apple's support article on excluding apps from Lockdown Mode.

- Detect lockdown mode after WebView navigation completes
- Present dismissible half-sheet with warning and "Learn More" link
- Re-check on foreground return to handle Settings changes
- Skip editor autofocus when lockdown mode is active
- All strings routed through EditorLocalization for host app overrides

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jkmassel jkmassel force-pushed the jkmassel/ios-lockdown-banner branch from 16f3b4d to 840926f Compare April 8, 2026 21:31
Copy link
Copy Markdown
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changed tested well for me. The previously reported issues are no longer present. 🚀

@jkmassel jkmassel merged commit 65f4746 into trunk Apr 10, 2026
16 checks passed
@jkmassel jkmassel deleted the jkmassel/ios-lockdown-banner branch April 10, 2026 06:52
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.

2 participants