public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Proxmox Datacenter Manager development discussion
	<pdm-devel@lists.proxmox.com>
Subject: Re: [pdm-devel] [PATCH yew-comp 2/7] tasks: load more tasks on end of list
Date: Tue, 21 Jan 2025 10:43:48 +0100	[thread overview]
Message-ID: <20ac82e0-2340-460a-902b-e7a16405e26c@proxmox.com> (raw)
In-Reply-To: <f99fc19e-32c8-4bb9-b2f0-db496ff03bc0@proxmox.com>

On 1/20/25 18:29, Thomas Lamprecht wrote:
> Am 20.01.25 um 10:29 schrieb Dominik Csapak:
>> and prevent the list to load multiple times the same data when filters
>> change rapidly (e.g. on first render or when the user enters text in
>> the filters)
> 
> The load debouncing would have been better off as separate commit IMO,
> quite unrelated to the auto-load feature, but already pushed out so to
> late to improve here..
> 
>>
>> reset the list when the filters changed or the reload button is pressed.
>>
>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>> ---
>>   src/tasks.rs | 72 ++++++++++++++++++++++++++++++++++++++++++----------
>>   1 file changed, 59 insertions(+), 13 deletions(-)
>>
>> diff --git a/src/tasks.rs b/src/tasks.rs
>> index fa17602..0ef80c6 100644
>> --- a/src/tasks.rs
>> +++ b/src/tasks.rs
>> @@ -6,6 +6,8 @@ use anyhow::Error;
>>   
>>   use pwt::widget::form::{Field, Form, FormContext, InputType};
>>   
>> +use gloo_timers::callback::Timeout;
>> +use serde_json::Map;
>>   use yew::html::IntoPropValue;
>>   use yew::virtual_dom::{VComp, VNode};
>>   
>> @@ -26,6 +28,10 @@ use crate::{LoadableComponent, LoadableComponentContext, LoadableComponentMaster
>>   
>>   use super::{TaskStatusSelector, TaskTypeSelector};
>>   
>> +const FILTER_UPDATE_BUFFER_MS: u32 = 150;
>> +const BATCH_LIMIT: u64 = 500;
>> +const LOAD_BUFFER_ROWS: usize = 20;
> 
> Any reasoning on those sizes? Don't get me wrong, I'm fine with values being
> chosen empirically, hard to do that otherwise here, but some background would
> be still nice to have should one have to adapt those sometimes.

the batch limit is the same as the PVE/PBS (extjs) one, so no real
thought went into here

the filter update buffer ms is a bit dependent on typing speed, so
this was just a value that seemed to work for me (when i typed
not overly fast or slow). I don't think there is really a good
value that fits all sadly

> 
> I.e., could it make sense to make that dependent on the height of the
> component? Or maybe allow overriding the batch-limit from the user, if one
> wants to filter through much more tasks, but that one is not really important
> for this patch now.

the buffer rows has more to do with scroll speed than component height
and i tried to find a good compromise between loading too early
when it's not clear the user wants to look so far back vs
too late when the user is already at the end (while trying to scroll
in a "normal" speed)

i can add some comments here if you want

> 
>>   #[derive(PartialEq, Properties)]
>>   #[builder]
>>   pub struct Tasks {
>> @@ -75,6 +81,7 @@ pub enum ViewDialog {
>>   pub enum Msg {
>>       Redraw,
>>       ToggleFilter,
>> +    LoadBatch(u64), // start
> 
> "start offset" might be a bit more telling, "offset" probably would
> have been the better name for this, but well, that ship has somewhat
> sailed for now (in our released products backends).
> 
>>       UpdateFilter,
>>   }
> 
> 



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-01-21  9:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20  9:29 [pdm-devel] [PATCH yew-comp/datacenter-manager] ui: implement remote task list Dominik Csapak
2025-01-20  9:29 ` [pdm-devel] [PATCH yew-comp 1/7] tasks: make date filter functional Dominik Csapak
2025-01-20 11:30   ` Thomas Lamprecht
2025-01-20 12:10     ` Dominik Csapak
2025-01-21  8:33       ` Thomas Lamprecht
2025-01-21  9:46         ` Dominik Csapak
2025-01-20  9:29 ` [pdm-devel] [PATCH yew-comp 2/7] tasks: load more tasks on end of list Dominik Csapak
2025-01-20 17:29   ` Thomas Lamprecht
2025-01-21  9:43     ` Dominik Csapak [this message]
2025-01-20  9:29 ` [pdm-devel] [PATCH yew-comp 3/7] utils: factor out task description into own function Dominik Csapak
2025-01-20 17:29   ` Thomas Lamprecht
2025-01-21  9:44     ` Dominik Csapak
2025-01-20  9:29 ` [pdm-devel] [PATCH yew-comp 4/7] running tasks: make TaskListItem renderer configurable Dominik Csapak
2025-01-20  9:29 ` [pdm-devel] [PATCH yew-comp 5/7] running tasks: make buttons configurable Dominik Csapak
2025-01-20  9:29 ` [pdm-devel] [PATCH yew-comp 6/7] tasks: make columns configurable Dominik Csapak
2025-01-20 17:37   ` Thomas Lamprecht
2025-01-20  9:29 ` [pdm-devel] [PATCH yew-comp 7/7] tasks: make the 'show task' action configurable Dominik Csapak
2025-01-20  9:29 ` [pdm-devel] [PATCH datacenter-manager 1/9] server: factor out task filters into `TaskFilters` type Dominik Csapak
2025-01-20 17:42   ` Thomas Lamprecht
2025-01-20  9:29 ` [pdm-devel] [PATCH datacenter-manager 2/9] server: task cache: skip remotes with errors on fetch Dominik Csapak
2025-01-20 17:45   ` Thomas Lamprecht
2025-01-21  8:29     ` Dietmar Maurer
2025-01-20  9:30 ` [pdm-devel] [PATCH datacenter-manager 3/9] server: task cache: add filter options Dominik Csapak
2025-01-20  9:30 ` [pdm-devel] [PATCH datacenter-manager 4/9] server: task cache: reverse task order Dominik Csapak
2025-01-20  9:30 ` [pdm-devel] [PATCH datacenter-manager 5/9] pdm-client: export PveUpid Dominik Csapak
2025-01-20  9:30 ` [pdm-devel] [PATCH datacenter-manager 6/9] ui: refactor RemoteConfigPanel into own module Dominik Csapak
2025-01-20  9:30 ` [pdm-devel] [PATCH datacenter-manager 7/9] ui: remotes: add tasks to global remote panel Dominik Csapak
2025-01-20  9:30 ` [pdm-devel] [PATCH datacenter-manager 8/9] ui: register pve tasks Dominik Csapak
2025-01-20  9:30 ` [pdm-devel] [PATCH datacenter-manager 9/9] ui: also show running remote tasks in 'running tasks' list Dominik Csapak
2025-01-20 11:27 ` [pdm-devel] applied: [PATCH yew-comp/datacenter-manager] ui: implement remote task list Dietmar Maurer
2025-01-20 11:34   ` Thomas Lamprecht
2025-01-21  8:41 ` [pdm-devel] " Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20ac82e0-2340-460a-902b-e7a16405e26c@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal