@devries-cameron20 / t3code Mirror · read-only / commits / 221610f0ca
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 13:15 UTC

fix(web): keep settled drop hint inside the sidebar viewport (#26736)

Yash Singh committed Oct 28, 2026 at 19:58 UTC 221610f0caa9f84a94e99e72afe5d305c753c322
1 file changed +10 -2
apps/web/src/components/sidebar/SidebarListMarkers.tsx
+10 -2
@@ -1,7 +1,7 @@
1 import { CollapsibleSectionHeader } from "../ui/collapsible-section-header";
2 import { useSortable } from "@dnd-kit/sortable";
3 import { CSS } from "@dnd-kit/utilities";
4 -import { type ReactNode } from "react";
4 +import { type ReactNode, useLayoutEffect } from "react";
5 import { cn } from "~/lib/utils";
6 import {
7 animateSidebarLayoutChanges,
@@ -15,13 +15,20 @@ function SortableSidebarMarker(props: {
15 marker: SidebarListMarker;
16 className?: string;
17 children?: ReactNode;
18 + revealOverflow?: boolean;
19 "data-testid"?: string;
20 }) {
20 - const { setNodeRef, transform, transition } = useSortable({
21 + const { node, setNodeRef, transform, transition } = useSortable({
22 id: sidebarMarkerId(props.marker),
23 disabled: SIDEBAR_SORTABLE_DRAG_DISABLED,
24 animateLayoutChanges: animateSidebarLayoutChanges,
25 });
26 + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- keeps the projected drop box inside the scroll viewport as drag transforms move it
27 + useLayoutEffect(() => {
28 + if (props.revealOverflow && transform?.y !== undefined) {
29 + node.current?.firstElementChild?.scrollIntoView({ block: "nearest", inline: "nearest" });
30 + }
31 + }, [node, props.revealOverflow, transform?.y]);
32 return (
33 <li
34 ref={setNodeRef}
@@ -50,6 +57,7 @@ export function SidebarSectionPlaceholder(props: {
57 marker={props.marker}
58 data-testid={`sidebar-${props.marker}`}
59 className="relative mx-0.5 -mb-px h-0"
60 + revealOverflow={props.marker === "settled-placeholder" && props.showHint}
61 >
62 {props.showHint ? (
63 <div