Skip to content

fix(ask-ai): add mobile close control and repeatable cloud startup - #7950

Merged
jstirnaman merged 5 commits into
masterfrom
fix/mobile-ask-ai-close
Oct 28, 2026
Merged

jstirnaman merged 5 commits into
masterfrom
fix/mobile-ask-ai-close

Conversation

@jstirnaman

@jstirnaman jstirnaman commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Add one site-owned close button to the fullscreen Ask AI header at widths up to 600px. Use icon-remove, a 44×44px touch target, safe-area spacing, reserved header space, and visible keyboard focus. Use the short heading “Ask AI” at every viewport width to avoid truncation in both fullscreen and sidebar layouts.

The adapter restores the button after widget rerenders and cleans up its listener and styles on disposal. The button calls Kapa.close() and leaves state, navigation, and focus restoration to onModalClose. Suppress the vendor close control only on mobile.

Make browser startup repeatable in the OpenAI cloud scripts. Default Cypress configuration to a writable cache directory, check Xvfb before installation work, and add kapa-live.sh to run headed Chromium on an owned virtual display. Fix live-spec discovery in the general npm command. Document the remaining Edit Environment steps in tools/cloud-environment/openai/README.md.

Why

Mobile readers need a persistent way to return to the article. Verification also needs reproducible startup instead of shell-local settings and a display left running by another command.

Impact

Preserve conversation history, desktop controls, and fullscreen breakpoints. Cloud defaults remain in the cloud scripts; explicit configuration overrides and proxy/CA settings are preserved. System package installation, sandbox grants, and environment publishing remain explicit Edit Environment operations.

Verification

  • TypeScript build, both adapter tests, and all 15 affected Cypress tests passed.
  • Headed live mobile checks passed both tests during diagnosis, including completed answers, long-message scrolling, history after reopening, both themes, and 390px/600px/601px widths.
  • Seven cloud setup tests, Bash syntax checks, ShellCheck 0.10.0, formatting, and commit hooks passed.
  • The new cloud wrapper passed readiness checks, launched its own display, passed the close/resize test, and completed a real answer. Its repeated history test failed because the full-text assertion includes a changing vendor “Thinking for…” status label. The assertion is unchanged.
  • The changed-file verifier ran and deferred these unsupported paths.

Remaining limits:

  • Headless Kapa requests returned Captcha token is invalid; headed mode worked but cannot guarantee CAPTCHA acceptance in every session.
  • The older live sidebar suite has existing desktop geometry failures. Desktop layout styles and that spec are unchanged.
  • The strict page smoke check reports optional analytics hosts blocked by network policy.
  • System installation and restoration from a newly published environment still require an Edit Environment session.

Run the cloud mobile verification against a ready preview with:

bash tools/cloud-environment/openai/kapa-live.sh --spec cypress/live/kapa-mobile-close-live.cy.js

Checklist

  • Signed the InfluxData CLA, if necessary
  • Rebased/mergeable
  • Local full build passes (npx hugo --quiet)

The affected article rendered successfully in the local Hugo preview. Remaining test and environment limitations are documented above.

What changed: Add one site-owned close button at widths up to 600px,
using icon-remove with a 44px touch target, safe-area spacing, and
keyboard focus styling. Reinsert it after widget rerenders and clean up
its listener and styles when the adapter is disposed.

Why: Mobile readers need a persistent way to return to the article.

Impact: Route closing through Kapa.close() and the existing onModalClose
handler so conversation history and launcher focus are preserved. Hide
the vendor close control only on mobile and preserve desktop controls.

Verification: TypeScript build, both adapter tests, and all 15 affected
Cypress tests passed. Live close, contrast, focus restoration, and resize
checks passed at 390px, 600px, and 601px in both themes. Confirmed the
shared icon font renders in fresh screenshots. The changed-file verifier
deferred these file types. Kapa returned HTTP 403 for answers, blocking
completed-answer and long-conversation checks. Existing desktop live
layout assertions and the analytics smoke check also failed.
@jstirnaman
jstirnaman marked this pull request as ready for review October 28, 2026 02:31
@jstirnaman
jstirnaman requested a review from a team as a code owner October 28, 2026 02:31
@jstirnaman
jstirnaman requested review from sanderson and removed request for a team October 28, 2026 02:31
What changed: Configure the mobile widget title as Ask AI and assert the title at the 600px breakpoint.

Why: Keep the heading readable beside the mobile close control.

Impact: Preserve the InfluxDB Ask AI title above 600px and update the title when the open widget resizes.

Verification: TypeScript build and both adapter tests passed. The changed-file verifier deferred these file types. Browser verification was not completed for this follow-up.
What changed: Default cloud Cypress configuration to a writable cache
location, check Xvfb before setup work, and add a headed live-test wrapper
that creates and cleans up its own virtual display. Fix live-spec discovery
in the general npm command. Document the Edit Environment steps needed to
install system packages, retain certificate permissions, and publish.

Why: Browser verification depended on shell-local config and a display
left running by an earlier command.

Impact: Cloud defaults remain isolated in the OpenAI environment scripts.
Explicit config overrides and proxy/CA settings are preserved. The general
live command discovers both Kapa specs without requiring cloud settings.

Verification: Seven setup tests, Bash syntax checks, ShellCheck 0.10.0,
and formatting passed. The changed-file verifier deferred these paths.
The new wrapper passed readiness and the live close/resize test, and
completed a real answer. The history test then failed because its full-text
comparison includes a changing vendor Thinking status label. No test
assertions were weakened. Fresh published-environment restoration still
requires an Edit Environment session.
@jstirnaman jstirnaman changed the title fix(ask-ai): add a persistent mobile close button fix(ask-ai): add mobile close control and repeatable cloud startup Oct 28, 2026
What changed: Configure Ask AI as the shared widget title and update the live title assertion.

Why: The full title also truncates in the desktop sidebar.

Impact: Remove the viewport-specific title override while preserving widget sizing and controls.

Verification: TypeScript build passed. Changed-file verification deferred these file types.
@jstirnaman
jstirnaman merged commit c3a3cac into master Oct 28, 2026
21 checks passed
@jstirnaman
jstirnaman deleted the fix/mobile-ask-ai-close branch October 28, 2026 17:40
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