Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ Before opening a PR, check [TODO.md](TODO.md) for related open items to update o
- `runtime_setup.py`: `RuntimeContext` dataclass and `create_runtime_context()` — ParaView objects created before Trame is available. `ParaViewRuntime` is constructed in `factory.py` once `state` and `view_controls` exist.
- `handler_registration.py`: wires controllers and state handlers.
- `state_setup.py`: initializes all Trame state. If adding UI controls, add defaults here.
- `state_handlers.py`: shared `@state.change(...)` callbacks for selected file, color-by, representation, active pipeline node, interaction quality, edit mode.
- `state_handlers.py`: shared `@state.change(...)` callbacks for selected file, color-by, representation, active pipeline node, interaction quality, edit mode. Pipeline node switches are blocked during an active edit session — the handler emits a warning and resets `state.active_pipeline_item` to snap the UI selection back.
- `view_controls.py`: central wrapper for Trame view update callbacks and optional ParaView diagnostics.

### ParaView Backend Path

- `paraview_backend.py`: owns ParaView sources/displays, pipeline nodes, filters, coloring, display controls, picking, selection overlays, saving/export.
- `paraview_backend.py`: owns ParaView sources/displays, pipeline nodes, filters, coloring, display controls, picking, selection overlays, saving/export. `set_edit_target_dataset()` builds four remap caches at session begin (`_edit_source_dataset`, `_edit_source_point_indexes`, `_edit_target_cell_map`, `_edit_point_id_map`) so picks avoid per-pick Fetch/rebuild — see `docs/logic_flows.md §5b`.
- `paraview_runtime.py`: synchronizes backend state into Trame state, handles render pushes, edit-session overlay sync. Forwards event normalization calls to `paraview_event_utils.py`.
- `paraview_event_utils.py`: pure helpers for normalizing ParaView picking event payloads (`normalize_edit_selection_ids`, `summarize_edit_event`, coordinate mapping). No Trame dependency.
- `paraview_controllers.py`: user actions from the UI: pipeline actions, filters, edit sessions, selection, field creation, display/color controls.
Expand Down Expand Up @@ -201,6 +201,12 @@ Do not implement replace as a toggle. ParaView native payloads can contain toggl

Selection overlays can interfere with native picking. `paraview_backend.py` clears transient edit-selection overlays before pick queries.

### Pipeline Lock During Edit Session

`state_handlers.py` blocks `active_pipeline_item` changes while an edit session is active. When blocked, it emits a warning notification and resets `state.active_pipeline_item` to `pv_backend.active_node_id`, which snaps the pipeline tree UI back to the current node. The reset triggers a second `@state.change` event that is a no-op (Trame suppresses events when the value is unchanged), so there is no infinite loop.

No pre-change hook exists in Vuetify/Trame — `VListItemGroup v_model` writes state immediately on click — so interception must happen inside the callback after the write.

### EditSession Geometry Modes

`edit_session.py` supports three modes selected per-field:
Expand Down
17 changes: 11 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

## Priorita alta

- **Performance selezione su dataset grandi** — bottleneck documentati in
`docs/logic_flows.md` §5a e §6. Piano a step progressivi in [issue #34](https://github.com/2listic/coral-visualizer/issues/34); ogni step
è indipendente e lascia i test esistenti verdi. Step 1 può essere fatto direttamente
su `paraview_backend.py` senza refactor preventivo.

- Separare `paraview_backend.py` in servizi di dominio più piccoli (3900 righe).
Iniziare con `backend/selection.py` + `backend/selection_geometry.py`.
Vedi [docs/backend_refactor.md](docs/backend_refactor.md) per strategia, layout moduli e firme.
Iniziare da moduli con dipendenze unidirezionali (`backend/display.py`,
`backend/coloring.py`, `backend/pipeline.py`) — più self-contained e a minor rischio
di regressione rispetto alla selezione, che dipende trasversalmente dallo stato del
backend. La selezione segue dopo. Vedi [docs/backend_refactor.md](docs/backend_refactor.md)
per strategia, layout moduli e firme.

## Priorita media

Expand All @@ -20,10 +28,7 @@

## Miglioramenti futuri

- **Performance selezione su dataset grandi**: identificare il bottleneck (pick
query, overlay rebuild, state sync). Da affrontare dopo aver estratto e
compreso `backend/selection.py`.
- **Riorganizzazione UI/UX**: migliorare l'esperienza utente dopo aver spezzato
- **Riorganizzazione UI/UX**: migliorare l'esperienza utente eventualmente dopo aver spezzato
`ui.py` in moduli navigabili.

## Riorganizzazione cartelle
Expand Down
Loading
Loading