fix(citation-panel): reset expanded state when chunkId changes

CitationPanelContent uses a single instance across different citations
(RightPanel.tsx:251 renders without a key), so when the user clicks a
new citation while the panel is open, the prior expanded state leaks
into the new citation. The reset effect had an empty dependency array,
so it only fired on mount.

Add chunkId to the effect deps so the expanded state resets each time
the citation changes.
This commit is contained in:
Matt Van Horn 2026-05-17 22:35:51 -07:00
parent 8fc4b98593
commit 047871c47a
No known key found for this signature in database

View file

@ -32,7 +32,7 @@ export const CitationPanelContent: FC<CitationPanelContentProps> = ({ chunkId, o
useEffect(() => {
setExpanded(false);
}, []);
}, [chunkId]);
const chunkWindow = expanded ? EXPANDED_CHUNK_WINDOW : DEFAULT_CHUNK_WINDOW;