Mobile SFC buffer: auto-open and pre-fill destination#43
Open
jackinabox86 wants to merge 11 commits into
Open
Conversation
Previously OPEN_SFC paused and asked the user to open the SFC buffer manually. Now it: - Opens the SFC buffer automatically in the background via a new openTileSilent context function (no user ACT required to open) - Pre-fills the destination planet using the AddressSelector with autosuggest click, matching the refined-prun desktop flow - Restores #container visibility via showMobileBufferContents() so the buffer is visible in APEX once the user switches views - Logs a clear instruction and waits for ACT after the automation BurnActView and RepairActView gain a Show APEX button alongside ACT when the runner is waiting, so the user can switch to APEX view to see the pre-filled SFC buffer, take flight, return via FloatingReturn, and tap ACT to resume. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
The previous attempt added openTileSilent/openBufferSilent to bypass the waitAct gate in requestBuffer. This failed because openMobileBuffer can't reliably navigate out of the hidden MTRA buffer without the DOM-settle time that waitAct provides. OPEN_SFC now uses requestTile (the same proven path as MTRA_TRANSFER): user taps ACT once, then the runner opens the SFC buffer automatically. After the buffer is open, the destination planet is filled automatically using character-by-character keyboard simulation (matching the pattern in selectMaterial/cont-utils.ts) and the first autosuggest entry is clicked. showMobileBufferContents() leaves the buffer visible in APEX. The final waitAct prompt directs the user to tap Show APEX (already in the header), take flight, and return to APXM to tap ACT. Also removes the redundant Show APEX button that was added to the BurnActView and RepairActView action runner controls — it already exists in the APXM header on every page. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
…back-navigation Previous attempt made #container visible before typing (to satisfy WebKit's focus/keyboard restriction). This allowed keyboard events dispatched to the AddressSelector input to bubble up into APEX's navigation handlers, causing the SFC buffer to navigate back to the card list. Fix: use setInputValue (native-setter + 'input' event) while the buffer stays hidden. The console confirmed that APEX's autocomplete fires on the 'input-changed' handler triggered by the 'input' event, so the autocomplete still runs. Programmatic .click() on the suggestion element works even when the container is hidden — WebKit only blocks focus and keyboard events on hidden/off-screen elements, not mouse click dispatches. Also removes the now-unused focusElement import. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
…arch setInputValue triggers the autocomplete fetch but not the DOM render of the dropdown — the keydown/keyup keyboard simulation is required for APEX to actually show suggestion entries (confirmed: char-by-char → height error indicates dropdown rendered; setInputValue → no height error, no render). Suggestion matching now uses text-content search (querySelectorAll li / [role=option] with textContent.includes) instead of C.AddressSelector. suggestionContent, whose CSS class name is unknown and returns nothing. This mirrors how selectMaterial in cont-utils.ts matches entries by the text of C.ColoredIcon.label, but without depending on a specific class. Buffer is made visible before typing (same pattern as selectMaterial) to satisfy WebKit's requirement for focus and keyboard events. Restored to off-screen after suggestion click, then revealed via showMobileBufferContents. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
…lose An exception thrown during char-by-char typing or suggestion clicking was propagating to the step-machine's outer try-catch, which called stop() → closeMobileBuffer(), closing the SFC buffer before the user tapped ACT. The destination fill is now best-effort: any exception logs a warning and the runner proceeds to showMobileBufferContents() and waitAct() so the buffer stays open for the user to tap Show APEX. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
Two 'star graph initialized' entries suggest APEX navigates to a destination-picker view when the AddressSelector input is focused. After focus, we re-query all visible AddressSelector inputs from document.body so we type into the live picker input, not the stale SFC-form reference. Diagnostic console.log calls added at every key milestone so the exact failure point can be identified from browser console output. Pre-existing li/option elements are tracked so star-graph nodes are deprioritized in the suggestion search. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
…n nav After clicking the address suggestion, restoring #container to left:-9999px triggered APEX's CSS transition listener which interpreted the slide-out as a navigation event and rendered the buffer list before showMobileBufferContents() could restore it. Removing the redundant restore fixes this — showMobileBufferContents() directly sets the final visible state. Also uses C.AddressSelector.suggestion (now confirmed from debug log) for precise suggestion matching instead of generic li/[role=option]. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
The -9999px/visibility:hidden hiding in openMobileBuffer was redundant (APXM overlays APEX during all ACT runner steps) and harmful: APEX watches for CSS transition events on #container and interprets the slide-out as a navigation, rendering the buffer list instead of the open buffer. - openMobileBuffer: drop applyRefreshHide (step 3) and savedStyles - closeMobileBuffer: drop restoreContainerStyles (nothing to restore) - showMobileBufferContents: kept as a documented no-op for clarity - OPEN_SFC: remove visibility manipulation; type destination but do not click the suggestion (programmatic clicks navigate away on mobile APEX); user taps the suggestion themselves via Show APEX - Tests updated to match the new no-hide contract https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
Setting marginTop/height on #container when Show APEX was tapped triggered APEX's layout listeners (ResizeObserver etc.) which navigated the buffer stack to the buffer list — the root cause of every 'buffer closed after Show APEX' report. FloatingReturn is already position:fixed in the shadow DOM so it overlays APEX correctly with no layout changes to #container needed. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
findBufferForm now matches FormComponent__containerActive only — buffer-list cards render as Passive and were causing a false positive that made openMobileBuffer return before the SFC buffer form loaded. Diagnostic logs added to show whether we reach the SFC buffer form level and whether the form is still active when waitAct is called. https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ
…back When the user taps "Show APEX", the shadow-DOM button receives focus, causing APEX's AddressSelector input (still focused from our typing) to fire a blur event. On mobile APEX, this blur closes the suggestion dropdown and triggers navigation back to the buffer card list. Fix: explicitly blur the input after typing is complete (and the suggestion is detected), then sleep 200ms to let APEX settle before calling waitAct. By the time the user taps Show APEX, no element in APEX has focus, so no blur-triggered navigation occurs. Also remove height:0 from :host(.apex-visible) — collapsing the fixed shadow host height was firing a resize event that APEX used to navigate to the buffer list (belt-and-suspenders fix alongside the blur fix).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the OPEN_SFC action step to fully automate buffer opening and destination pre-filling on mobile, eliminating the manual user prompt. The navigator no longer hides #container during buffer navigation, preventing APEX layout listener triggers that would cause unwanted stack navigation.
Key Changes
OPEN_SFC automation: Replaced manual
waitActprompt with automaticrequestTilebuffer open, char-by-char destination typing to populate the AddressSelector dropdown, and a finalwaitActonly for the user to tap the suggestion and complete the flight.Navigator: remove #container hiding: Deleted
saveContainerStyles,applyRefreshHide, andrestoreContainerStylescalls. #container now stays at its natural position throughout buffer navigation. APXM's overlay already covers APEX, so hiding is redundant and harmful—it triggers APEX's ResizeObserver and CSS transition listeners which interpret the slide-out as a navigation event.Destination pre-fill strategy:
showMobileBufferContents() shim: Converted to a no-op function kept for call-site compatibility. Previously made #container visible after off-screen navigation; now unnecessary since the navigator never hides the container.
App.tsx cleanup: Removed the
useEffectthat managed #container display/margin/height when toggling APEX visibility. FloatingReturn is position:fixed in the shadow DOM and overlays correctly without layout changes to the underlying APEX container.Test updates: Updated mobile-buffer-navigator tests to verify #container is NOT hidden and styles are not modified during buffer open/close.
Implementation Details
waitForElementwith a 2-second timeout to detect the suggestion dropdown, searching both the autosuggest portal and document.body for matching suggestions.https://claude.ai/code/session_01TpdDr72qyvk6rC5124r6YJ