Repository navigation
Stepper: step content centres on the page again - #1241
Conversation
Hello jeanmarcmilletscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
be0461a to
fd07084
Compare
fd07084 to
78e0309
Compare
78e0309 to
ba9b2ad
Compare
cfb4a45 to
de3b45c
Compare
A page form used as a step fills the row's remainder and centres its content on that column, so the rail's width pushed it right of the page's centre line. The row is now a three-track grid whose last track mirrors the rail's column, capped at what a page form leaves spare so the reservation gives way before the step loses any width. The step is rendered in its own slot, so the row always holds two children and nothing can be auto-placed into the reservation, and both grids are capped at one row so a step taller than the row scrolls inside itself rather than growing past it.
de3b45c to
3cc5d5b
Compare
|
/approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
|
I have successfully merged the changeset of this pull request
Please check the status of the associated issue CUI-66. Goodbye jeanmarcmilletscality. |


TL;DR — Stepper: a page form used as a step sat visibly right of the page's centre line, and now sits on it.
Before, then after — Stepper › Guided setup at a 1512px frame, red line on the page's centre.
The form's own centre moves from x=934 to 756. Before is the same build with the row put back to its
pre-change layout, so only the row's CSS differs.
Context / Why
This is a regression. Until 0.230.0 a step form was content-sized, so the rail and the step were
left-packed and the form happened to land near the page centre. In 0.230.0 a containerized
Formgained
flex: 1 1 auto; min-width: 0: it now fills the row's remainder andmargin: 0 autocentresits content on that column, 178px right of centre at a 1512px frame. That
flexcannot bereverted —
container-type: inline-sizeremoves the form's intrinsic width, so content-sized itresolves to 0 — and the rail is asymmetric space only
Stepperknows about.🧩 Approach
The row becomes a three-track grid whose last track mirrors the rail's column on the right, so
whatever fills the middle centres on the page rather than on its column:
The
min()is what makes that reservation safe: it only ever claims width left spare once a pageform has the content width it wants, so it gives way as the row narrows rather than squeezing the
form — full above a 1316px row, gone below roughly 1090px, where the layout is left-packed exactly
as it is today. The step is rendered in its own slot so the row always holds two children, and a
step rendering several top-level elements cannot be auto-placed into the reservation.
🔍 Review focus
steppers/Stepper.component.tsx › StepRow— the reservation applies to every step, not only aform, and a step that took its width from its own content now stretches to the middle track
(measured at a 1808px row, a bordered step goes from 333px to 960px). Deliberate, but visible.
steppers/Steppers.component.tsx › Step—Steppersis also exported on its own and bothchanges apply there: a step's
min-widthis 18rem rather than 20rem, and its title box growsrather than clipping a wrapped label. The rail's spare width is now reserved twice, so trimming it
moves the width at which centring degrades by double.
form/Form.constants.ts— new module, so a layout placing something beside a page form can readPAGE_FORM_WIDTHwithout pulling the whole Form module in. Not added to theindex.tsbarrel.🧪 How to test
npm run storybook, open Stepper › Guided setup at a wide frame: the first step is a pageform, and its content box is centred on the page rather than on the column right of the rail.
and below roughly a 1090px row the layout is left-packed as it is today.
the middle track and is inset symmetrically.
🔗 References
measurements and why reverting the
Formchange is not an option.narrow containers, taking the rail out of the flow centres the step at every width and this
reservation goes away entirely.
Guidelines/Responsivegains the general form of this: a container takes its width from theparent, so anything beside it has to be balanced on the other side.
Not in scope
Taking the rail out of the flow would centre the step content at every width without the trade-off
this PR makes — the form would keep its full width further down. It only works once the rail
collapses on narrow containers, otherwise it overlaps the step content, so it belongs with CUI-67.