From f8ef4688ea066e444a98dc91bf4ae133ead035c4 Mon Sep 17 00:00:00 2001 From: bchbib <1023915+bchbib@users.noreply.github.com> Date: Tue, 1 Dec 2026 17:07:31 +0100 Subject: [PATCH] feat(ui): collapse a list on the board to a narrow strip A board with several finished lists gives them a large share of its width, although they are rarely read; the lists in use end up off-screen. Each list header gets a collapse button. A collapsed list is a 44px strip as tall as the board with its name (written top to bottom), its ticket count and an expand button; a click anywhere on the strip expands it. - The strip stays a drop zone: a card dragged onto it glows it like any target list and lands at the top of that list (there is no position to aim for). The card keeps its shape over the strip and no cards are rendered inside a collapsed list. - Which lists are collapsed is a view preference, kept per board and per browser in localStorage like watches. Nothing is written to .wipe/ and nothing changes for teammates or agents. - Works while rewinding history (read-only) and on phones. Co-Authored-By: Claude Fable 5.2 --- apps/desktop/src/lib/components/Board.svelte | 3 + apps/desktop/src/lib/components/Column.svelte | 131 ++++++++++++++++-- apps/desktop/src/lib/stores/board.ts | 3 + apps/desktop/src/lib/stores/collapsed.ts | 43 ++++++ 4 files changed, 172 insertions(+), 8 deletions(-) create mode 100644 apps/desktop/src/lib/stores/collapsed.ts diff --git a/apps/desktop/src/lib/components/Board.svelte b/apps/desktop/src/lib/components/Board.svelte index 4b55d65..012a4df 100644 --- a/apps/desktop/src/lib/components/Board.svelte +++ b/apps/desktop/src/lib/components/Board.svelte @@ -13,6 +13,7 @@ moveList, deleteList } from '$lib/stores/board'; + import { collapsed, toggleCollapsed } from '$lib/stores/collapsed'; import type { List, Ticket } from '$lib/types'; let { onopen, onadd }: { onopen: (t: Ticket) => void; onadd: (id: string, name: string) => void } = @@ -158,6 +159,7 @@ {flipMs} {dragActive} {overTrash} + collapsed={$collapsed.includes(col.list)} dragDisabled={$rewinding} canMoveLeft={i > 0} canMoveRight={i < cols.length - 1} @@ -166,6 +168,7 @@ onmove={handleMove} onrename={(id, name) => renameList(id, name)} ondelete={(id) => deleteList(id)} + oncollapse={toggleCollapsed} onconsider={handleConsider} onfinalize={handleFinalize} ondragel={(el) => (draggedEl = el)} diff --git a/apps/desktop/src/lib/components/Column.svelte b/apps/desktop/src/lib/components/Column.svelte index 3cd82ca..d1da47e 100644 --- a/apps/desktop/src/lib/components/Column.svelte +++ b/apps/desktop/src/lib/components/Column.svelte @@ -6,6 +6,8 @@ MoreHorizontal, ChevronLeft, ChevronRight, + ChevronsLeftRight, + ChevronsRightLeft, Pencil, Trash2, Bell, @@ -25,6 +27,7 @@ dragDisabled, dragActive = false, overTrash = false, + collapsed = false, canMoveLeft = false, canMoveRight = false, onopen, @@ -32,6 +35,7 @@ onmove, onrename, ondelete, + oncollapse, onconsider, onfinalize, ondragel @@ -43,6 +47,7 @@ dragDisabled: boolean; dragActive?: boolean; overTrash?: boolean; + collapsed?: boolean; canMoveLeft?: boolean; canMoveRight?: boolean; onopen: (t: Ticket) => void; @@ -50,6 +55,7 @@ onmove?: (listId: string, dir: -1 | 1) => void; onrename?: (listId: string, name: string) => void; ondelete?: (listId: string) => void; + oncollapse?: (listId: string) => void; onconsider: (listId: string, items: Ticket[]) => void; onfinalize: (listId: string, items: Ticket[], info: { id: string; trigger: string }) => void; ondragel?: (el: HTMLElement | null) => void; @@ -157,6 +163,18 @@ if (before?.size && zone) play(zone, before); }); + // A collapsed list is a narrow strip: name, count, expand button. It stays a + // drop zone (the strip itself), but shows no cards, so there is no position to + // aim for - a card dropped on it goes to the top of the list, where it is the + // first thing seen when the list is expanded again. + function finalize(items: Ticket[], info: { id: string; trigger: string }) { + if (collapsed && info.trigger === 'droppedIntoZone') { + const dropped = items.find((t) => t.id === info.id); + if (dropped) items = [dropped, ...items.filter((t) => t.id !== info.id)]; + } + onfinalize(listId, items, info); + } + let renaming = $state(false); let renameDraft = $state(''); @@ -171,7 +189,25 @@ } -
+
+ {#if collapsed} + + + {/if}
{#if renaming} @@ -194,8 +230,19 @@ >{#if $searchMatches}{shown}/{tickets.length}{:else}{tickets.length}{/if} {/if} + {#if !renaming} + + {/if} {#if !dragDisabled} - @@ -276,7 +323,10 @@ // A release over the trash is outside every zone, so the library would // first animate the card back to its origin and only then let it vanish. // Over the bin, skip that return trip: the card is being deleted. - dropAnimationDisabled: overTrash, + // Nor is there a slot to fly to in a collapsed list, or a card size to take + // on there: the card keeps its shape over the strip and lands at once. + dropAnimationDisabled: overTrash || collapsed, + morphDisabled: collapsed, // Disable the library's built-in target styling: it highlights EVERY valid // zone. We glow just the hovered column ourselves via `isTarget` below. dropTargetStyle: {}, @@ -298,8 +348,7 @@ } }} onconsider={(e: CustomEvent>) => onconsider(listId, e.detail.items)} - onfinalize={(e: CustomEvent>) => - onfinalize(listId, e.detail.items, e.detail.info)} + onfinalize={(e: CustomEvent>) => finalize(e.detail.items, e.detail.info)} > {#each tickets as ticket (ticket.id)}
- {#if marker in ticket} + {#if collapsed} + + {:else if marker in ticket}
@@ -323,7 +375,7 @@ - {#if !dragDisabled} + {#if !dragDisabled && !collapsed} @@ -332,7 +384,7 @@