Skip to content

fix(search-algolia): make ask ai fullscreen below 1024px - #502

Merged
gitfromwildan merged 2 commits into
mainfrom
fix/algolia-ask-ai-fullscreen
Nov 7, 2026
Merged

gitfromwildan merged 2 commits into
mainfrom
fix/algolia-ask-ai-fullscreen

Conversation

@gitfromwildan

@gitfromwildan gitfromwildan commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Ask AI previously switched to a narrow side panel at 769px, leaving tablet layouts below Flame's desktop breakpoint. Make the panel fill the viewport below 1024px for floating/inline variants on either side, including configured widths. Remove the outer inset and rounded corners, hide the expand action while fullscreen, and prevent background scrolling. Add regression tests that pin the upstream desktop rules, selector specificity and source order assumptions, and the fullscreen geometry, expand action, and scroll lock. Includes a patch changeset for @docubook/plugin-search-algolia.

Verification

  • Plugin production build, lint, typecheck, and Prettier: passed.
  • Plugin test suite: 39 tests passed across four files.
  • Real bundled client in Chromium: floating/inline × left/right at 390, 768, 769, 1023, 1024, and 1280px (24 layout checks).
  • Below 1024px: viewport width/height, zero inset/radius, hidden expand action, and locked background scrolling confirmed. At 1024px and above, the configured expanded desktop width and variant geometry apply.
  • Draft input, accessible close button, reopening, Escape, and scroll restoration: passed; no browser errors. Screenshots inspected at 390, 1023, and 1280px.
  • Pre-push workspace lint, build (7 tasks), and commitlint: passed.
  • Temporary local server and browser closed after verification.

Agent Context

  • owner/repo: DocuBook/docubook
  • branch: fix/algolia-ask-ai-fullscreen | base: main
  • created-by: Codex
  • commits: 63bfb9e, 90b515b
  • evidence-ref: local /tmp/algolia-fullscreen-build.log, /tmp/algolia-fullscreen-check.mjs, /tmp/algolia-fullscreen-push.log, /tmp/algolia-fullscreen-tests-push.log

@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Preview Nov 7, 2026 11:54am UTC

@gitfromwildan gitfromwildan self-assigned this Nov 7, 2026
pullfrog[bot]
pullfrog Bot previously approved these changes Nov 7, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No blocking issues found. Mode: standard. Verdict: ready to merge.

Reviewed changes

I checked the CSS-only Ask AI fullscreen fix against the installed upstream @docsearch/css sidepanel.css and @docsearch/sidepanel-js sources.

  • Fullscreen panel below 1024px — The selector .DocSearch-Sidepanel-Container:is(.floating, .inline):is(.side-left, .side-right) has specificity 0,3,0. That ties with upstream's .floating.side-right / .inline.side-left rules, and this one wins because it comes after the @import. The panel width comes from the inline --sp-width variable rather than an inline width, so width: 100% also overrides custom and is-expanded widths.
  • Expand action hidden — Upstream turns the expand button back on with display:flex at width>=769px (0,1,0). The later 0,1,0 rule here hides it again.
  • Background scroll lock — overflow: hidden on html/body via :has(.is-open) closes the 769–1023px gap. Upstream's width<=768px lock already covers smaller screens.
  • Changeset — Patch bump for the unlinked @docubook/plugin-search-algolia, as expected.

ℹ️ No regression test for the <1024px override

The fix only works because the selector ties upstream's specificity and comes later in source order, and because the breakpoints line up with upstream's 769px desktop rules. A future @docsearch/css bump could change either one without anyone noticing. src/__tests__/style.test.ts already pins plugin CSS against upstream this way, and the standing rule is "bug fix → regression test". This is optional and not blocking.

Technical details
# Pin the Ask AI fullscreen override in style.test.ts

## Affected sites
- plugins/search-algolia/src/__tests__/style.test.ts — add a case next to the remove-conversation one
- plugins/search-algolia/src/client/style.css:79-96 — the block to pin

## Required outcome
- Assert upstream `sidepanel.css` still applies `width:var(--sp-width)` under a `width>=769px` media query and shows `.DocSearch-Sidepanel-Action-expand` there.
- Assert the plugin CSS has the `@media (width < 1024px)` block with `width: 100%` and hides `.DocSearch-Sidepanel-Action-expand`.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found. Mode: standard. Verdict: ready to merge.

Reviewed changes

Since the last review, one commit was added. It contains only tests, and they pin the <1024px override against upstream @docsearch/css. That resolves the optional regression-test suggestion from the earlier review.

  • Upstream desktop rules pinned — The new test collects every @media screen and (width>=769px) block in the installed sidepanel.css. There are 9 blocks, and the regex handles their single level of nesting. It then checks three things inside those blocks: width: var(--sp-width), all four .{floating,inline}.side-{left,right} selectors, and the display: flex rule for the expand action. If a future @docsearch/css bump moves the breakpoint or changes specificity, this test will fail.
  • Plugin override pinned — A second test checks that the @media (width < 1024px) block comes after the sidepanel.css @import, so it still wins on source order. It also checks that the block keeps the :is() geometry rule, the rule hiding the expand action, and the html/body scroll lock.
  • Local verification — vitest run src/__tests__/style.test.ts passes all 3 tests.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan
gitfromwildan merged commit 4f552ef into main Nov 7, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the fix/algolia-ask-ai-fullscreen branch November 7, 2026 11:57
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