Repository navigation
fix(web): let Ask AI remove conversations from its history - #516
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
✅ 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.cssoverride..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 thoughAskAiButton.astroappends the DocSearch<link>tags after the page CSS has loaded. The rule is identical toplugins/search-algolia/src/client/style.css:144.docsearch.test.tsregression test. It checks the upstreamdisplay:nonerule and the site override, followingplugins/search-algolia/src/__tests__/style.test.ts.require.resolve("@docsearch/css/dist/style.css")works because@docsearch/css@5.2.0has noexportsmap and is a direct dependency ofpages/. I rannode --experimental-strip-types --test src/**/*.test.tsinpages/and all 3 tests pass.
Assessment: READY. pages/ is private, so no changeset is needed.
claude-opus-5-5 | 𝕏
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
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.astroloads DocSearch's dialog stylesheet (@docsearch/css/dist/style.css) next tosidepanel.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.cssnever shows it again.@docubook/plugin-search-algoliaalready ships an override for this on the docs; the marketing site did not.Fix
pages/src/styles/global.css: show.DocSearch-Hit-action-buttonagain inside.DocSearch-Sidepanel-RecentConversation, the same rule the plugin uses.pages/src/styles/docsearch.test.ts: pins both the upstreamdisplay:nonerule 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 inlocalStorage, open Ask AI, go to Conversation history, click ✕ on the first row.display: none, click fails, 2 conversations staydisplay: none, click fails, 2 conversations stayastro sync && tsc --noEmit, oxlint, prettier andpnpm testinpages/pass.