From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 84E7B1FF0AF for ; Fri, 06 Nov 2026 10:35:27 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2C0F3211FA; Fri, 06 Nov 2026 10:35:27 +0100 (CET) MIME-Version: 1.0 Date: Fri, 6 Nov 2026 09:35:23 +0000 Subject: applied: [PATCH proxmox-yew-widget-toolkit 1/5] widget: data table: simplify lookup of keys near the cursor In-Reply-To: <20261028151517.518742-2-n.frey@proxmox.com> References: <20261028151517.518742-1-n.frey@proxmox.com> <20261028151517.518742-2-n.frey@proxmox.com> X-Mailer: BlueMind-MailApp-v5 Message-ID: From: Dietmar Maurer To: Nicolas Frey Content-Type: multipart/alternative; boundary="-=Part.14c1.df4fe7251c0b80a5.1a1b0365e89.18ffae78f43c6519=-" X-Bm-Parsing-Options: encoded-parts X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793957724030 X-SPAM-LEVEL: Spam detection results: 0 AWL 1.827 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy HTML_MESSAGE 0.001 HTML included in message 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: 35DBIHK2J7UB5SS67AHIHDAQD4IDS65D X-Message-ID-Hash: 35DBIHK2J7UB5SS67AHIHDAQD4IDS65D X-MailFrom: dietmar@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 CC: yew-devel@lists.proxmox.com 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: ---=Part.14c1.df4fe7251c0b80a5.1a1b0365e89.18ffae78f43c6519=- Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable only applied patch 1 so far=2E On Wednesday, 10/28/2026, 16:15, Nicolas Frey wro= te: >>From : Nicolas Frey Sent on : Wednesday, 10/28/2026, 16:15 To : yew-devel@lists=2Eproxmox=2Ecom Subject : [PATCH proxmox-yew-widget-toolkit 1/5] widget: data table: simpl= ify lookup of keys near the cursor Signed-off-by: Nicolas Frey --- src/widget/data_table/data_table=2Ers | 25 ++++++ ------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/widget/data_table/data_table=2Ers b/src/widget/data_table= /data_table=2Ers index 5d04173=2E=2Ee846522 100644 --- a/src/widget/data_table/data_table=2Ers +++ b/src/widget/data_table/data_table=2Ers @@ -620,27 +620,16 @@ impl PwtDataTable { =C2=A0 =C2=A0 // avoid slow search by lookup up keys nearby cursor first =C2=A0 =C2=A0 fn filtered_record_pos(&self, props: &DataTable, key: &K= ey) -> Option { =C2=A0 =C2=A0 =C2=A0 =C2=A0 if let Some(Cursor { pos, =2E=2E }) =3D &self= =2Ecursor { - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0let test_pos =3D *pos; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if let Some(record_key) =3D pro= ps=2Estore [http://props=2Estore/]=2Elookup_filtered_record_key(test_pos) { - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if &record_key = =3D=3D key { + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for test_pos in [Some(*pos), po= s=2Echecked_add(1), pos=2Echecked_sub(1)] + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=2Einto_iter() + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=2Eflatten() + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if let Some(recor= d_key) =3D props=2Estore [http://props=2Estore/]=2Elookup_filtered_record_k= ey(test_pos) + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&& = &record_key =3D=3D key + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ret= urn Some(test_pos); =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 } - - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0let test_pos =3D pos + 1; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if let Some(record_key) =3D pro= ps=2Estore [http://props=2Estore/]=2Elookup_filtered_record_key(test_pos) { - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if &record_key = =3D=3D key { - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret= urn Some(test_pos); - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if *pos > 0 { - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0let test_pos =3D = pos - 1; - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if let Some(recor= d_key) =3D props=2Estore [http://props=2Estore/]=2Elookup_filtered_record_k= ey(test_pos) { - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if = &record_key =3D=3D key { - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0return Some(test_pos); - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} =C2=A0 =C2=A0 =C2=A0 =C2=A0 } =20 =C2=A0 =C2=A0 =C2=A0 =C2=A0 props=2Estore [http://props=2Estore/]=2Efilte= red_record_pos(key) --=20 2=2E47=2E3 ---=Part.14c1.df4fe7251c0b80a5.1a1b0365e89.18ffae78f43c6519=- Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
only applied patch 1 so far=2E

On Wednesday, 10/28/2026, 16:15, Nicolas Frey = <n=2Efrey@proxmox=2Ecom> wrote:

From  : <= /span>Nicolas Frey <n=2Efrey@proxmox=2Ecom>
Sent on  : Wednesday, 10/28/2026, 16:15
To : yew-devel@lists=2Eproxmox=2Ecom<= br>Subject : [PATCH proxmox-y= ew-widget-toolkit 1/5] widget: data table: simplify lookup of keys near the= cursor

Signed-off-by: Nicolas Frey <n=2Efrey@prox= mox=2Ecom> --- src/widget/data_table/data_table=2Ers | 25 ++++++
------------------ 1 file changed, 7 insertions(+), 18= deletions(-) diff --git a/src/widget/data_table/data_table=2Ers b/src/wid= get/data_table/data_table=2Ers index 5d04173=2E=2Ee846522 100644 --- a/src/= widget/data_table/data_table=2Ers +++ b/src/widget/data_table/data_table=2E= rs @@ -620,27 +620,16 @@ impl<S: DataStore> PwtDataTable<S> { =     // avoid slow search by lookup up keys nearby cursor first &= nbsp;   fn filtered_record_pos(&self, props: &DataTable<S&g= t;, key: &Key) -> Option<usize> {        = if let Some(Cursor { pos, =2E=2E }) =3D &self=2Ecursor { -   &nbs= p;        let test_pos =3D *pos; -      =      if let Some(record_key) =3D props=2Estore=2Elookup_fil= tered_record_key(test_pos) { -             &n= bsp;  if &record_key =3D=3D key { +         &n= bsp;  for test_pos in [Some(*pos), pos=2Echecked_add(1), pos=2Echecked= _sub(1)] +                =2Einto_i= ter() +                =2Eflatten()= +            { +        =        if let Some(record_key) =3D props=2Estore=2Eloo= kup_filtered_record_key(test_pos) +           &nbs= p;        && &record_key =3D=3D key +  = ;              {       &= nbsp;             return Some(test_pos); &nb= sp;               }      = ;       } - -            let t= est_pos =3D pos + 1; -            if let Some= (record_key) =3D props=2Estore=2Elookup_filtered_record_key(test_pos) { -=                if &record_key = =3D=3D key { -                 &nbs= p;  return Some(test_pos); -            =    } -            } -    = ;        if *pos > 0 { -        =        let test_pos =3D pos - 1; -      = ;          if let Some(record_key) =3D props=2Estore=2Elookup_filtered_record_key(test_pos) { -         &= nbsp;          if &record_key =3D=3D key { - &= nbsp;                    =  return Some(test_pos); -             &= nbsp;      } -             &nb= sp;  } -            }     &nb= sp;   }         props=2Estore=2Efiltered_record= _pos(key) -- 2=2E47=2E3
<= div>
---=Part.14c1.df4fe7251c0b80a5.1a1b0365e89.18ffae78f43c6519=---