public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Dominik Csapak" <d.csapak@proxmox.com>,
	"Lukas Wagner" <l.wagner@proxmox.com>,
	<pdm-devel@lists.proxmox.com>
Subject: Re: [PATCH datacenter-manager/yew-widget-toolkit 0/3] ui: persist the main menus expanded state
Date: Mon, 31 Aug 2026 15:28:34 +0200	[thread overview]
Message-ID: <DL35XUBEZ81J.TYBGQVZMPBQ4@proxmox.com> (raw)
In-Reply-To: <19931a6b-a366-48f2-a48c-119d4380fb92@proxmox.com>

On Mon Aug 31, 2026 at 3:11 PM CEST, Dominik Csapak wrote:
>> 
>> LGTM in general, works fine and the code seems good too.
>> 
>> One thought, looking at the saved state in the web inspector in Firefox:
>> Would it maybe make sense for future extensions to slightly update the
>> serialized format from
>> 
>> ["sdn","administration"]
>> 
>> to something like:
>> 
>> { collapsed: ["sdn", "administration"]}
>> 
>> That would make it much easier to add other keys as well in the future,
>> if we need to store additional state.
>
> it's actually not collapsed, but changed from the default
> (the main menu in pdm just happens to default to all expanded)
>
> so it would be { "changed": [...] }
>
> would that be ok?

Maybe "changed-collapsed" so that it conveys that this is about the
collpase/expanded state and not anything else?

>
> we could of course do this in the future and interpret
> an array as just the changed list and migrate automatically.
>
> in practice this would look like (rough pseude code):
>
> let try1: Result<NewStateFormat, _> = input.parse();
> match try1 {
>     Ok(state) => { /* return the state */ }
>     Err(err) => {
>         let legacy: Result<OldStateFormat, _> = input.parse();
>         // either take legacy and convert to new state
>         // or return original error 'err'
>     }
> }

Yeah, migrating the format is of course also possible in the future, but
since this is completely new code, I'd favor making it extensible right
away.

Thanks!





      reply	other threads:[~2026-08-31 13:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  8:17 [PATCH datacenter-manager/yew-widget-toolkit 0/3] ui: persist the main menus expanded state Dominik Csapak
2026-08-20  8:17 ` [PATCH yew-widget-toolkit 1/3] widget: navigation drawer: fix first open for default collapsed menus Dominik Csapak
2026-08-20  8:17 ` [PATCH yew-widget-toolkit 2/3] widget: navigation drawer: allow persisting the expanded state Dominik Csapak
2026-08-20  8:17 ` [PATCH datacenter-manager 3/3] ui: main menu: make expanded/collapsed state persistent Dominik Csapak
2026-08-31 13:02 ` [PATCH datacenter-manager/yew-widget-toolkit 0/3] ui: persist the main menus expanded state Lukas Wagner
2026-08-31 13:11   ` Dominik Csapak
2026-08-31 13:28     ` Lukas Wagner [this message]

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=DL35XUBEZ81J.TYBGQVZMPBQ4@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pdm-devel@lists.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