Skip to content

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

Go

fix(issues): keep the outline card centered during its enter/exit animation (MUL-10221) (#11587)

Jiayuan Zhangb22efd52926c
diff --git a/packages/views/issues/components/thread-minimap.test.tsx b/packages/views/issues/components/thread-minimap.test.tsx
index d0b3d994c4..489ced0aae 100644
--- a/packages/views/issues/components/thread-minimap.test.tsx
+++ b/packages/views/issues/components/thread-minimap.test.tsx
@@ -283,6 +283,30 @@ describe("ThreadMinimap", () => {
}
});
+ it("keeps the card centered while its enter animation drives translate", () => {
+ const keyframes: Keyframe[][] = [];
+ const animate = vi.fn((frames: Keyframe[]) => {
+ keyframes.push(frames);
+ return { cancel: vi.fn() } as unknown as Animation;
+ });
+ Object.defineProperty(HTMLElement.prototype, "animate", { configurable: true, value: animate });
+ try {
+ renderWithI18n(
+ <ThreadMinimap description={description} threads={threads} scrollContainerEl={null} onJump={vi.fn()} />,
+ );
+ act(() => screen.getByRole("button", { name: "First thread opener" }).focus());
+
+ expect(keyframes[0]?.some((frame) => "translate" in frame)).toBe(true);
+ // A translate utility would be overridden by those keyframes, dropping
+ // the card by half its height until the animation ends.
+ const card = screen.getByRole("list").parentElement!;
+ expect(card.className).not.toMatch(/(?:^|\s)-?translate-/);
+ expect(card).toHaveClass("inset-y-0", "my-auto", "h-fit");
+ } finally {
+ Reflect.deleteProperty(HTMLElement.prototype, "animate");
+ }
+ });
+
it("marks resolved threads in the complete outline", () => {
vi.useFakeTimers({
toFake: ["setTimeout", "clearTimeout", "requestAnimationFrame", "cancelAnimationFrame"],
diff --git a/packages/views/issues/components/thread-minimap.tsx b/packages/views/issues/components/thread-minimap.tsx
index e33de3b37f..2aa64c83f2 100644
--- a/packages/views/issues/components/thread-minimap.tsx
+++ b/packages/views/issues/components/thread-minimap.tsx
@@ -91,8 +91,11 @@ function MinimapOutlineCard({
onPointerLeave={onPointerLeave}
onFocusCapture={onFocusCapture}
onBlurCapture={onBlurCapture}
+ // Centered with auto margins, never a translate utility: the enter/exit
+ // animation writes `translate`, which would drop the card by half its
+ // height mid-animation and overflow the panel into a second scrollbar.
className={cn(
- "absolute top-1/2 right-8 max-h-[calc(100%-3rem)] w-80 max-w-[calc(100vw-4rem)] -translate-y-1/2 origin-right overflow-y-auto overscroll-contain rounded-xl bg-popover p-2 text-body text-popover-foreground shadow-lg ring-1 ring-foreground/10",
+ "absolute inset-y-0 right-8 my-auto h-fit max-h-[calc(100%-3rem)] w-80 max-w-[calc(100vw-4rem)] origin-right overflow-y-auto overscroll-contain rounded-xl bg-popover p-2 text-body text-popover-foreground shadow-lg ring-1 ring-foreground/10",
isPresent ? "pointer-events-auto" : "pointer-events-none",
)}
>