From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 3F36F1FF09C for ; Mon, 02 Nov 2026 15:12:20 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9754821511; Mon, 02 Nov 2026 15:12:19 +0100 (CET) Message-ID: Date: Mon, 2 Nov 2026 15:12:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH proxmox-yew-widget-toolkit 2/5] widget: data table: only extend explicit select all to new rows To: Nicolas Frey , yew-devel@lists.proxmox.com References: <20261028151517.518742-1-n.frey@proxmox.com> <20261028151517.518742-3-n.frey@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20261028151517.518742-3-n.frey@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793628736142 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.335 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: JIFO5XGNNZFQ3NX235Z57LLUNXVKZ5L6 X-Message-ID-Hash: JIFO5XGNNZFQ3NX235Z57LLUNXVKZ5L6 X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: even that i find too much. A pattern I for example use often in UIs (even in our Extjs ones): * filter by some pattern * press 'select all' ( all visible are selected ) * unfilter * select some others too this would not work with this. Maybe we need to have some different modes for select all? * Automatic (status-quo, as default?) * All (your patch) * Visible (my use case from above) On 10/28/26 4:15 PM, Nicolas Frey wrote: > the "all" status was also set when every visible row happened to be > selected, so clearing a filter after selecting all matching rows > selected the whole table. > > remember whether select all was explicitly requested via the header, > and only then extend the selection on data changes. > > Signed-off-by: Nicolas Frey > --- > src/widget/data_table/data_table.rs | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/src/widget/data_table/data_table.rs b/src/widget/data_table/data_table.rs > index e846522..90f37ea 100644 > --- a/src/widget/data_table/data_table.rs > +++ b/src/widget/data_table/data_table.rs > @@ -518,6 +518,8 @@ pub struct PwtDataTable { > cursor: Option, > last_select_position: Option, > selection_status: RowSelectionStatus, > + /// Whether all rows were explicitly selected, so that rows added later get selected too. > + select_all_requested: bool, > > _selection_observer: Option, > > @@ -770,9 +772,11 @@ impl PwtDataTable { > } > selection.bulk_select(keys); > self.selection_status = RowSelectionStatus::All; > + self.select_all_requested = true; > } > > fn clear_selection(&mut self, props: &DataTable) { > + self.select_all_requested = false; > if let Some(selection) = &props.selection { > selection.clear(); > } > @@ -1200,6 +1204,7 @@ impl Component for PwtDataTable { > cursor: None, > last_select_position: None, > selection_status: RowSelectionStatus::Nothing, > + select_all_requested: false, > _selection_observer, > > active_column: 0, > @@ -1245,6 +1250,9 @@ impl Component for PwtDataTable { > match msg { > Msg::SelectionChange => { > self.update_selection_status(props); > + if self.selection_status != RowSelectionStatus::All { > + self.select_all_requested = false; > + } > true > } > Msg::DataChange => { > @@ -1259,7 +1267,10 @@ impl Component for PwtDataTable { > } > self.update_scroll_info(props); > > - if self.selection_status == RowSelectionStatus::All { > + // only an explicit select all extends to new rows. deriving it from the selection > + // status would select every row once a filter is removed, if all rows that > + // matched the filter happened to be selected. > + if self.select_all_requested { > self.select_all(props); > } else { > self.cleanup_selection(props); > -- > 2.47.3