Skip to content

Cleanup: remove dead pv_edit_click_selection handler and click binding #36

Description

@pcolt

Overview

pv_edit_click_selection is registered as a ctrl.add handler and wired to the click event of VtkRemoteLocalView in ui.py, but it is never called in practice.

Why it is dead

The JS component only emits the click event when pickingModes.includes("click"):

// trame-vtk.js
function D(M) {
    t.pickingModes.includes("click") && e("click", { ... })
}

edit_picking_modes is set to ["select"] (never ["click"]) in paraview_runtime.py, so the JS never fires click. Instead, the rubber-band selection interactor (enabled when "select" is in pickingModes) handles all mouse button-1 events — including single clicks, which arrive as a zero-area BoxSelection event. pv_edit_box_selection detects the zero-area case with is_click_rect and routes it to _pick_edit_ids_at_coords, the same pick path pv_edit_click_selection would have used.

What to remove

  • paraview_controllers.py: pv_edit_click_selection handler (the ctrl.add block)
  • ui.py: the click=(ctrl.pv_edit_click_selection, "[$event]") kwarg on VtkRemoteLocalView

Notes

  • pv_edit_box_selection with is_click_rect already handles single clicks correctly — no behavioural change.
  • normalize_edit_selection_ids (used only inside pv_edit_click_selection) handles a different payload format (composite cell IDs from interactor events) that is no longer sent; it can be reviewed for removal in the same pass if nothing else calls it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions