Skip to content

Commit 362b96d

Browse files
committed
fix(ui): keep permission dock buttons in view on long requests
Long permission.patterns push the dock footer buttons off-screen. Cap the dock with a viewport-relative max-height that also reserves the inherited sticky-header offset, and constrain the patterns grid row with min-height: 0 / minmax(0, 1fr) so overflow-y: auto engages instead of growing the wrapper. A bottom-only mask fades the scroll edge; no JavaScript measurement or runtime resize observers needed.
1 parent c556bdd commit 362b96d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

packages/ui/src/components/message-part.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@
720720
flex-direction: column;
721721
gap: 0;
722722
min-height: 0;
723-
max-height: 100dvh;
723+
max-height: min(40dvh, calc(100dvh - var(--sticky-accordion-top, 0px)));
724724

725725
[data-slot="permission-body"] {
726726
display: flex;
@@ -746,6 +746,13 @@
746746
align-items: center;
747747
}
748748

749+
[data-slot="permission-row"]:has(> [data-slot="permission-patterns"]) {
750+
flex: 1;
751+
min-height: 0;
752+
grid-template-rows: minmax(0, 1fr);
753+
align-items: stretch;
754+
}
755+
749756
[data-slot="permission-icon"] {
750757
display: inline-flex;
751758
align-items: center;
@@ -792,8 +799,11 @@
792799
flex: 1;
793800
min-height: 0;
794801
overflow-y: auto;
802+
overscroll-behavior: contain;
795803
scrollbar-width: none;
796804
-ms-overflow-style: none;
805+
-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
806+
mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
797807

798808
&::-webkit-scrollbar {
799809
display: none;

0 commit comments

Comments
 (0)