Skip to content

fix(web): let Ask AI remove conversations from its history - #516

Merged
gitfromwildan merged 1 commit into
mainfrom
fix/web-ask-ai-remove-conversation
Nov 10, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
fix/web-ask-ai-remove-conversation

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Summary

On docubook.pro, the Ask AI panel's conversation history had no working remove control: the ✕ "Remove conversation from history" button never showed, so a saved conversation could not be removed.

Cause

AskAiButton.astro loads DocSearch's dialog stylesheet (@docsearch/css/dist/style.css) next to sidepanel.css. The dialog stylesheet hides .DocSearch-Hit-action-button (display:none) outside a selected search hit, and the side panel's history rows reuse that button for removal. sidepanel.css never shows it again. @docubook/plugin-search-algolia already ships an override for this on the docs; the marketing site did not.

Fix

  • pages/src/styles/global.css: show .DocSearch-Hit-action-button again inside .DocSearch-Sidepanel-RecentConversation, the same rule the plugin uses.
  • pages/src/styles/docsearch.test.ts: pins both the upstream display:none rule and the site override, so a DocSearch upgrade that changes either side fails the test. It fails without the CSS change and passes with it.

Verification

Browser repro against a local build (astro build + astro preview): seed two conversations in localStorage, open Ask AI, go to Conversation history, click ✕ on the first row.

Viewport Before After
Desktop 1440×900 (history via header menu) button display: none, click fails, 2 conversations stay button visible, 1 row and 1 stored conversation left
Mobile 390×844 (Ask AI via the drawer) button display: none, click fails, 2 conversations stay button visible, 1 row and 1 stored conversation left

astro sync && tsc --noEmit, oxlint, prettier and pnpm test in pages/ pass.

The Ask AI panel on the site loads DocSearch's dialog stylesheet next to
sidepanel.css. The dialog stylesheet hides .DocSearch-Hit-action-button
outside a selected search hit, and the conversation history reuses that
button for "Remove conversation from history", so the remove control
never showed and a conversation could not be removed. Show the button
again inside history rows, the same override the Algolia plugin ships,
and add a test that pins both the upstream rule and the override.
@vercel

vercel Bot commented Nov 10, 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 Nov 10, 2026 1:26am UTC

@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.

Reviewed changes

Mode: standard. I reviewed the site-only CSS override that brings back the Ask AI conversation-history remove button, along with its regression test.

  • global.css override. .DocSearch-Sidepanel-RecentConversation .DocSearch-Hit-action-button { display: block; } is unlayered and has specificity (0,2,0). That beats upstream's .DocSearch-Hit-action-button{…display:none} at (0,1,0). So the override still wins even though AskAiButton.astro appends the DocSearch <link> tags after the page CSS has loaded. The rule is identical to plugins/search-algolia/src/client/style.css:144.
  • docsearch.test.ts regression test. It checks the upstream display:none rule and the site override, following plugins/search-algolia/src/__tests__/style.test.ts. require.resolve("@docsearch/css/dist/style.css") works because @docsearch/css@5.2.0 has no exports map and is a direct dependency of pages/. I ran node --experimental-strip-types --test src/**/*.test.ts in pages/ and all 3 tests pass.

Assessment: READY. pages/ is private, so no changeset is needed.

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

@gitfromwildan gitfromwildan self-assigned this Nov 10, 2026
@gitfromwildan
gitfromwildan merged commit cd8f333 into main Nov 10, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the fix/web-ask-ai-remove-conversation branch November 10, 2026 01:31
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