Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(sidebar): top/bottom scroll fade mask (MUL-2150) (#2536)

Naiyuan Qingcde3867d3b36
diff --git a/packages/core/paths/consistency.test.ts b/packages/core/paths/consistency.test.ts
index be94f435ed..422b47df50 100644
--- a/packages/core/paths/consistency.test.ts
+++ b/packages/core/paths/consistency.test.ts
@@ -22,6 +22,7 @@ describe("paths.workspace() shape", () => {
"projects",
"autopilots",
"agents",
+ "squads",
"inbox",
"myIssues",
"runtimes",
@@ -42,6 +43,7 @@ describe("paths.workspace() shape", () => {
["projects", "projects"],
["autopilots", "autopilots"],
["agents", "agents"],
+ ["squads", "squads"],
["inbox", "inbox"],
["myIssues", "my-issues"],
["runtimes", "runtimes"],
diff --git a/packages/ui/hooks/use-scroll-fade.ts b/packages/ui/hooks/use-scroll-fade.ts
index 827098716b..718f5a7393 100644
--- a/packages/ui/hooks/use-scroll-fade.ts
+++ b/packages/ui/hooks/use-scroll-fade.ts
@@ -43,11 +43,19 @@ export function useScrollFade(
el.addEventListener("scroll", update, { passive: true });
const ro = new ResizeObserver(update);
ro.observe(el);
+ // ResizeObserver only fires on the container's own box. When children
+ // grow inside a flex/auto-height parent (e.g. async-loaded list items,
+ // collapsibles), scrollHeight changes but clientHeight does not — the
+ // mask would stay "none" until the user scrolls. MutationObserver on
+ // childList catches those content insertions.
+ const mo = new MutationObserver(update);
+ mo.observe(el, { childList: true, subtree: true });
return () => {
cancelAnimationFrame(frame);
el.removeEventListener("scroll", update);
ro.disconnect();
+ mo.disconnect();
};
}, [ref, update]);
diff --git a/packages/views/layout/app-sidebar.tsx b/packages/views/layout/app-sidebar.tsx
index 1b10a2e2f4..93f9f86ea8 100644
--- a/packages/views/layout/app-sidebar.tsx
+++ b/packages/views/layout/app-sidebar.tsx
@@ -2,6 +2,7 @@
import React, { useCallback, useEffect, useRef, useState } from "react";
import { cn } from "@multica/ui/lib/utils";
+import { useScrollFade } from "@multica/ui/hooks/use-scroll-fade";
import { AppLink, useNavigation } from "../navigation";
import { HelpLauncher } from "./help-launcher";
import {
@@ -367,6 +368,8 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
const deletePin = useDeletePin();
const reorderPins = useReorderPins();
const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } }));
+ const sidebarScrollRef = useRef<HTMLDivElement>(null);
+ const sidebarFadeStyle = useScrollFade(sidebarScrollRef, 24);
// Local presentational copy of pinnedItems for drop-animation stability.
// Follows TQ at rest; frozen during a drag gesture so a mid-drag cache
@@ -606,7 +609,7 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
</SidebarHeader>
{/* Navigation */}
- <SidebarContent>
+ <SidebarContent ref={sidebarScrollRef} style={sidebarFadeStyle}>
<SidebarGroup>
<SidebarGroupContent>
<SidebarMenu className="gap-0.5">