Repository navigation
Conversation
…age header The form's container followed .page-header with no margin, so the form card touched the header's action buttons. Its .card-body wrapper has no padding outside a .card, where --tblr-card-spacer-y is undefined. Wrap the form in .page-body like the index grid, and give the form error alert the same top margin so every gap is the page padding. The alert also compares the form validity strictly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@SVillette Thx for your proposal, I need to check the difference between Sylius admin and your changes on this PR first. |
|
Thanks a lot for the fix and the detailed write-up, the measurements made the problem very clear! We're closing this one in favor of #413. The Sylius admin already solves the same gap in CSS, with the same templates: its We'd like to keep BootstrapAdminUi as close as possible to the Sylius admin templates and styles, since we'll probably merge them at some point. Once the sticky header is in, the |
| Q | A |-----------------|----- | Branch? | main | Bug fix? | yes | New feature? | no | BC breaks? | no | License | MIT On create and update pages, the form card is glued to the page header: the "Cancel" / "Update" buttons touch the card. The header has no bottom padding, and only the index pages render a `.page-body` with a top margin. The Sylius admin solves it in CSS, with the same templates. This PR ports its `_layout.scss` and `sticky-header.js` as is (a follow-up listed in #404): - `.page-header` gets the page vertical padding, `.page-body` no longer adds its own margin: same 24px gap on every page; - the header sticks to the top while scrolling (border and shadow once stuck), so the form buttons stay visible. The header template already had the `data-sticky-header` attribute; - no template or hook change. Measured on the demo, talk edit page: header → card 0px before, 24px after. Invalid form: header → alert 24px, alert → card 16px, as in Sylius. Index pages are unchanged (24px). It keeps BootstrapAdminUi closer to the Sylius admin templates and styles, which should be merged at some point. It is an alternative to #401 and #375, which fix the same gap by changing the markup or the hooks. `public/` assets were rebuilt with `yarn build`. ### Screenshots Talk edit page of the demo application, default theme. #### Valid form <img width="1640" height="433" alt="valid-form" src="https://github.com/user-attachments/assets/63444b42-6050-4d73-aebc-d4bfb032ac34" /> #### Invalid form <img width="1640" height="433" alt="invalid-form" src="https://github.com/user-attachments/assets/de5810fa-b79c-4451-ae83-a896b8850430" /> #### Sticky header, after scrolling <img width="800" height="387" alt="sticky-header" src="https://github.com/user-attachments/assets/4c8c125e-53aa-4a27-855e-a12df9ee5c01" />
On create and update pages, the form card sits flush against the page header: the bottom of the "Cancel" / "Create" buttons touches the card's top border.
The form's
.container-xlfollows.page-headerwith no margin. The.card-bodywrapping the form looks like it should add spacing, but it is not inside a.card, so--tblr-card-spacer-yis undefined there and its padding resolves to 0. Index pages don't have the problem becausegrid.html.twigwraps the grid in.page-body, whose top margin is--tblr-page-padding-y.This PR:
.page-body, like the index grid. The componentattributesmove to that new root element, soTalkFormComponentand other live forms keep a single root;mt-4and the alertmb-0..page-wrapperis a flex column, so margins don't collapse; without this, the alert would still touch the header and sit 40px above the form;is same as(false)rather than== false).===would need Twig 3.23, and the bundle still allows Twig 2.15.Valid form
Before
After
Invalid form (error alert)
Before
After
Measured gaps:
No SCSS change, so
public/app.cssis not rebuilt. Functional tests select the alert by[data-test-form-error-alert], which is unchanged.The markup changes, so an app that overrides only
form_error_alertkeeps an alert that touches the header and gets a 40px gap above the form, and an app that patched the gap with CSS such as.page-header + .container-xlnow applies it to the alert alone.🤖 Generated with Claude Code