Hero: opslaanbalk echt tegen de onderrand van het scherm (sticky meet vanaf de contentrand), meer ruimte rond Opslaan
Continuous Integration / config-sls (pull_request) Successful in 10s
Continuous Integration / config-asf (pull_request) Successful in 7s
Continuous Integration / changes (pull_request) Successful in 15s
Continuous Integration / backend-build (pull_request) Successful in 1m44s
Continuous Integration / vulnerability-scan (pull_request) Successful in 1m58s
Continuous Integration / compile-sites (pull_request) Successful in 2m1s
Continuous Integration / frontend-prepare (pull_request) Successful in 56s
Continuous Integration / frontend-build (pull_request) Successful in 43s
Continuous Integration / backend-test (pull_request) Successful in 2m53s
Continuous Integration / frontend-lint (pull_request) Successful in 47s
Continuous Integration / frontend-test (pull_request) Successful in 3m9s
Continuous Integration / publish-sls-test (pull_request) Skipped
Continuous Integration / publish-sls-production (pull_request) Skipped
Continuous Integration / deploy-sls-test (pull_request) Skipped
Continuous Integration / deploy-sls-production (pull_request) Skipped
Continuous Integration / publish-asf-test (pull_request) Skipped
Continuous Integration / deploy-asf-test (pull_request) Skipped
Continuous Integration / smoke-sls-test (pull_request) Skipped
Continuous Integration / smoke-asf-test (pull_request) Skipped
Continuous Integration / config-sls (pull_request) Successful in 10s
Continuous Integration / config-asf (pull_request) Successful in 7s
Continuous Integration / changes (pull_request) Successful in 15s
Continuous Integration / backend-build (pull_request) Successful in 1m44s
Continuous Integration / vulnerability-scan (pull_request) Successful in 1m58s
Continuous Integration / compile-sites (pull_request) Successful in 2m1s
Continuous Integration / frontend-prepare (pull_request) Successful in 56s
Continuous Integration / frontend-build (pull_request) Successful in 43s
Continuous Integration / backend-test (pull_request) Successful in 2m53s
Continuous Integration / frontend-lint (pull_request) Successful in 47s
Continuous Integration / frontend-test (pull_request) Successful in 3m9s
Continuous Integration / publish-sls-test (pull_request) Skipped
Continuous Integration / publish-sls-production (pull_request) Skipped
Continuous Integration / deploy-sls-test (pull_request) Skipped
Continuous Integration / deploy-sls-production (pull_request) Skipped
Continuous Integration / publish-asf-test (pull_request) Skipped
Continuous Integration / deploy-asf-test (pull_request) Skipped
Continuous Integration / smoke-sls-test (pull_request) Skipped
Continuous Integration / smoke-asf-test (pull_request) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1170,4 +1170,19 @@ describe('Tabs Content and Images', () => {
|
||||
expect(bar).toHaveClass('-mx-6', 'bg-background', 'border-t');
|
||||
expect(bar.className).not.toMatch(/bg-background\//);
|
||||
});
|
||||
|
||||
it('sticks flush with the bottom of the viewport: undoes the padding of the scrolling area, no bottom margin, and the page cancels the padding below it', async () => {
|
||||
await openPage();
|
||||
|
||||
const bar = screen.getByTestId('hero-save-bar');
|
||||
// <main> has p-6 and a sticky box measures from the content edge, so -bottom-6 (measured in Chrome) puts it on the screen edge.
|
||||
expect(bar).toHaveClass('sticky', '-bottom-6');
|
||||
expect(bar.className).not.toMatch(/(^|\s)-?mb-/);
|
||||
expect(bar.className).not.toMatch(/(^|\s)(translate|bottom-)/);
|
||||
expect(screen.getByTestId('hero-page')).toHaveClass('-mb-6');
|
||||
// Room around the button: more padding above and below than before.
|
||||
expect(bar).toHaveClass('pt-4', 'gap-4');
|
||||
expect(bar.style.paddingBottom).toContain('1rem');
|
||||
expect(screen.getByTestId('hero-form').className).not.toMatch(/pb-/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -99,7 +99,7 @@ export function HeroPage() {
|
||||
const { data: hero, isLoading, isError, refetch } = useHero();
|
||||
|
||||
return (
|
||||
<div className="space-y-6" data-testid="hero-page">
|
||||
<div className="-mb-6 space-y-6" data-testid="hero-page">
|
||||
<div className="flex flex-wrap items-center gap-3">
|
||||
<h1 className="text-2xl font-semibold" data-testid="hero-title">{t('hero.title')}</h1>
|
||||
{hero && (
|
||||
@@ -386,7 +386,7 @@ function HeroEditor({ hero }: { hero: HeroAdminDto }) {
|
||||
const heroErrors = errors;
|
||||
|
||||
return (
|
||||
<form onSubmit={(event) => void handleSubmit(onSubmit, onInvalid)(event)} className="space-y-8 pb-4" noValidate data-testid="hero-form">
|
||||
<form onSubmit={(event) => void handleSubmit(onSubmit, onInvalid)(event)} className="space-y-8" noValidate data-testid="hero-form">
|
||||
<ProcessingStatus images={slides.fields.map((f) => images[f.imageId]).filter((image): image is HeroImageDto => image !== undefined)} />
|
||||
<FormErrorBanner error={serverError !== null ? { message: serverError } : null} onDismiss={() => setServerError(null)} />
|
||||
|
||||
@@ -585,11 +585,15 @@ function HeroEditor({ hero }: { hero: HeroAdminDto }) {
|
||||
</div>
|
||||
|
||||
<UnsavedChangesGuard dirty={hasUnsaved} />
|
||||
{/* Full width of the content area (no gap at the sides or below), opaque, with a clear top edge and a shadow; the
|
||||
bottom padding keeps clear of the home bar of a phone. */}
|
||||
{/* Flush with the bottom of the viewport and the full width of the content area, fully opaque so nothing shows
|
||||
through or below it, with a clear top edge and a shadow. A sticky box measures its offset from the CONTENT
|
||||
edge of the scrolling area (<main> has p-6), so "bottom: 0" would stop 24px above the screen edge and let
|
||||
content show below the bar (measured in Chrome); -bottom-6 undoes that padding. The page root cancels the same
|
||||
padding (-mb-6), so at the end of the page the bar is still at the very bottom and the last content is never
|
||||
hidden behind it. The bottom padding clears the home bar of a phone. */}
|
||||
<div
|
||||
className="sticky bottom-0 z-20 -mx-6 -mb-6 flex flex-wrap items-center justify-end gap-3 border-t bg-background px-6 pt-3 shadow-[0_-4px_8px_-4px_rgba(0,0,0,0.15)]"
|
||||
style={{ paddingBottom: 'calc(0.75rem + env(safe-area-inset-bottom))' }}
|
||||
className="sticky -bottom-6 z-20 -mx-6 flex flex-wrap items-center justify-end gap-4 border-t bg-background px-6 pt-4 shadow-[0_-4px_8px_-4px_rgba(0,0,0,0.15)]"
|
||||
style={{ paddingBottom: 'calc(1rem + env(safe-area-inset-bottom))' }}
|
||||
data-testid="hero-save-bar"
|
||||
>
|
||||
<div role="status" aria-live="polite" className="min-h-5 flex-1 text-sm" data-testid="hero-unsaved-region">
|
||||
@@ -605,7 +609,7 @@ function HeroEditor({ hero }: { hero: HeroAdminDto }) {
|
||||
disabled={save.isPending || !hasUnsaved}
|
||||
aria-disabled={save.isPending || !hasUnsaved}
|
||||
aria-busy={save.isPending}
|
||||
className={hasUnsaved && !save.isPending ? 'ring-2 ring-primary ring-offset-2' : undefined}
|
||||
className={`min-w-28 ${hasUnsaved && !save.isPending ? 'ring-2 ring-primary ring-offset-2' : ''}`}
|
||||
data-testid="hero-save"
|
||||
>
|
||||
{save.isPending ? (
|
||||
|
||||
Reference in New Issue
Block a user