* [PATCH yew-comp] wizard: fix page unlocking with advanced fields
@ 2026-05-28 9:18 Dominik Csapak
2026-05-28 10:20 ` Thomas Lamprecht
2026-05-28 11:17 ` applied: " Thomas Lamprecht
0 siblings, 2 replies; 5+ messages in thread
From: Dominik Csapak @ 2026-05-28 9:18 UTC (permalink / raw)
To: yew-devel
The wizard depends on the form context validation of the pages to
determine which to lock and unlock. Initially all pages are locked and
only if the form_ctx changes and is valid the corresponding page will be
unlocked. With the introduction of the advanced button in the wizard,
this can happen for pages even if they're not rendered yet.
For pages that are by default invalid (e.g. includes a required field
that is empty at the start) this means the form_ctx will show is_valid
since none of the form fields are registered yet with it.
To prevent that, force all pages to render always, which will then
correctly update each form_ctx with the validation state. Performance
wise this must be OK, since when the user finished the wizard, all pages
must be rendered anyway (The tab panel doesn't 'unrender' already
rendered pages).
Fixes: 67d11b1 (wizard: auto-show the Advanced toggle on pages with advanced fields)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/wizard.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/wizard.rs b/src/wizard.rs
index 9091c52..3236e12 100644
--- a/src/wizard.rs
+++ b/src/wizard.rs
@@ -510,6 +510,9 @@ impl Component for PwtWizard {
let mut tab_panel = TabPanel::new()
.class(Overflow::Auto)
.class(Flex::Fill)
+ // NOTE: this is necessary for the form_ctx validation to work correctly, since only
+ // rendered (and thus mounted) fields are registered with the context.
+ .force_render_all(true)
.tab_bar_style(props.tab_bar_style)
.selection(self.selection.clone());
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH yew-comp] wizard: fix page unlocking with advanced fields
2026-05-28 9:18 [PATCH yew-comp] wizard: fix page unlocking with advanced fields Dominik Csapak
@ 2026-05-28 10:20 ` Thomas Lamprecht
2026-05-28 10:55 ` Dominik Csapak
2026-05-28 11:17 ` applied: " Thomas Lamprecht
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Lamprecht @ 2026-05-28 10:20 UTC (permalink / raw)
To: Dominik Csapak, yew-devel
Am 28.05.26 um 11:18 schrieb Dominik Csapak:
> The wizard depends on the form context validation of the pages to
> determine which to lock and unlock. Initially all pages are locked and
> only if the form_ctx changes and is valid the corresponding page will be
> unlocked. With the introduction of the advanced button in the wizard,
> this can happen for pages even if they're not rendered yet.
I.e., pages get unlocked overly eagerly vs. kept beeing locked? Just to be
sure as the subject confused me there for a moment.
Maybe "fix page validation with advanced fields" as that's what's fixed,
the unlocking is then just an effect of that (can edit that on applying).
FWIW, for the auto installer answer file wizard I'd like to add a
"free_navigation" option to the wizard, with that then one can navigate
through all steps freely from the start. Needs validity handling on submit
and a small UI hint for invalid tabs in the bar for UX though, which is a bit
more work and that's why I skipped adding it yesterday.
Just mentioning for context, your patch here is still warranted in any case.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH yew-comp] wizard: fix page unlocking with advanced fields
2026-05-28 10:20 ` Thomas Lamprecht
@ 2026-05-28 10:55 ` Dominik Csapak
2026-05-28 11:15 ` Thomas Lamprecht
0 siblings, 1 reply; 5+ messages in thread
From: Dominik Csapak @ 2026-05-28 10:55 UTC (permalink / raw)
To: Thomas Lamprecht, yew-devel
On 5/28/26 12:20 PM, Thomas Lamprecht wrote:
> Am 28.05.26 um 11:18 schrieb Dominik Csapak:
>> The wizard depends on the form context validation of the pages to
>> determine which to lock and unlock. Initially all pages are locked and
>> only if the form_ctx changes and is valid the corresponding page will be
>> unlocked. With the introduction of the advanced button in the wizard,
>> this can happen for pages even if they're not rendered yet.
>
> I.e., pages get unlocked overly eagerly vs. kept beeing locked? Just to be
> sure as the subject confused me there for a moment.
yes exactly, when the page is not rendered yet, the form_ctx does not
have any registered fields and the advanced cb change triggers the
form_ctx change and at this point the page is 'valid'.
> Maybe "fix page validation with advanced fields" as that's what's fixed,
> the unlocking is then just an effect of that (can edit that on applying).
yes that's fine with me, should i send a v2 or is it fine to simply
fix it up on applying?
>
> FWIW, for the auto installer answer file wizard I'd like to add a
> "free_navigation" option to the wizard, with that then one can navigate
> through all steps freely from the start. Needs validity handling on submit
> and a small UI hint for invalid tabs in the bar for UX though, which is a bit
> more work and that's why I skipped adding it yesterday.
maybe then a wizard is not actually what we want here, but maybe a
manual tabpanel which marks the tabs with a fa-triangle-exclamation
or something if it's not valid?
>
> Just mentioning for context, your patch here is still warranted in any case.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH yew-comp] wizard: fix page unlocking with advanced fields
2026-05-28 10:55 ` Dominik Csapak
@ 2026-05-28 11:15 ` Thomas Lamprecht
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2026-05-28 11:15 UTC (permalink / raw)
To: Dominik Csapak, yew-devel
Am 28.05.26 um 12:54 schrieb Dominik Csapak:
> On 5/28/26 12:20 PM, Thomas Lamprecht wrote:
>> Maybe "fix page validation with advanced fields" as that's what's fixed,
>> the unlocking is then just an effect of that (can edit that on applying).
>
> yes that's fine with me, should i send a v2 or is it fine to simply
> fix it up on applying?
I'll fix that up, thx.
>> FWIW, for the auto installer answer file wizard I'd like to add a
>> "free_navigation" option to the wizard, with that then one can navigate
>> through all steps freely from the start. Needs validity handling on submit
>> and a small UI hint for invalid tabs in the bar for UX though, which is a bit
>> more work and that's why I skipped adding it yesterday.
>
> maybe then a wizard is not actually what we want here, but maybe a
> manual tabpanel which marks the tabs with a fa-triangle-exclamation
> or something if it's not valid?
I thought about that, but I like the wizard form of having a guided "next"
and (here still missing) final summary and confirmation page for some flows.
And I really see no essential clash with having all steps available with the
guided wizard approach itself in general, i.e. not a must, but can be totally
fine; this allows power users some more flexibility while guiding less
experienced users better.
But I agree that this needs some special care, the UI/UX polishing for this
can make the difference between a great feature or confusion, so I'd like to
flesh out and validate what I have in mind a bit more in-depth before doing
anything here.
^ permalink raw reply [flat|nested] 5+ messages in thread
* applied: [PATCH yew-comp] wizard: fix page unlocking with advanced fields
2026-05-28 9:18 [PATCH yew-comp] wizard: fix page unlocking with advanced fields Dominik Csapak
2026-05-28 10:20 ` Thomas Lamprecht
@ 2026-05-28 11:17 ` Thomas Lamprecht
1 sibling, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2026-05-28 11:17 UTC (permalink / raw)
To: yew-devel, Dominik Csapak
On Thu, 28 May 2026 11:18:45 +0200, Dominik Csapak wrote:
> The wizard depends on the form context validation of the pages to
> determine which to lock and unlock. Initially all pages are locked and
> only if the form_ctx changes and is valid the corresponding page will be
> unlocked. With the introduction of the advanced button in the wizard,
> this can happen for pages even if they're not rendered yet.
>
> For pages that are by default invalid (e.g. includes a required field
> that is empty at the start) this means the form_ctx will show is_valid
> since none of the form fields are registered yet with it.
>
> [...]
Applied, thanks!
[1/1] wizard: fix page unlocking with advanced fields
commit: 5f057210b197042c1223e39e3dee3f802754234c
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-28 11:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 9:18 [PATCH yew-comp] wizard: fix page unlocking with advanced fields Dominik Csapak
2026-05-28 10:20 ` Thomas Lamprecht
2026-05-28 10:55 ` Dominik Csapak
2026-05-28 11:15 ` Thomas Lamprecht
2026-05-28 11:17 ` applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.