From 7fff267e017a6f138d686ad8fd5f44462cb7f9ee Mon Sep 17 00:00:00 2001 From: flamboh Date: Sun, 15 Nov 2026 23:09:44 +0000 Subject: [PATCH 1/5] feat(web): drag the pull requests page and a thread's PR badge into the layout The sidebar's Pull requests button and each thread row's PR badge now drag into the layout the way a thread row does: same drop zones, labels, threshold and Escape. The page lands as its one tab (an open one moves); the badge opens the thread's pull request, or its linked pull requests list, at the drop. Co-Authored-By: Claude Opus 5.5 --- .../src/components/ThreadStatusIndicators.tsx | 20 ++- .../src/components/sidebar/SidebarChrome.tsx | 15 +- .../components/sidebar/SidebarThreadRow.tsx | 13 +- apps/web/src/layout/DropZones.tsx | 5 +- .../web/src/layout/layoutDrag.browser.test.ts | 130 ++++++++++++++++++ apps/web/src/layout/layoutDrag.ts | 88 +++++++++--- apps/web/src/layout/surfaceSync.ts | 3 + apps/web/src/lib/openPullRequestLink.ts | 91 ++++++++---- 8 files changed, 316 insertions(+), 49 deletions(-) create mode 100644 apps/web/src/layout/layoutDrag.browser.test.ts diff --git a/apps/web/src/components/ThreadStatusIndicators.tsx b/apps/web/src/components/ThreadStatusIndicators.tsx index 8ea503be51dca..6e58a12697af9 100644 --- a/apps/web/src/components/ThreadStatusIndicators.tsx +++ b/apps/web/src/components/ThreadStatusIndicators.tsx @@ -29,7 +29,13 @@ import { visibleThreadPullRequests, } from "@t3tools/client-runtime/thread-pull-requests"; import { useRender } from "@base-ui/react/use-render"; -import { type ReactNode, type AnimationEvent, type MouseEvent, type ReactElement } from "react"; +import { + type ReactNode, + type AnimationEvent, + type MouseEvent, + type PointerEvent, + type ReactElement, +} from "react"; import { cn } from "../lib/utils"; import { revealThreadTerminal } from "../lib/revealThreadTerminal"; @@ -254,6 +260,7 @@ export function ThreadPullRequestBadgeControl({ status, onOpenList, onOpenPullRequest, + onPress, appearance = "glyph", }: { render: ReactElement<{ render?: useRender.RenderProp }>; @@ -264,6 +271,7 @@ export function ThreadPullRequestBadgeControl({ status: PrStatusIndicator | null; onOpenList: () => void; onOpenPullRequest: (event: MouseEvent, url?: string) => void; + onPress: (event: PointerEvent, opensList: boolean) => void; appearance?: ThreadPullRequestBadgeAppearance; }) { const presentation = resolveThreadPullRequestBadgePresentation({ badge, number, url, status }); @@ -280,6 +288,7 @@ export function ThreadPullRequestBadgeControl({ pullRequests={pullRequests} onOpenList={onOpenList} onOpenPullRequest={onOpenPullRequest} + onPress={onPress} /> ); } @@ -295,6 +304,7 @@ function PullRequestBadge({ pullRequests, onOpenList, onOpenPullRequest, + onPress, }: { render: ReactElement<{ render?: useRender.RenderProp }>; appearance: ThreadPullRequestBadgeAppearance; @@ -306,6 +316,7 @@ function PullRequestBadge({ pullRequests: ReadonlyArray; onOpenList: () => void; onOpenPullRequest: (event: MouseEvent, url?: string) => void; + onPress: (event: PointerEvent, opensList: boolean) => void; }) { const onClick = opensList ? (event: MouseEvent) => { @@ -317,14 +328,17 @@ function PullRequestBadge({ const element = opensList ? (