Skip to content

Commit cccfa1d

Browse files
committed
fix(plothandler): cleanup XRangeSelection items when removing all signals
Closes #280
1 parent 2016a9a commit cccfa1d

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

datalab/gui/plothandler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,10 @@ def refresh_plot(
391391
if what == "selected":
392392
# Refresh selected objects
393393
oids = self.panel.objview.get_sel_object_uuids(include_groups=True)
394-
if len(oids) == 1:
394+
if len(oids) <= 1:
395+
# Cleanup data view when there is 0 or 1 selected object.
396+
# This removes stray plot items (like XRangeSelection, DataInfoLabel)
397+
# that were created by PlotPy tools but are not managed by DataLab.
395398
self.cleanup_dataview()
396399
self.remove_all_shape_items()
397400
for item in self:

doc/locale/fr/LC_MESSAGES/release_notes/release_1.00.po

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: DataLab \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2025-12-13 13:42+0100\n"
10+
"POT-Creation-Date: 2025-12-13 14:17+0100\n"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language: fr\n"
@@ -27,6 +27,21 @@ msgstr ""
2727
msgid "🛠️ Bug Fixes since version 1.0.2"
2828
msgstr "🛠️ Correctifs depuis la version 1.0.2"
2929

30+
msgid "**Signal view - XRangeSelection items persist after removing signals:**"
31+
msgstr "**Vue des signaux - Les éléments XRangeSelection persistent après la suppression des signaux :**"
32+
33+
msgid "Fixed XRangeSelection and DataInfoLabel items (created by PlotPy's curve statistics tools) remaining visible on the plot after removing all signals"
34+
msgstr "Correction des éléments XRangeSelection et DataInfoLabel (créés par les outils de statistiques de courbes de PlotPy) restant visibles sur le graphique après la suppression de tous les signaux"
35+
36+
msgid "When activating the XRangeSelection tool from the PlotPy toolbar and then removing the signal(s), these tool-created graphical objects were not cleaned up"
37+
msgstr "Lors de l'activation de l'outil XRangeSelection depuis la barre d'outils PlotPy, puis de la suppression du ou des signaux, ces objets graphiques créés par l'outil n'étaient pas nettoyés"
38+
39+
msgid "The cleanup logic now correctly triggers when there are zero selected objects (after deleting the last one), not just when exactly one object is selected"
40+
msgstr "La logique de nettoyage se déclenche désormais correctement lorsqu'il n'y a aucun objet sélectionné (après la suppression du dernier), et pas seulement lorsqu'un seul objet est sélectionné"
41+
42+
msgid "This closes [Issue #280](https://github.com/datalab-platform/datalab/issues/280) - XRangeSelection items persist after removing all signals"
43+
msgstr "Ceci clôture [Issue #280](https://github.com/datalab-platform/datalab/issues/280) - Les éléments XRangeSelection persistent après la suppression de tous les signaux"
44+
3045
msgid "**Remote control - Crash when adding object via proxy:**"
3146
msgstr "**Contrôle distant - Plantage lors de l'ajout d'un objet via le proxy :**"
3247

doc/release_notes/release_1.00.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
### 🛠️ Bug Fixes since version 1.0.2 ###
66

7+
**Signal view - XRangeSelection items persist after removing signals:**
8+
9+
* Fixed XRangeSelection and DataInfoLabel items (created by PlotPy's curve statistics tools) remaining visible on the plot after removing all signals
10+
* When activating the XRangeSelection tool from the PlotPy toolbar and then removing the signal(s), these tool-created graphical objects were not cleaned up
11+
* The cleanup logic now correctly triggers when there are zero selected objects (after deleting the last one), not just when exactly one object is selected
12+
* This closes [Issue #280](https://github.com/datalab-platform/datalab/issues/280) - XRangeSelection items persist after removing all signals
13+
714
**Remote control - Crash when adding object via proxy:**
815

916
* Fixed `AttributeError: 'NoneType' object has no attribute 'setText'` crash when adding objects via `RemoteProxy.add_object()` in macros

0 commit comments

Comments
 (0)