Skip to content
TypeScript

fix(web): reduce title bar scroll fade height (#8799)

maria6e324b9bbfc7
diff --git a/apps/web/src/components/chat/MessagesTimeline.test.tsx b/apps/web/src/components/chat/MessagesTimeline.test.tsx
index 5b7584fb6e4..2dacb5bd359 100644
--- a/apps/web/src/components/chat/MessagesTimeline.test.tsx
+++ b/apps/web/src/components/chat/MessagesTimeline.test.tsx
@@ -343,7 +343,7 @@ describe("MessagesTimeline", () => {
expect(compactMarkup).toContain('class="h-3 sm:h-4"');
expect(compactMarkup).not.toContain("topbar-scroll-fade");
- expect(fadedMarkup).toContain('class="h-10 sm:h-12"');
+ expect(fadedMarkup).toContain('class="h-[var(--workspace-titlebar-scroll-fade-height)]"');
expect(fadedMarkup).toContain("topbar-scroll-fade");
});
diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx
index e2232cdd9b9..a0a2d4f84d3 100644
--- a/apps/web/src/components/chat/MessagesTimeline.tsx
+++ b/apps/web/src/components/chat/MessagesTimeline.tsx
@@ -175,7 +175,9 @@ interface TimelineRowActivityState {
const TimelineRowCtx = createContext<TimelineRowSharedState>(null!);
const TimelineRowActivityCtx = createContext<TimelineRowActivityState>(null!);
const TIMELINE_LIST_HEADER = <div className="h-3 sm:h-4" />;
-const TIMELINE_LIST_FADE_HEADER = <div className="h-10 sm:h-12" />;
+const TIMELINE_LIST_FADE_HEADER = (
+ <div className="h-[var(--workspace-titlebar-scroll-fade-height)]" />
+);
// Header row shown when older turns exist beyond the loaded window. Plain
// button, no spinner animation; the label change is the loading indicator.
@@ -189,7 +191,7 @@ function TimelineLoadEarlierHeader({
fade: boolean;
}) {
return (
- <div className={fade ? "pt-10 sm:pt-12" : "pt-3 sm:pt-4"}>
+ <div className={fade ? "pt-[var(--workspace-titlebar-scroll-fade-height)]" : "pt-3 sm:pt-4"}>
<div className="mx-auto w-full max-w-3xl pb-2">
<button
type="button"
diff --git a/apps/web/src/components/settings/settingsLayout.tsx b/apps/web/src/components/settings/settingsLayout.tsx
index 15540ff5932..f5042a912ca 100644
--- a/apps/web/src/components/settings/settingsLayout.tsx
+++ b/apps/web/src/components/settings/settingsLayout.tsx
@@ -250,7 +250,7 @@ export function SettingsPageContainer({
return (
<SettingsSearchTargetProvider targetId={targetId} onTargetHandled={clearTargetHash}>
<div
- className="topbar-scroll-fade scrollbar-gutter-both flex-1 overflow-y-auto [--topbar-scroll-fade-height:1.5rem] sm:[--topbar-scroll-fade-height:1.5rem]"
+ className="topbar-scroll-fade scrollbar-gutter-both flex-1 overflow-y-auto"
data-settings-page-scroll
>
<WorkspacePageContainer width={width} className={cn("gap-12", className)}>
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index d43475f901c..994ec16e0f8 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -111,6 +111,7 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
--workspace-native-controls-inset: 0px;
--workspace-titlebar-control-size: 1.75rem;
--workspace-titlebar-control-gap: 0.75rem;
+ --workspace-titlebar-scroll-fade-height: 1.5rem;
@variant dark {
--appearance-contrast-target: white;
@@ -354,7 +355,6 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
}
@utility topbar-scroll-fade {
- --topbar-scroll-fade-height: 2.5rem;
-webkit-mask-image:
linear-gradient(
to bottom,
@@ -370,8 +370,8 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
-webkit-mask-position: top, bottom, right;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size:
- 100% var(--topbar-scroll-fade-height),
- 100% calc(100% - var(--topbar-scroll-fade-height)),
+ 100% var(--workspace-titlebar-scroll-fade-height),
+ 100% calc(100% - var(--workspace-titlebar-scroll-fade-height)),
var(--app-scrollbar-width) 100%;
mask-image:
linear-gradient(
@@ -388,13 +388,9 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
mask-position: top, bottom, right;
mask-repeat: no-repeat;
mask-size:
- 100% var(--topbar-scroll-fade-height),
- 100% calc(100% - var(--topbar-scroll-fade-height)),
+ 100% var(--workspace-titlebar-scroll-fade-height),
+ 100% calc(100% - var(--workspace-titlebar-scroll-fade-height)),
var(--app-scrollbar-width) 100%;
-
- @variant sm {
- --topbar-scroll-fade-height: 3rem;
- }
}
/* Virtualizers own their native scroll element, so they cannot use ScrollArea's
diff --git a/apps/web/src/routes/_chat.pull-requests.tsx b/apps/web/src/routes/_chat.pull-requests.tsx
index f8894ea5777..841ea3f90e8 100644
--- a/apps/web/src/routes/_chat.pull-requests.tsx
+++ b/apps/web/src/routes/_chat.pull-requests.tsx
@@ -1919,9 +1919,9 @@ function PullRequestsColumn({
<div
ref={scrollRef}
- className="topbar-scroll-fade scrollbar-gutter-both min-h-0 flex-1 overflow-y-auto [--topbar-scroll-fade-height:1.5rem] sm:[--topbar-scroll-fade-height:1.5rem]"
+ className="topbar-scroll-fade scrollbar-gutter-both min-h-0 flex-1 overflow-y-auto"
>
- {/* The top padding is the fade band's own height (1.5rem here), the same pairing the
+ {/* The top padding is the shared fade band's height, the same pairing the
settings page makes: at rest the controls sit fully below the mask, and only
content actually passing under the chrome fades. */}
<WorkspacePageContainer className="gap-4">