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 23, 05:30 UTC
fix(web): Working threads can be dragged into chat as references again (#19697)
Co-authored-by: Nikita Maximilian Grimm <github@nikitagrimm.de> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 17, 2026 at 23:47 UTC
8f026485df097cca71f80218a514f4d2e13bbf43
3 files changed
+32
-3
apps/web/src/components/Sidebar.logic.test.ts
+27
@@ -2242,6 +2242,33 @@ describe("Working shelf (beta)", () => {
2242
expect(resolveSidebarDropVerb("active", "working")).toBeNull();
2243
});
2244
2245
+ it.each([
2246
+ ["pinned", "p1"],
2247
+ ["active", "a2"],
2248
+ ["settled", "s1"],
2249
+ ] as const)(
2250
+ "does not move a Working thread into %s when its reference drag ends in the sidebar",
2251
+ (section, overKey) => {
2252
+ const target = resolveSidebarDropTarget(items, "w1", overKey);
2253
+ expect(target?.section).toBe(section);
2254
+ expect(
2255
+ planSidebarThreadDrop({
2256
+ activeKey: "w1",
2257
+ activeSection: "working",
2258
+ target: target!,
2259
+ pinnedOrder: ["p1"],
2260
+ pinnedKeysById: new Map([["p1", "m"]]),
2261
+ activeOrder: ["a1", "a2"],
2262
+ activeKeysById: new Map([
2263
+ ["a1", "f"],
2264
+ ["a2", "t"],
2265
+ ]),
2266
+ activeTimeOrdered: true,
2267
+ }),
2268
+ ).toEqual({ kind: "none" });
2269
+ },
2270
+ );
2271
+
2272
it("arranges the rows it can write when another row's server cannot store an order", () => {
2273
const plan = planSidebarThreadDrop({
2274
activeKey: "a2",
apps/web/src/components/Sidebar.logic.ts
+3
-1
@@ -115,7 +115,8 @@ export const animateSidebarLayoutChanges: AnimateLayoutChanges = (args) =>
115
116
// Snoozed rows can leave the shelf, but dropping into it is not supported
117
// because snoozing requires a wake time. The Working shelf (beta) follows live
118
-// status, so it is neither a drag source nor a destination.
118
+// status, so its rows only drag out as chat context, never between sidebar
119
+// sections.
120
121
export type SidebarSection = "pinned" | "active" | "working" | "snoozed" | "settled";
122
@@ -290,6 +291,7 @@ export function planSidebarThreadDrop(input: {
291
activeKeysById,
292
activeReorderableKeys,
293
} = input;
294
+ if (activeSection === "working") return { kind: "none" };
295
if (input.supportsSettlement === false && (target.section === "settled" || activeSettled)) {
296
return { kind: "none" };
297
}
apps/web/src/components/Sidebar.tsx
+2
-2
@@ -3314,7 +3314,8 @@ export default function Sidebar() {
3314
listMotionRef.current?.update(false);
3315
};
3316
3317
- const isContextDrag = dragState?.contextDrag === true;
3317
+ // Working rows can supply chat context, but never preview sidebar movement.
3318
+ const isContextDrag = dragState?.contextDrag === true || dragState?.activeSection === "working";
3319
const dragTargetSection = isContextDrag ? null : (dragState?.targetSection ?? null);
3320
const finishThreadDrag = (started: boolean) => {
3321
dragSensorRef.current = null;
@@ -4799,7 +4800,6 @@ export default function Sidebar() {
4800
contextDrag={isContextDrag}
4801
sortableDisabled={
4802
renamingThreadKey === threadKey ||
4802
- section === "working" ||
4803
!draggableThreadKeys.has(threadKey) ||
4804
optimisticDrop !== null
4805
}