diff --git a/web/src/app/page.tsx b/web/src/app/page.tsx index 41fb0a4..6e6134b 100644 --- a/web/src/app/page.tsx +++ b/web/src/app/page.tsx @@ -68,7 +68,7 @@ const ALL_COLUMNS: ColumnConfig[] = [ function baseColumns(): ColumnConfig[] { return [ { key: "id", label: "ID", width: 100, visible: true }, - { key: "subject", label: "Subject", width: 320, visible: true }, + { key: "subject", label: "Subject", width: 400, visible: true }, { key: "status", label: "Status", width: 120, visible: true }, { key: "queue", label: "Queue", width: 140, visible: true }, { key: "owner", label: "Owner", width: 130, visible: true }, @@ -575,18 +575,26 @@ function TicketWorkbenchContent() { return next; }); }; - const handleColumnResize = (colKey: string, e: React.MouseEvent) => { + const handleColumnResize = (leftKey: string, rightKey: string | null, e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); - setResizingCol(colKey); + setResizingCol(leftKey); const startX = e.clientX; - const col = columns.find((c) => c.key === colKey); - const startWidth = col?.width ?? 120; + const leftCol = columns.find((c) => c.key === leftKey); + const rightCol = rightKey ? columns.find((c) => c.key === rightKey) : null; + const leftStart = leftCol?.width ?? 140; + const rightStart = rightCol?.width ?? 140; const onMove = (ev: MouseEvent) => { - const newWidth = Math.max(50, Math.min(800, startWidth + (ev.clientX - startX))); + const delta = ev.clientX - startX; + const newLeft = Math.max(50, Math.min(800, leftStart + delta)); + const newRight = rightCol ? Math.max(50, Math.min(800, rightStart - delta)) : undefined; setColumns((prev) => - prev.map((c) => (c.key === colKey ? { ...c, width: newWidth } : c)) + prev.map((c) => { + if (c.key === leftKey) return { ...c, width: newLeft }; + if (rightCol && c.key === rightCol.key) return { ...c, width: newRight! }; + return c; + }) ); }; const onUp = () => { @@ -894,13 +902,13 @@ function TicketWorkbenchContent() {
{/* Resize handle: drags the boundary, resizes the column to the LEFT */} {idx > 0 && (
handleColumnResize(arr[idx - 1].key, e)} + onMouseDown={(e) => handleColumnResize(arr[idx - 1].key, col.key, e)} /> )}