Add initial iOS Find in Post support - #609
yunuschoudhurywork-lang wants to merge 6 commits into
Conversation
|
@yunuschoudhurywork-lang thank you for exploring this. It may take me a little while to begin review of this, but hopefully I can next week. I'll follow up. |
|
@dcalhoun sure sir!! I'll wait for your confirmation then only I proceed further. |
|
@dcalhoun hi sir! Any update. |
|
@yunuschoudhurywork-lang no, I was unable to review last week. It remains on my list, so I intend to follow up. Thank you for your patience. |
Resolves a SwiftLint `vertical_whitespace` violation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Gives the iOS demo app an entry point for `presentFindNavigator()`, so the find navigator can be exercised through the same path the host apps will use rather than only via a hardware keyboard shortcut. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Dismissing the find navigator while the software keyboard is visible left the web view short by the navigator's height, exposing a strip of the view controller's background below the editor. `UIKeyboardLayoutGuide` folds the find navigator into the region it tracks. When the navigator and the keyboard go away together the guide never receives a final update, so it stays short and the web view's bottom constraint inherits the stale value. Track the keyboard's visibility directly and pin the web view to the safe area whenever neither the keyboard nor the navigator is present, leaving the guide in charge only while something is actually docked there. The navigator still reports itself visible during `keyboardWillHide` and only flips one run loop later, so re-check then — still inside the keyboard's animation, and matching its duration, so the web view grows alongside the keyboard instead of leaving a gap that snaps shut once the keyboard has gone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@yunuschoudhurywork-lang testing this went well. I pushed few commits to this branch during my testing. Screen recording of usage
ScreenRecording_09-16-2026.13-06-36_1.MP4The usage of the native I believe we can proceed forward exploring the Android implementation as discussed in wordpress-mobile/WordPress-Android#23222 (comment). Below are a details summarized by Claude, where I discovered a few issues that we'll need to explore on iOS. Spike result: the native The blocking question from the exploration notes — does native find decoration behave inside Three things to carry forward: 1. Match placement is wrong while the software keyboard is up. WebKit's find scroll path subtracts the keyboard from a viewport GBK has already subtracted it from, so the match parks against the top edge and clips by ~5pt. Measured: −5pt with the keyboard up, vs. 41% down the viewport with it dismissed. Caret scroll-into-view is unaffected, so this is specific to the find path rather than an editor layout bug. CSS 2. "Find Selection" comes free in the text-selection menu, and it's buggy. 3. There are no find-session callbacks. Android is unblocked — the iOS verification that gated it passed. Item 1 is WebKit-specific and shouldn't recur there, but a custom find bar is still required regardless. |
|
@dcalhoun Thanks for the detailed verification and the additional findings. The iOS spike results are clear, and I’ll proceed with the Android exploration as discussed in the WordPress-Android issue, starting with the native I’ll keep the Android work as a decision/behavior spike initially and report the findings before committing to the final native vs. JS approach. |
What?
Adds the initial iOS native Find in Post spike to GutenbergKit by enabling
WKWebView's native Find interaction and exposing apresentFindNavigator()method fromEditorViewController.Why?
This is part of the work for WordPress-Android #23222 ("Find in post").
The editor is shared through GutenbergKit, so the Find behavior should be implemented at the GutenbergKit level rather than separately in the host applications.
This spike is intended to verify whether the native
WKWebViewFind interaction is suitable for Gutenberg'scontenteditableeditor before proceeding with the Android implementation.How?
WKWebView.isFindInteractionEnabled.presentFindNavigator()toEditorViewController, which presents the native iOS Find navigator.Testing Instructions
Runtime testing is still pending.
I am developing on Windows and currently do not have access to a macOS/iOS environment to run the GutenbergKit iOS application.
Once an iOS environment is available, verify:
Accessibility Testing Instructions
Runtime accessibility testing is pending because an iOS/macOS environment is not currently available.
Once available, verify that the native Find navigator can be opened and operated using VoiceOver, including entering a search query, navigating between matches, and dismissing the navigator.
Screenshots or screencast
Not available yet because runtime iOS testing is pending.