Skip to content

refactor: inspection panel improvements#11863

Closed
viktoravelino wants to merge 14 commits intomainfrom
refactor/inspection-panel
Closed

refactor: inspection panel improvements#11863
viktoravelino wants to merge 14 commits intomainfrom
refactor/inspection-panel

Conversation

@viktoravelino
Copy link
Collaborator

@viktoravelino viktoravelino commented Feb 23, 2026

Summary

  • Moved canvas controls panel to bottom-left and added a toggle button for the inspection panel in bottom-right, gated by ENABLE_INSPECTION_PANEL feature flag
  • Removed inspectionPanelVisible coupling from GenericNode — node descriptions and the edit name/description button now render unconditionally regardless of inspector state
  • Reduced inspector panel clutter by filtering out handle-type fields (type === "other"), readonly fields, and fields that already have an incoming connection

Test plan

  • Toggle inspection panel open/closed and verify canvas node descriptions and edit buttons remain visible at all times
  • Open inspector panel on a node with handle-type fields — confirm they do not appear in the panel
  • Connect a field via a handle edge, open inspector — confirm the connected field is hidden; disconnect it and confirm it reappears
Screen.Recording.2026-02-23.at.7.23.59.AM.mov

Summary by CodeRabbit

  • New Features

    • Added inspection panel toggle to canvas controls for flexible visibility management.
  • Improvements

    • Edit controls now permanently visible in node toolbar with updated icons.
    • Connected and readonly input fields automatically filtered from inspection panel.
    • Canvas control elements repositioned for improved UI layout.

@github-actions github-actions bot added the refactor Maintenance tasks and housekeeping label Feb 23, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The pull request refactors canvas controls layout and inspection panel visibility management, relocating controls to bottom-left and adding a right-side inspector toggle. Additionally, the inspection panel now filters out fields with existing incoming connections and removes its dependency from node rendering logic.

Changes

Cohort / File(s) Summary
Node UI Refactoring
src/frontend/src/CustomNodes/GenericNode/index.tsx
Removed inspectionPanelVisible state dependency from edit-name-description button and description rendering. Button now unconditionally renders with dynamic className-based styling; toolbar memoization updated to recompute based on relevant state changes.
Field Filtering Enhancement
src/frontend/src/CustomNodes/helpers/parameter-filtering.ts
Added optional connectedFields parameter to shouldRenderInspectionPanelField(). New guard clauses hide handle-type fields, readonly fields, and fields with existing incoming connections from the inspection panel.
Canvas Controls Layout
src/frontend/src/components/core/canvasControlsComponent/CanvasControls.tsx
Repositioned main controls panel from bottom-right to bottom-left. Added right-side inspector toggle button that controls inspection panel visibility via flow store state. Reorganized control elements with separators; imports updated to include inspector-related utilities.
Inspection Panel Integration
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
Integrated connected field extraction from flow store edges. Computed set of field names with existing connections and propagated through field filtering logic. Updated memoization dependencies to recompute when connections change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 5

❌ Failed checks (1 error, 3 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error PR introduces significant functional changes to GenericNode, CanvasControls, parameter-filtering, and InspectionPanelFields components but includes no corresponding test files. Add test files covering the new parameter-filtering function, CanvasControls inspection toggle, GenericNode rendering, and InspectionPanelFields connected fields logic.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test File Naming And Structure ⚠️ Warning PR modified 4 frontend components with significant logic changes but did not add or update test files despite existing test infrastructure. Add or update test files in established Jest pattern: update CanvasControls.test.tsx and InspectionPanelFields.test.tsx; create parameter-filtering.test.ts and GenericNode tests.
Excessive Mock Usage Warning ⚠️ Warning Test mock for shouldRenderInspectionPanelField doesn't match implementation; missing connectedFields parameter and new filtering logic for handle-type, readonly, and connected fields. Update mock to include connectedFields parameter and filtering logic; add unit tests for handle-type fields, readonly fields, and connected field filtering.
Test Quality And Coverage ❓ Inconclusive Unable to locate test files for the modified components (GenericNode, parameter-filtering.ts, CanvasControls.tsx, InspectionPanelFields.tsx) to assess test coverage and quality. Verify test files exist for modified components and review their coverage of new functionality including filtering logic and state management changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: inspection panel improvements' is partially related to the changeset. While it correctly identifies inspection panel work as a key component, it omits the significant restructuring of canvas controls and removal of inspectionPanelVisible coupling from GenericNode, which together form the main changes.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/inspection-panel

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 19%
18.83% (6108/32424) 12.26% (3103/25293) 12.66% (881/6958)

Unit Test Results

Tests Skipped Failures Errors Time
2310 0 💤 0 ❌ 0 🔥 33.407s ⏱️

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 47.72727% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.41%. Comparing base (5369b63) to head (1cc9366).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
src/frontend/src/CustomNodes/GenericNode/index.tsx 0.00% 8 Missing ⚠️
...ts/core/canvasControlsComponent/CanvasControls.tsx 46.66% 4 Missing and 4 partials ⚠️
...spectionPanel/components/InspectionPanelFields.tsx 81.25% 2 Missing and 1 partial ⚠️
.../pages/FlowPage/components/PageComponent/index.tsx 0.00% 3 Missing ⚠️
...end/src/CustomNodes/helpers/parameter-filtering.ts 0.00% 1 Missing ⚠️

❌ Your project status has failed because the head coverage (41.93%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11863      +/-   ##
==========================================
+ Coverage   35.38%   35.41%   +0.03%     
==========================================
  Files        1527     1527              
  Lines       73484    73506      +22     
  Branches    11041    11048       +7     
==========================================
+ Hits        25999    26033      +34     
+ Misses      46073    46057      -16     
- Partials     1412     1416       +4     
Flag Coverage Δ
backend 56.10% <ø> (+0.10%) ⬆️
frontend 17.02% <47.72%> (+0.03%) ⬆️
lfx 41.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../core/canvasControlsComponent/HelpDropdownView.tsx 100.00% <100.00%> (+4.00%) ⬆️
src/frontend/src/utils/styleUtils.ts 49.12% <ø> (ø)
...end/src/CustomNodes/helpers/parameter-filtering.ts 0.00% <0.00%> (ø)
...spectionPanel/components/InspectionPanelFields.tsx 76.78% <81.25%> (-1.00%) ⬇️
.../pages/FlowPage/components/PageComponent/index.tsx 0.00% <0.00%> (ø)
src/frontend/src/CustomNodes/GenericNode/index.tsx 0.00% <0.00%> (ø)
...ts/core/canvasControlsComponent/CanvasControls.tsx 71.87% <46.66%> (-22.57%) ⬇️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 23, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/frontend/src/CustomNodes/GenericNode/index.tsx (1)

449-465: ⚠️ Potential issue | 🟡 Minor

hasBreakingChange used inside the memo but missing from its dependency array.

isOutdated, isUserEdited, and hasBreakingChange all come from the same componentUpdate destructure. The first two are in the deps, but hasBreakingChange (used at line 406 as hasBreakingChange={hasBreakingChange}) is not. If componentUpdate changes such that only hasBreakingChange flips — without isOutdated or isUserEdited changing — NodeToolbarComponent will receive a stale value.

🐛 Proposed fix
  }, [
    data,
    deleteNode,
    takeSnapshot,
    setNode,
    showNode,
    updateNodeCode,
    isOutdated,
    isUserEdited,
+   hasBreakingChange,
    selected,
    shortcuts,
    editNameDescription,
    hasChangedNodeDescription,
    toggleEditNameDescription,
    selectedNodesCount,
    rightClickedNodeId,
  ]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/src/CustomNodes/GenericNode/index.tsx` around lines 449 - 465,
The memo/effect that builds props for NodeToolbarComponent is missing
hasBreakingChange in its dependency array: add hasBreakingChange (from
componentUpdate destructure) to the dependency list alongside isOutdated and
isUserEdited so that NodeToolbarComponent receives updated hasBreakingChange
values; update the dependency array referenced where NodeToolbarComponent is
rendered (the hook that includes data, deleteNode, takeSnapshot, setNode,
showNode, updateNodeCode, isOutdated, isUserEdited, selected, shortcuts,
editNameDescription, hasChangedNodeDescription, toggleEditNameDescription,
selectedNodesCount, rightClickedNodeId) to include hasBreakingChange.
🧹 Nitpick comments (2)
src/frontend/src/CustomNodes/GenericNode/index.tsx (1)

410-410: -z-10 on a non-positioned <div> has no CSS effect.

Tailwind's z-* utilities only apply to elements with position: relative/absolute/fixed/sticky. This wrapper <div> has none, so z-index: -10 is silently ignored. The button inside correctly uses absolute z-50, which is all that matters for stacking. The wrapper class can be removed to avoid confusion.

♻️ Proposed cleanup
-        <div className="-z-10">
           <Button
             unstyled
             onClick={() => {
               ...
             }}
             ...
           >
             ...
           </Button>
-        </div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/src/CustomNodes/GenericNode/index.tsx` at line 410, Remove the
redundant "-z-10" Tailwind class from the non-positioned wrapper div in the
GenericNode component (index.tsx) because z-index utilities require a positioned
element; locate the wrapper <div> that currently has className="-z-10" and
delete that class (or the wrapper if unused) while keeping the inner button's
absolute z-50 intact to preserve stacking behavior.
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx (1)

27-38: connectedFields memo produces a new Set reference on every edge change anywhere in the flow.

useFlowStore((state) => state.edges) subscribes to the full edge array; its reference changes on every unrelated edge operation. Since connectedFields always constructs a new Set, advancedFields recomputes on every edge mutation in the entire flow — not just ones that touch this node.

Consider scoping the selector to only the edges relevant to this node and using useShallow (or a custom equality function) so the subscription only fires when edges targeting data.id actually change:

♻️ Proposed refactor
-  const edges = useFlowStore((state) => state.edges);
-
-  const connectedFields = useMemo(() => {
-    const fields = new Set<string>();
-    for (const edge of edges) {
-      if (edge.target === data.id) {
-        const fieldName = edge.data?.targetHandle?.fieldName;
-        if (fieldName) fields.add(fieldName);
-      }
-    }
-    return fields;
-  }, [edges, data.id]);
+  // Only re-render when the set of field-names connected to THIS node changes.
+  const connectedFieldNames = useFlowStore(
+    useShallow((state) =>
+      state.edges
+        .filter(
+          (e) => e.target === data.id && e.data?.targetHandle?.fieldName,
+        )
+        .map((e) => e.data!.targetHandle!.fieldName as string),
+    ),
+  );
+
+  const connectedFields = useMemo(
+    () => new Set(connectedFieldNames),
+    [connectedFieldNames],
+  );

useShallow performs a shallow array comparison, so connectedFieldNames only produces a new reference (and triggers a re-render) when the list of connected field names actually changes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx`
around lines 27 - 38, The connectedFields memo is rebuilding on any edge array
change because useFlowStore((state) => state.edges) subscribes to the whole
edges list; change the selector to only subscribe to edges that target this node
(filter by edge.target === data.id and map to
edge.data?.targetHandle?.fieldName), return a stable array of field names (e.g.
connectedFieldNames) and use useShallow (or a custom equality) when selecting
from useFlowStore so the component only re-renders when the actual list of
connected field names for this node changes; update any dependent code that
references connectedFields/advancedFields to use the new connectedFieldNames
selector.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/frontend/src/CustomNodes/GenericNode/index.tsx`:
- Around line 449-465: The memo/effect that builds props for
NodeToolbarComponent is missing hasBreakingChange in its dependency array: add
hasBreakingChange (from componentUpdate destructure) to the dependency list
alongside isOutdated and isUserEdited so that NodeToolbarComponent receives
updated hasBreakingChange values; update the dependency array referenced where
NodeToolbarComponent is rendered (the hook that includes data, deleteNode,
takeSnapshot, setNode, showNode, updateNodeCode, isOutdated, isUserEdited,
selected, shortcuts, editNameDescription, hasChangedNodeDescription,
toggleEditNameDescription, selectedNodesCount, rightClickedNodeId) to include
hasBreakingChange.

---

Nitpick comments:
In `@src/frontend/src/CustomNodes/GenericNode/index.tsx`:
- Line 410: Remove the redundant "-z-10" Tailwind class from the non-positioned
wrapper div in the GenericNode component (index.tsx) because z-index utilities
require a positioned element; locate the wrapper <div> that currently has
className="-z-10" and delete that class (or the wrapper if unused) while keeping
the inner button's absolute z-50 intact to preserve stacking behavior.

In
`@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx`:
- Around line 27-38: The connectedFields memo is rebuilding on any edge array
change because useFlowStore((state) => state.edges) subscribes to the whole
edges list; change the selector to only subscribe to edges that target this node
(filter by edge.target === data.id and map to
edge.data?.targetHandle?.fieldName), return a stable array of field names (e.g.
connectedFieldNames) and use useShallow (or a custom equality) when selecting
from useFlowStore so the component only re-renders when the actual list of
connected field names for this node changes; update any dependent code that
references connectedFields/advancedFields to use the new connectedFieldNames
selector.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0283f5d and 4c3fe34.

📒 Files selected for processing (4)
  • src/frontend/src/CustomNodes/GenericNode/index.tsx
  • src/frontend/src/CustomNodes/helpers/parameter-filtering.ts
  • src/frontend/src/components/core/canvasControlsComponent/CanvasControls.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx

@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 23, 2026
@viktoravelino viktoravelino self-assigned this Feb 23, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 23, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 23, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 23, 2026
@viktoravelino viktoravelino force-pushed the refactor/inspection-panel branch from 8611a7b to 9cfa969 Compare February 23, 2026 15:17
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 23, 2026
@github-actions github-actions bot added the lgtm This PR has been approved by a maintainer label Feb 23, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 24, 2026
viktoravelino and others added 3 commits February 24, 2026 10:08
The toggle button became disabled immediately after closing the panel
because selectedNode was derived from inspectionPanelVisible. Now
selectedNode is based solely on the current node selection, keeping
the toggle enabled as long as a node is selected.
Replace PanelRight/PanelRightClose with SlidersHorizontal to avoid
confusion with the Playground button which uses PanelRightOpen. Add
bg-accent background highlight when the panel is active.
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 24, 2026
Update lucide-react to v0.575.0 and use list-indent-increase/decrease
icons to visually indicate the inspection panel's open/closed state.
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 24, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 24, 2026
@github-actions github-actions bot added refactor Maintenance tasks and housekeeping and removed refactor Maintenance tasks and housekeeping labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor Maintenance tasks and housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants