Matt Gilman created NIFI-16447:
----------------------------------

             Summary: Give the reusable canvas one visibility pass, one 
selection gate, and one preview flag
                 Key: NIFI-16447
                 URL: https://issues.apache.org/jira/browse/NIFI-16447
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Core UI
            Reporter: Matt Gilman
            Assignee: Matt Gilman


h2. Background

The reusable canvas renderers do not share one contract for visibility, 
selection, or the processor Preview badge.

The canvas classifies visible, entering, and leaving components in 
updateCanvasVisibility, then each layer calls Renderer.pan() to refresh only 
those components. Click and double-click handlers are often attached only when 
canSelect is already true at render time, so a later editing change does not 
affect an existing element until something renders it again. The processor 
Preview badge is decided inside ProcessorRenderer.isPreviewProcessor during 
update, while ProcessorUiState.preview is left unset.

Upcoming troubleshooting work enables canvas editing on an already mounted 
canvas, builds context menus and an operation panel from the current selection, 
and aligns components from their visual bounds. Those features need one place 
to classify visibility, one place to read canSelect and canEdit, and one 
stamped preview flag.

h2. Goals

* Classify visibility inside each renderer during its normal update.
* Attach pointer handlers once and read canSelect and canEdit when the event 
fires.
* Stamp ui.preview where processor data is produced, and have the processor 
renderer read that flag.
* Preserve the current rendered appearance and interaction results.
* Leave troubleshooting features to their existing tickets.

h2. Scope

h3. Visibility

* Move viewport classification out of CanvasComponent.updateCanvasVisibility 
and into each renderer update.
* Apply this to the funnel, label, port, processor, process-group, 
remote-process-group, and connection renderers.
* Remove Renderer.pan() and the layer pan() methods that exist only to refresh 
entering and leaving components.
* Keep off-screen components from drawing their details, and keep entering and 
leaving transitions.

h3. Selection and edit gating

* Attach click and double-click handlers when an element enters, including 
connection bend and endpoint handlers.
* Read getCanSelect() and getCanEdit() inside the handler.
* Do not skip attaching a handler because canSelect was false on the render 
that created the element.
* Keep drag behavior on the same fire-time gate.

h3. Preview badge

* Stamp ui.preview when processors are mapped and when a same-id processor 
refresh arrives.
* Stamp the same flag on processor selection targets so an operation panel can 
read it without joining canvas wrappers.
* Match a readable processor whose type and bundle group, artifact, and version 
are in the Preview-tagged extension list.
* Change the processor renderer to show the badge only when ui.preview is true.
* Remove the render-time preview lookup.

h2. Out of Scope

* Adding troubleshooting commands, banners, route guards, alignment, provenance 
replay, or Controller Service editing.
* Migrating the legacy flow-designer canvas.
* Changing REST payloads or rendered appearance.
* Rewriting connection bend and endpoint behavior beyond the shared handler and 
gating contract.

h2. Acceptance Criteria

* No renderer exposes pan(), and the canvas no longer classifies visibility for 
the renderers.
* Each renderer sets visible, entering, and leaving during its own update.
* A canSelect or canEdit change takes effect on the next event without waiting 
for handlers to be reattached.
* The processor renderer reads ui.preview and does not match the extension list 
itself.
* The same preview match feeds the canvas wrapper and the processor selection 
target.
* Off-screen detail suppression, badge placement, and selection behavior remain 
unchanged.
* Frontend lint, unit tests, and the reusable-canvas specs pass.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to