fix: react key warnings from duplicate message IDs + establish jest testing framework (#655)

* fix: resolve issue #588 - react key warnings from duplicate message IDs + establish jest testing framework

* Update the makefile and workflow with the js test

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Willem Jiang
2025-10-25 20:46:43 +08:00
committed by GitHub
parent f2be4d6af1
commit 1d71f8910e
15 changed files with 4067 additions and 91 deletions
@@ -43,7 +43,7 @@ import {
useLastFeedbackMessageId,
useLastInterruptMessage,
useMessage,
useMessageIds,
useRenderableMessageIds,
useResearchMessage,
useStore,
} from "~/core/store";
@@ -63,7 +63,8 @@ export function MessageListView({
) => void;
}) {
const scrollContainerRef = useRef<ScrollContainerRef>(null);
const messageIds = useMessageIds();
// Use renderable message IDs to avoid React key warnings from duplicate or non-rendering messages
const messageIds = useRenderableMessageIds();
const interruptMessage = useLastInterruptMessage();
const waitingForFeedbackMessageId = useLastFeedbackMessageId();
const responding = useStore((state) => state.responding);