Skip to content

fix(plugins): show the remove button in the ask ai conversation history - #487

Merged
gitfromwildan merged 1 commit into
mainfrom
fix/algolia-history-remove-button
Nov 6, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
fix/algolia-history-remove-button

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Summary

In Ask AI's conversation history (⋮ → Conversation history), the remove (×) button next to each conversation never showed, so a stored conversation could not be removed. The button is now visible and works.

Cause

  • @docsearch/sidepanel-js 5.2.0 renders the remove button with the search dialog's class, .DocSearch-Hit-action-button.
  • The dialog stylesheet (@docsearch/css/dist/style.css) hides that class with display: none. It only shows the button inside a selected search hit, .DocSearch-Hit[aria-selected=true].
  • sidepanel.css never styles the class. So the button shows when the Sidepanel is used on its own, but this plugin loads both stylesheets for its two surfaces, and the dialog rule hides it.

The removal logic itself works. conversations.remove() filters the item and writes __DOCSEARCH_ASKAI_CONVERSATIONS__<appId> to localStorage. The click just never reached it.

Fix

  • src/client/style.css shows .DocSearch-Hit-action-button inside .DocSearch-Sidepanel-RecentConversation. With specificity 0,2,0 this rule outranks the dialog's 0,1,0, and it does not affect the dialog.
  • I checked every dialog class the Sidepanel renders against the dialog stylesheet's display: none rules. This is the only one affected.
  • src/__tests__/style.test.ts checks both sides: the upstream rule that hides the button, so a DocSearch upgrade that changes it gets noticed, and the plugin rule that shows it. The test fails on main.
  • Changeset: @docubook/plugin-search-algolia patch, 0.1.2.

Verification

  • Reproduced and fixed in headless Chromium.

    • Setup: the docs site built from main, with 3 conversations seeded in localStorage. Steps: Ask AI → ⋮ → Conversation history → click × on the first conversation.
    • docs-old is assets/docsearch/ as published in 0.1.0. docs-new is the same build with this branch's dist/client copied over it, which is what the plugin's onEnd copies.
    × button After clicking × After reload
    0.1.0 display: none, cannot be clicked 3 conversations 3 stored
    this branch display: block, 22×22 px 2 conversations, history screen stays open conv-2, conv-3 stored

    A screenshot of the new version shows × on every row, accented on hover.

  • Checks. Plugin tests (37, including the new one), tsc --noEmit, oxlint, the plugin build (the rule is in dist/client/style.css), the pre-push hooks and scripts/check-release-plan.mjs (6 scenarios) pass.

After merge

The release workflow adds @docubook/plugin-search-algolia 0.1.2 to the Release PR. The docs site pulls the plugin from npm (^0.1.0), so it gets the fix on the next lockfile update after 0.1.2 is published.

@vercel

vercel Bot commented Nov 6, 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 6, 2026 6:21am 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

This run reviewed the CSS fix that unhides the Ask AI conversation-history remove (×) button, plus its regression test and changeset. Mode: standard. Verdict: READY.

  • Scoped show rule in style.css: .DocSearch-Sidepanel-RecentConversation .DocSearch-Hit-action-button { display: block; } (0,2,0) beats the display:none base rule from @docsearch/[email protected] dist/style.css (0,1,0). I checked this against the installed package. The rule only applies inside the sidepanel row, so the dialog still shows the button only when a hit is selected. ConversationHistoryScreen in @docsearch/sidepanel-js is the only place the sidepanel uses that class, which agrees with the PR's audit.
  • Regression test style.test.ts: asserts both the upstream hide rule (it matches the minified 5.2.0 output) and the plugin's override. @docsearch/css is a direct devDependency, so the node_modules path resolves under pnpm.
  • Changeset: patch for @docubook/plugin-search-algolia only. The plugin is not in the linked set, so no other package versions.

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

@gitfromwildan gitfromwildan self-assigned this Nov 6, 2026
The Sidepanel renders each stored conversation with a remove button that reuses the search dialog's .DocSearch-Hit-action-button class. The dialog stylesheet (@docsearch/css style.css) hides that class with display:none and shows it only inside .DocSearch-Hit[aria-selected=true], and sidepanel.css never styles it. The plugin loads both stylesheets, so the button stayed hidden and a conversation could not be removed from the history.

The plugin's stylesheet now shows .DocSearch-Hit-action-button inside .DocSearch-Sidepanel-RecentConversation. It is the only dialog class the Sidepanel reuses that the dialog stylesheet hides. A test checks both the upstream rule that hides the button and the plugin rule that shows it.
@gitfromwildan
gitfromwildan force-pushed the fix/algolia-history-remove-button branch from 6712bbb to 652cbc1 Compare November 6, 2026 06:21
@gitfromwildan
gitfromwildan merged commit b5a3310 into main Nov 6, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the fix/algolia-history-remove-button branch November 6, 2026 06:23
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