From 900bc2f6f7f9c58a8c45d123f5c9bfb70319cb5e Mon Sep 17 00:00:00 2001 From: Dawn Date: Mon, 17 Aug 2026 14:02:41 +0200 Subject: [PATCH] feat: add Unflag to the sample table context menu Below Mount/Unmount, acting on the selection like the queue actions. Flagging happens by dropping rows on the Flagged chip; until now there was no way back. Disabled when nothing in the selection is flagged. Co-Authored-By: Claude Fable 5 --- src/aare/gui/panels/tell_sample_panel.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/aare/gui/panels/tell_sample_panel.py b/src/aare/gui/panels/tell_sample_panel.py index 26a4ee8a..f811f02c 100644 --- a/src/aare/gui/panels/tell_sample_panel.py +++ b/src/aare/gui/panels/tell_sample_panel.py @@ -318,6 +318,11 @@ class TellSamplePanel(QFrame): mount_action = menu.addAction("Mount") # Unmount moved here from the removed bottom-row button — same signal. unmount_action = menu.addAction("Unmount") + menu.addSeparator() + # Flagging happens by dropping rows on the Flagged chip; this is the + # only way back, so it lives here even though Flag does not. + unflag_action = menu.addAction(f"Unflag{count}") + unflag_action.setEnabled(any(s.db_id in self.table_model.flagged_ids for s in selected)) action = menu.exec_(self.table_view.viewport().mapToGlobal(position)) @@ -331,6 +336,10 @@ class TellSamplePanel(QFrame): elif action == remove_queue_action: self.remove_from_queue.emit(SampleShortInfoList(s=selected)) self.table_view.clearSelection() + elif action == unflag_action: + for s in selected: + self.table_model.set_flagged(s.db_id, False) + self.table_view.clearSelection() def header_context_menu(self, pos): header = self.table_view.horizontalHeader()