From 446b6bd864f065f0ae0088264f65e6fb01df380e Mon Sep 17 00:00:00 2001 From: Jonathon Leight Date: Tue, 7 Jul 2026 21:39:35 -0400 Subject: [PATCH] Better modal scrolling --- internal/core/endpoints_repeater_test.go | 9 ++++++++ internal/core/templates/share.html | 2 +- internal/core/templates/share_invite_new.html | 16 +++++++------- internal/core/templates/share_org_limits.html | 22 +++++++++---------- internal/web/templates/org_access.html | 2 +- 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/internal/core/endpoints_repeater_test.go b/internal/core/endpoints_repeater_test.go index f3f4b06..6d94a01 100644 --- a/internal/core/endpoints_repeater_test.go +++ b/internal/core/endpoints_repeater_test.go @@ -232,6 +232,11 @@ func TestRepeaterOrgLimitsPosts(t *testing.T) { if !strings.Contains(frag, "Manage access") || !strings.Contains(frag, `name="cmd"`) || !strings.Contains(frag, `name="include"`) { t.Fatalf("manage-access fragment missing expected content:\n%s", frag) } + // Footer buttons live outside the form (referencing it via form=) so the modal + // body can scroll with header/footer pinned; guard that structure. + if !strings.Contains(frag, `form="org-access-form"`) { + t.Fatal("manage-access footer button should reference the form via form= (scrollable body)") + } if strings.Contains(frag, "back-link") { t.Fatal("limits fragment should be modal chrome, not a full page") } @@ -389,6 +394,10 @@ func TestCreateInviteWithCommands(t *testing.T) { if !strings.Contains(frag, `name="description"`) || !strings.Contains(frag, `name="cmd"`) { t.Fatalf("new-invite fragment missing expected fields:\n%s", frag) } + // Footer button references the form via form= so the modal body scrolls. + if !strings.Contains(frag, `form="new-invite-form"`) { + t.Fatal("new-invite footer button should reference the form via form= (scrollable body)") + } if strings.Contains(frag, "back-link") { t.Fatal("new-invite fragment should be modal chrome, not a full page") } diff --git a/internal/core/templates/share.html b/internal/core/templates/share.html index bfd056f..b29c8bc 100644 --- a/internal/core/templates/share.html +++ b/internal/core/templates/share.html @@ -113,7 +113,7 @@ -
-
-
-
+ {{end}} diff --git a/internal/web/templates/org_access.html b/internal/web/templates/org_access.html index e943c23..3d007a5 100644 --- a/internal/web/templates/org_access.html +++ b/internal/web/templates/org_access.html @@ -29,7 +29,7 @@ their org-limits fragment into via htmx. */}} {{define "limits-modal-shell"}}