ENG-1596. ENG-1597, ENG-1598: Display, multi-select, and copy extracted nodes#964
ENG-1596. ENG-1597, ENG-1598: Display, multi-select, and copy extracted nodes#964
Conversation
Replaces the skeleton's hardcoded SAMPLE_NODES + fixed EXPANDED_INDICES with a props-driven MainContent. Accepts ExtractedNode[], derives the filter tabs from the actual nodes, wires per-row expand/collapse, wires the type-filter tabs, and renders an empty state when no nodes.
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| useEffect(() => { | ||
| setSelected(new Set()); | ||
| }, [nodes]); |
There was a problem hiding this comment.
🟡 Stale expandedNodes and activeFilter state when nodes prop changes
When the nodes prop changes (e.g., user runs a new extraction), the useEffect at MainContent.tsx:43-45 resets only selected but does not reset expandedNodes or activeFilter. This causes two problems: (1) nodes in the new result set will appear pre-expanded if they share indices with previously expanded nodes from a different extraction, and (2) if activeFilter was set to a node type (e.g., "pattern") that doesn't exist in the new results, the user sees an empty filtered list with no obvious explanation.
| useEffect(() => { | |
| setSelected(new Set()); | |
| }, [nodes]); | |
| useEffect(() => { | |
| setSelected(new Set()); | |
| setExpandedNodes(new Set()); | |
| setActiveFilter("all"); | |
| }, [nodes]); |
Was this helpful? React with 👍 or 👎 to provide feedback.
Doing all 3 issues in a single PR because the surface area that these 3 contain is mostly the same. The code is not hard to review and there is no scope creep in it.