MCPcopy Create free account
hub / github.com/Noumena-Network/code / expandKey

Function expandKey

src/components/Messages.tsx:399–401  ·  view source on GitHub ↗

Key for click-to-expand: tool_use_id where available (so tool_use + its * tool_result expand together), else uuid for groups/thinking.

(msg: RenderableMessage)

Source from the content-addressed store, hash-verified

397/** Key for click-to-expand: tool_use_id where available (so tool_use + its
398 * tool_result expand together), else uuid for groups/thinking. */
399function expandKey(msg: RenderableMessage): string {
400 return (msg.type === 'assistant' || msg.type === 'user' ? getToolUseID(msg) : null) ?? msg.uuid;
401}
402
403// Custom comparator to prevent unnecessary re-renders during streaming.
404// Default React.memo does shallow comparison which fails when:

Callers 1

MessagesImplFunction · 0.85

Calls 1

getToolUseIDFunction · 0.85

Tested by

no test coverage detected