Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(desktop): hand cursors, lifted rows and a smooth side panel
leepokai63c6730140e3
diff --git a/apps/desktop/src/renderer/components/Controls.tsx b/apps/desktop/src/renderer/components/Controls.tsxindex 0137e2ab..aebb36b7 100644--- a/apps/desktop/src/renderer/components/Controls.tsx+++ b/apps/desktop/src/renderer/components/Controls.tsx@@ -267,12 +267,15 @@ export function ResizeHandle({ label, width, min, max, edge, onResize, onDragginconst end = () => {if (!start.current) returnstart.current = null+ document.documentElement.classList.remove('col-resizing')onDragging?.(false)}const onPointerDown = (e: PointerEvent) => {if (e.button !== 0) returne.currentTarget.setPointerCapture(e.pointerId)start.current = { x: e.clientX, width }+ // While dragging, the resize cursor stays wherever the pointer goes.+ document.documentElement.classList.add('col-resizing')onDragging?.(true)}const onPointerMove = (e: PointerEvent) => {diff --git a/apps/desktop/src/renderer/lib/pointer-drag.test.ts b/apps/desktop/src/renderer/lib/pointer-drag.test.tsnew file mode 100644index 00000000..2b475c79--- /dev/null+++ b/apps/desktop/src/renderer/lib/pointer-drag.test.ts@@ -0,0 +1,70 @@+import assert from 'node:assert/strict'+import { test } from 'node:test'+import type { Point, PointerDragHandlers } from './pointer-drag.ts'++// A window and document just big enough for the drag: events, the root's classes, hit-testing.+const target = new EventTarget()+const classes = new Set<string>()+Object.assign(globalThis, {+ window: target,+ document: {+ documentElement: { classList: { add: (c: string) => classes.add(c), remove: (c: string) => classes.delete(c) } },+ elementFromPoint: () => null,+ },+})+const { pointerDrag } = await import('./pointer-drag.ts')++const fire = (type: string, props: Record<string, unknown> = {}) => target.dispatchEvent(Object.assign(new Event(type), props))+const press = (handlers: PointerDragHandlers) =>+ pointerDrag(handlers).onPointerDown({ button: 0, clientX: 0, clientY: 0, metaKey: false, ctrlKey: false, shiftKey: false } as never)++function recorder() {+ const calls: string[] = []+ return {+ calls,+ handlers: {+ start: (from: Point) => calls.push(`start ${from.x},${from.y}`),+ over: (at: Point) => calls.push(`over ${at.x},${at.y}`),+ drop: () => calls.push('drop'),+ cancel: () => calls.push('cancel'),+ },+ }+}++test('a press only becomes a drag past a few points, then reports moves and the drop', () => {+ const { calls, handlers } = recorder()+ press(handlers)+ fire('pointermove', { clientX: 2, clientY: 1 })+ assert.deepEqual(calls, [])+ fire('pointermove', { clientX: 0, clientY: 10 })+ assert.equal(classes.has('pointer-dragging'), true)+ fire('pointerup')+ assert.deepEqual(calls, ['start 0,0', 'over 0,10', 'drop'])+ assert.equal(classes.has('pointer-dragging'), false)+ // Nothing listens after the release.+ fire('pointermove', { clientX: 0, clientY: 40 })+ assert.equal(calls.length, 3)+})++test('a click without travel is not a drag', () => {+ const { calls, handlers } = recorder()+ press(handlers)+ fire('pointerup')+ assert.deepEqual(calls, [])+})++test('Escape or a cancelled pointer ends the drag without a drop', () => {+ const escape = recorder()+ press(escape.handlers)+ fire('pointermove', { clientX: 0, clientY: 10 })+ fire('keydown', { key: 'Escape' })+ fire('pointerup')+ assert.deepEqual(escape.calls, ['start 0,0', 'over 0,10', 'cancel'])++ const cancelled = recorder()+ press(cancelled.handlers)+ fire('pointermove', { clientX: 0, clientY: 10 })+ fire('pointercancel')+ assert.deepEqual(cancelled.calls, ['start 0,0', 'over 0,10', 'cancel'])+ assert.equal(classes.has('pointer-dragging'), false)+})diff --git a/apps/desktop/src/renderer/lib/pointer-drag.ts b/apps/desktop/src/renderer/lib/pointer-drag.tsnew file mode 100644index 00000000..e8a4cd77--- /dev/null+++ b/apps/desktop/src/renderer/lib/pointer-drag.ts@@ -0,0 +1,84 @@+import type { PointerEvent as ReactPointerEvent } from 'react'++/** How far the pointer travels before a press becomes a drag. */+const THRESHOLD = 4++export interface Point {+ x: number+ y: number+}++export interface PointerDragHandlers {+ /** The press (at `from`) has moved far enough: the drag starts. */+ start: (from: Point) => void+ /** The pointer moved while dragging: where it is, and what's under it. */+ over: (at: Point, under: Element | null) => void+ /** Released after dragging. */+ drop: () => void+ /** Escape, a cancelled pointer, or the window losing focus. */+ cancel: () => void+}++/**+ * Reorders by dragging with the pointer instead of native drag and drop, whose cursor a page can't+ * set: past a few points the drag starts, every element shows a closed hand, `over` reports what's+ * under the pointer, and the click that ends the drag is swallowed. Spread the result of+ * `pointerDrag(handlers)` on the element that's held.+ */+export function pointerDrag(handlers: PointerDragHandlers) {+ return {+ onPointerDown(event: ReactPointerEvent) {+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey) return+ const origin = { x: event.clientX, y: event.clientY }+ let dragging = false+ const end = () => {+ window.removeEventListener('pointermove', move)+ window.removeEventListener('pointerup', up)+ window.removeEventListener('pointercancel', cancel)+ window.removeEventListener('keydown', key, true)+ window.removeEventListener('blur', cancel)+ document.documentElement.classList.remove('pointer-dragging')+ }+ const move = (e: PointerEvent) => {+ if (!dragging) {+ if (Math.hypot(e.clientX - origin.x, e.clientY - origin.y) < THRESHOLD) return+ dragging = true+ document.documentElement.classList.add('pointer-dragging')+ handlers.start(origin)+ }+ handlers.over({ x: e.clientX, y: e.clientY }, document.elementFromPoint(e.clientX, e.clientY))+ }+ const up = () => {+ end()+ if (!dragging) return+ handlers.drop()+ swallowNextClick()+ }+ const cancel = () => {+ end()+ if (dragging) handlers.cancel()+ }+ const key = (e: KeyboardEvent) => {+ if (e.key !== 'Escape' || !dragging) return+ e.preventDefault()+ e.stopPropagation()+ cancel()+ }+ window.addEventListener('pointermove', move)+ window.addEventListener('pointerup', up)+ window.addEventListener('pointercancel', cancel)+ window.addEventListener('keydown', key, true)+ window.addEventListener('blur', cancel)+ },+ }+}++/** The click a browser sends after the release that ended a drag must not open what was held. */+function swallowNextClick() {+ const swallow = (e: MouseEvent) => {+ e.preventDefault()+ e.stopPropagation()+ }+ window.addEventListener('click', swallow, { capture: true, once: true })+ setTimeout(() => window.removeEventListener('click', swallow, true), 0)+}diff --git a/apps/desktop/src/renderer/styles/theme.css b/apps/desktop/src/renderer/styles/theme.cssindex 42eb7ce3..67bd3cf9 100644--- a/apps/desktop/src/renderer/styles/theme.css+++ b/apps/desktop/src/renderer/styles/theme.css@@ -174,9 +174,21 @@ button {border: none;padding: 0;margin: 0;- cursor: default;text-align: inherit;}+/* Anything clickable shows the pointing hand; :where keeps it below each view's own cursor. */+:where(button:not(:disabled), a[href], [role='button'], [role='tab'], [role='switch'], [role='menuitem'], [role='menuitemradio'], [role='option'], select, summary, label:has(input)) {+ cursor: pointer;+}+/* A drag in progress (lib/pointer-drag.ts, ResizeHandle) keeps its cursor wherever the pointer goes. */+.pointer-dragging,+.pointer-dragging * {+ cursor: grabbing !important;+}+.col-resizing,+.col-resizing * {+ cursor: col-resize !important;+}button:focus-visible,[role="separator"]:focus-visible {outline: 2px solid var(--secondary);diff --git a/apps/desktop/src/renderer/views/BotRoster.tsx b/apps/desktop/src/renderer/views/BotRoster.tsxindex 010989ff..fa7b839e 100644--- a/apps/desktop/src/renderer/views/BotRoster.tsx+++ b/apps/desktop/src/renderer/views/BotRoster.tsx@@ -1,6 +1,9 @@-import { useRef, useState, type DragEvent, type ReactNode } from 'react'+import { useRef, useState, type ReactNode, type RefObject } from 'react'+import { createPortal } from 'react-dom'import { isGroup, type Bot } from '@shared/models'import { moveInOrder } from '../lib/computer-roster'+import { pointerDrag, type Point } from '../lib/pointer-drag'+import { reduceMotion } from '../lib/theme'import { useSlide } from '../lib/slide'import { sameRef, refKey, type RosterItem } from '../store/app-model'import type { BotStore } from '../store/bot-store'@@ -16,6 +19,14 @@ interface BotDrag {ids: string[]}+/** The lifted copy of a dragged row: its width, and where in it the pointer holds it. */+interface Lift {+ item: RosterItem+ width: number+ grab: Point+ at: Point+}+export function BotRoster({ roster, compact, onContext }: {roster: ReturnType<typeof useComputerRoster>compact: boolean@@ -25,7 +36,18 @@ export function BotRoster({ roster, compact, onContext }: {const selected = app.selectionconst [hovered, setHovered] = useState<string | null>(null)const [dragged, setDragged] = useState<string | null>(null)- const [botDrag, setBotDrag] = useState<BotDrag | null>(null)+ const [botDrag, setBotDragState] = useState<BotDrag | null>(null)+ // The drag's handlers outlive the render that started it, so they read the latest drag here.+ const drag = useRef<BotDrag | null>(null)+ const setBotDrag = (next: BotDrag | null) => {+ drag.current = next+ setBotDragState(next)+ }+ const [lift, setLift] = useState<Lift | null>(null)+ const ghost = useRef<HTMLDivElement>(null)+ const grab = useRef<Point>({ x: 0, y: 0 })+ const itemsByKey = useRef(new Map<string, RosterItem>())+ itemsByKey.current = new Map(roster.sections.flatMap((s) => s.items).map((item) => [refKey(item.ref), item]))/** A section's rows, in the order a drag in progress has them. */const ordered = (computerId: string, items: RosterItem[]) => {@@ -34,51 +56,74 @@ export function BotRoster({ roster, compact, onContext }: {return botDrag.ids.flatMap((id) => byId.get(id) ?? [])}- // Any row of the same computer takes the drop (on enter and over); only rows with the same pin state make room.- const dragOver = (event: DragEvent<HTMLElement>, item: RosterItem) => {- if (!botDrag || botDrag.item.ref.computerId !== item.ref.computerId) return- event.preventDefault()- event.dataTransfer.dropEffect = 'move'+ // The row lifts: a copy follows the pointer from where it was grabbed; the row's slot stays open.+ const liftRow = (item: RosterItem, siblings: RosterItem[], from: Point) => {+ const rect = rowRect(item)+ setBotDrag({ item, ids: siblings.map((s) => s.bot.id) })+ if (!rect) return+ grab.current = { x: from.x - rect.left, y: from.y - rect.top }+ setLift({ item, width: rect.width, grab: grab.current, at: from })+ }++ // Any row of the same computer is a target; only rows with the same pin state make room.+ const dragOver = (at: Point, under: Element | null) => {+ if (ghost.current) ghost.current.style.translate = ghostTranslate(at, grab.current)+ const current = drag.current+ const row = under?.closest<HTMLElement>('[data-roster-row]')+ const item = row && itemsByKey.current.get(row.dataset.rosterRow!)+ if (!current || !row || !item || current.item.ref.computerId !== item.ref.computerId) return// A row still sliding out of the way would be hit again where it was.- if (item.bot.id === botDrag.item.bot.id || item.bot.pinned !== botDrag.item.bot.pinned || event.currentTarget.getAnimations().length) return- setBotDrag({ ...botDrag, ids: moveInOrder(botDrag.ids, botDrag.item.bot.id, item.bot.id) })+ if (item.bot.id === current.item.bot.id || item.bot.pinned !== current.item.bot.pinned || row.getAnimations().length) return+ setBotDrag({ ...current, ids: moveInOrder(current.ids, current.item.bot.id, item.bot.id) })}- const drop = (event: DragEvent<HTMLElement>) => {- if (!botDrag) return- event.preventDefault()- if (botDrag.ids.some((id, index) => id !== botDrag.item.store.roster[index]?.id)) botDrag.item.store.reorder(botDrag.ids)+ const endDrag = () => {setBotDrag(null)+ setLift(null)+ }++ // The copy settles into the row's new slot, then the row shows again.+ const drop = () => {+ const current = drag.current+ if (!current) return endDrag()+ if (current.ids.some((id, index) => id !== current.item.store.roster[index]?.id)) current.item.store.reorder(current.ids)+ const slot = rowRect(current.item)+ if (!slot || !ghost.current || reduceMotion()) return endDrag()+ ghost.current.classList.add('settling')+ ghost.current.style.translate = `${slot.left}px ${slot.top}px`+ setTimeout(endDrag, SETTLE_MS)}const row = (item: RosterItem, siblings: RosterItem[]) => {const key = refKey(item.ref)const isSelected = sameRef(item.ref, selected)- // The held row is drawn as hovered: it is the only copy of itself while dragging (no drag image).+ // The held row shows as hovered, or as an empty slot while its lifted copy follows the pointer.const held = botDrag?.item.bot.id === item.bot.id && botDrag.item.ref.computerId === item.ref.computerIdconst many = roster.sections.length > 1return (<RosterRowkey={key}- background={isSelected ? 'var(--roster-selected)' : hovered === key || held ? 'var(--bubble-agent)' : 'transparent'}+ hovered={hovered === key || held}compact={compact}label={many ? `${item.bot.name}, on ${item.store.hostName}` : item.bot.name}title={many ? `${item.bot.name} · ${item.store.hostName}` : item.bot.name}selected={isSelected}- onHover={(on) => setHovered((h) => (on ? key : h === key ? null : h))}+ dragKey={key}+ onHover={(on) => {+ if (drag.current) return+ setHovered((h) => (on ? key : h === key ? null : h))+ }}onClick={() => app.select(item.ref)}onContext={(x, y) => onContext(item.bot, item.store, x, y)}- onDragStart={() => setBotDrag({ item, ids: siblings.map((s) => s.bot.id) })}- onDragOver={(event) => dragOver(event, item)}- onDrop={drop}- onDragEnd={() => setBotDrag(null)}+ lifted={held && lift !== null}+ drag={pointerDrag({ start: (from) => liftRow(item, siblings, from), over: dragOver, drop, cancel: endDrag })}>- <BotRow bot={item.bot} store={item.store} compact={compact} usingComputer={item.store.screen?.agentBot === item.bot.id} members={isGroup(item.bot) ? item.store.members(item.bot) : noMembers} />+ <RosterBotRow item={item} compact={compact} /></RosterRow>)}- return roster.sections.map(({ computer, store, items }, index) => {+ const sections = roster.sections.map(({ computer, store, items }, index) => {const notice = store.mismatch && !compact ? <StoreContext.Provider value={store}><UpdateNeededCard /></StoreContext.Provider> : nullconst rows = ordered(computer.id, items).map((item) => row(item, items))if (!roster.grouped) return <div key={computer.id}>{notice}{rows}</div>@@ -92,22 +137,44 @@ export function BotRoster({ roster, compact, onContext }: {</ComputerRosterSection>)})+ return (+ <>+ {sections}+ {lift ? <RosterGhost lift={lift} ghost={ghost} compact={compact} /> : null}+ </>+ )+}++/** The lifted row under the pointer (iOS's lifted cell): a smaller, translucent copy that follows it. */+function RosterGhost({ lift, ghost, compact }: { lift: Lift; ghost: RefObject<HTMLDivElement | null>; compact: boolean }) {+ return createPortal(+ <div ref={ghost} className="roster-ghost" style={{ width: lift.width, translate: ghostTranslate(lift.at, lift.grab) }}>+ <div className={`roster-row roster-ghost-card ${compact ? 'compact' : ''}`} style={{ transformOrigin: `${lift.grab.x}px ${lift.grab.y}px` }}>+ <RosterBotRow item={lift.item} compact={compact} />+ </div>+ </div>,+ document.body,+ )+}++function RosterBotRow({ item, compact }: { item: RosterItem; compact: boolean }) {+ return <BotRow bot={item.bot} store={item.store} compact={compact} usingComputer={item.store.screen?.agentBot === item.bot.id} members={isGroup(item.bot) ? item.store.members(item.bot) : noMembers} />}/** One roster button: drags to reorder, and slides when the others move. */-function RosterRow({ background, compact, label, title, selected, onHover, onClick, onContext, onDragStart, onDragOver, onDrop, onDragEnd, children }: {- background: string+function RosterRow({ hovered, lifted, compact, label, title, selected, dragKey, onHover, onClick, onContext, drag, children }: {+ hovered: boolean+ /** Its copy is under the pointer: the row keeps its slot empty. */+ lifted: booleancompact: booleanlabel: stringtitle: stringselected: boolean+ dragKey: stringonHover: (on: boolean) => voidonClick: () => voidonContext: (x: number, y: number) => void- onDragStart: () => void- onDragOver: (event: DragEvent<HTMLElement>) => void- onDrop: (event: DragEvent<HTMLElement>) => void- onDragEnd: () => void+ drag: ReturnType<typeof pointerDrag>children: ReactNode}) {const ref = useRef<HTMLButtonElement>(null)@@ -115,12 +182,11 @@ function RosterRow({ background, compact, label, title, selected, onHover, onClireturn (<buttonref={ref}- className="roster-row"- style={{ padding: compact ? 0 : '0 8px', background }}+ className={`roster-row ${compact ? 'compact' : ''} ${hovered ? 'hovered' : ''} ${selected ? 'selected' : ''} ${lifted ? 'lifted' : ''}`}aria-label={label}aria-current={selected || undefined}title={title}- draggable+ data-roster-row={dragKey}onMouseEnter={() => onHover(true)}onMouseLeave={() => onHover(false)}onClick={onClick}@@ -128,17 +194,7 @@ function RosterRow({ background, compact, label, title, selected, onHover, onClie.preventDefault()onContext(e.clientX, e.clientY)}}- onDragStart={(e) => {- // Its own type, so the composer and other apps don't take it as text.- e.dataTransfer.effectAllowed = 'move'- e.dataTransfer.setData('application/x-codync-bot', label)- e.dataTransfer.setDragImage(blankDragImage, 0, 0)- onDragStart()- }}- onDragEnter={onDragOver}- onDragOver={onDragOver}- onDrop={onDrop}- onDragEnd={onDragEnd}+ {...drag}>{children}</button>@@ -147,5 +203,15 @@ function RosterRow({ background, compact, label, title, selected, onHover, onCliconst noMembers: Bot[] = []-/** A transparent pixel, so a dragged row has no translucent copy under the pointer; the row itself moves in the list. */-const blankDragImage = Object.assign(new Image(), { src: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' })+/** How long the lifted copy takes to settle into its slot (`--morph`). */+const SETTLE_MS = 200++/** Where a row is on screen now. */+function rowRect(item: RosterItem): DOMRect | undefined {+ return document.querySelector(`[data-roster-row="${CSS.escape(refKey(item.ref))}"]`)?.getBoundingClientRect()+}++/** The lifted copy's `translate` that keeps the point it was grabbed by under the pointer. */+function ghostTranslate(at: Point, grab: Point): string {+ return `${at.x - grab.x}px ${at.y - grab.y}px`+}diff --git a/apps/desktop/src/renderer/views/ComputerRosterSection.tsx b/apps/desktop/src/renderer/views/ComputerRosterSection.tsxindex 07991881..e50135ca 100644--- a/apps/desktop/src/renderer/views/ComputerRosterSection.tsx+++ b/apps/desktop/src/renderer/views/ComputerRosterSection.tsx@@ -1,5 +1,6 @@import { useRef, type ReactNode } from 'react'import { Icon } from '../components/Icon'+import { pointerDrag } from '../lib/pointer-drag'import { useSlide } from '../lib/slide'import type { BotStore } from '../store/bot-store'import { ComputerBadge } from './ComputerBadge'@@ -21,31 +22,30 @@ interface Props {export function ComputerRosterSection({ store, compact, collapsed, previous, next, dragged, setDragged, toggle, move, notice, children }: Props) {const section = useRef<HTMLElement>(null)+ const dropTarget = useRef<string | null>(null)const id = store.computer.iduseSlide(section)+ const drag = pointerDrag({+ start: () => {+ dropTarget.current = null+ setDragged(id)+ },+ over: (_, under) => {+ dropTarget.current = under?.closest<HTMLElement>('[data-computer-section]')?.dataset.computerSection ?? null+ },+ drop: () => {+ if (dropTarget.current && dropTarget.current !== id) move(id, dropTarget.current)+ setDragged(null)+ },+ cancel: () => setDragged(null),+ })return (- <section ref={section} className={`computer-roster-section ${dragged === id ? 'dragging' : ''}`} aria-label={store.hostName}- onDragOver={(event) => {- if (!dragged || dragged === id) return- event.preventDefault()- event.dataTransfer.dropEffect = 'move'- }}- onDrop={(event) => {- if (!dragged) return- event.preventDefault()- move(dragged, id)- setDragged(null)- }}>+ <section ref={section} className={`computer-roster-section ${dragged === id ? 'dragging' : ''}`} aria-label={store.hostName} data-computer-section={id}><div className="computer-roster-heading">- <button className="computer-roster-toggle" draggable aria-expanded={!collapsed}+ <button className="computer-roster-toggle" aria-expanded={!collapsed}aria-label={`${store.hostName}, ${store.connectionLabel}`} title={`${store.hostName} · ${store.connectionLabel}. Drag to reorder.`}onClick={toggle}- onDragStart={(event) => {- event.dataTransfer.effectAllowed = 'move'- event.dataTransfer.setData('text/plain', id)- setDragged(id)- }}- onDragEnd={() => setDragged(null)}+ {...drag}onKeyDown={(event) => {if (!event.altKey || !['ArrowUp', 'ArrowDown'].includes(event.key)) returnevent.preventDefault()diff --git a/apps/desktop/src/renderer/views/chat-window.css b/apps/desktop/src/renderer/views/chat-window.cssindex 970b98cd..a883a97d 100644--- a/apps/desktop/src/renderer/views/chat-window.css+++ b/apps/desktop/src/renderer/views/chat-window.css@@ -122,13 +122,47 @@ html[data-platform="darwin"] .sidebar-header {.roster-row.compact {padding: 0;}-/* Hover is tracked in JS: a held row stays highlighted while it's dragged. */+/* Hover is tracked in JS, so rows passed over during a drag don't light up. */.roster-row.hovered {background: var(--bubble-agent);}.roster-row.selected {background: var(--roster-selected);}+/* Dragging (iOS's lifted cell): the row's slot stays open while a smaller, translucent copy+ follows the pointer, then settles into the slot. */+.roster-row.lifted {+ opacity: 0;+}+.roster-ghost {+ position: fixed;+ top: 0;+ left: 0;+ z-index: 400;+ pointer-events: none;+}+.roster-ghost.settling {+ transition: translate var(--morph);+}+.roster-ghost-card {+ background: var(--roster-selected);+ box-shadow: var(--shadow-l);+ scale: 0.94;+ opacity: 0.85;+ animation: roster-lift var(--morph) both;+ transition: scale var(--morph), opacity var(--morph);+}+.roster-ghost.settling .roster-ghost-card {+ scale: 1;+ opacity: 1;+ box-shadow: none;+}+@keyframes roster-lift {+ from {+ scale: 1;+ opacity: 1;+ }+}.bot-row {padding: 9px 0;width: 100%;diff --git a/apps/desktop/src/renderer/views/island/island.css b/apps/desktop/src/renderer/views/island/island.cssindex 25c9bdb8..e044b29e 100644--- a/apps/desktop/src/renderer/views/island/island.css+++ b/apps/desktop/src/renderer/views/island/island.css@@ -99,7 +99,6 @@ html[data-window='island'] #root {:where(.island button) {border: 0;padding: 0;- cursor: default;}/* Closed: the wings on each side of the notch. */diff --git a/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsx b/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsxindex 14a219af..348d0beb 100644--- a/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsx+++ b/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsx@@ -2,7 +2,12 @@ import { useRef, useState, type ReactNode } from 'react'import { ResizeHandle } from '../../components/Controls'import { usePresence } from '../../components/Overlay'-/** Animate the available conversation width on both opening and closing; its edge drags the width. */+/**+ * The panel beside the conversation. The conversation takes its new width at once (one layout,+ * however long the chat), then the panel slides in or out over it; its edge drags the width. The+ * slide moves `right`, not a transform: window drag regions (the panel's top band) follow layout,+ * and a transform would leave them where the slide started, over the corner buttons.+ */export function ChatSidePanel({ open, width, min, max, onResize, children }: {open: booleanwidth: number@@ -17,13 +22,17 @@ export function ChatSidePanel({ open, width, min, max, onResize, children }: {const [resizing, setResizing] = useState(false)if (open) last.current = { width, children }const content = open ? { width, children } : last.current+ // The content plus the edge's hairline.+ const panelWidth = content.width + 1return (- <div className={`side-panel ${shown ? 'shown' : ''} ${resizing ? 'resizing' : ''}`} inert={!open}- style={{ width: shown ? content.width + 1 : 0 }}>- {mounted ? <>- <ResizeHandle label="Resize panel" width={content.width} min={min} max={max} edge="leading" onResize={onResize} onDragging={setResizing} />- <div style={{ width: content.width, height: '100%', flex: 'none' }}>{content.children}</div>- </> : null}- </div>+ <>+ <div className="side-panel-slot" style={{ width: open ? panelWidth : 0 }} />+ {mounted ? (+ <div className={`side-panel ${resizing ? 'resizing' : ''}`} inert={!open} style={{ width: panelWidth, right: shown ? 0 : -panelWidth }}>+ <ResizeHandle label="Resize panel" width={content.width} min={min} max={max} edge="leading" onResize={onResize} onDragging={setResizing} />+ <div className="side-panel-content" style={{ width: content.width }}>{content.children}</div>+ </div>+ ) : null}+ </>)}diff --git a/apps/desktop/src/renderer/views/thread/thread.css b/apps/desktop/src/renderer/views/thread/thread.cssindex 38890617..ec448715 100644--- a/apps/desktop/src/renderer/views/thread/thread.css+++ b/apps/desktop/src/renderer/views/thread/thread.css@@ -1,4 +1,5 @@.thread-view {+ position: relative;display: flex;height: 100%;overflow: hidden;@@ -388,17 +389,23 @@}}+/* The conversation's room for the panel changes in one step; the panel itself slides over it, out+ of the flow, so a long chat is laid out once per open or close, not on every frame. */+.side-panel-slot {+ flex: none;+}.side-panel {- height: 100%;+ position: absolute;+ top: 0;+ bottom: 0;+ z-index: 7;display: flex;- flex: none;- opacity: 0;- transition: width var(--layout), opacity var(--morph);+ background: var(--background);+ transition: right var(--layout);/* The margin lets the edge's drag area reach into the conversation. */overflow: clip;overflow-clip-margin: 4px;}-.side-panel.shown { opacity: 1; }.side-panel.resizing { transition: none; }.side-panel-content {height: 100%;diff --git a/docs/guides/desktop-styles.md b/docs/guides/desktop-styles.mdindex b27c736e..ead43add 100644--- a/docs/guides/desktop-styles.md+++ b/docs/guides/desktop-styles.md@@ -18,6 +18,7 @@ How the desktop renderer (`apps/desktop/src/renderer/`) styles its views. Views| Space between stack items | `<Spacer />`, `<Spacer min={8} />` || A fixed-width column that centers an icon, so labels line up | `<IconSlot width={18} tone="secondary">` || A row's title with a note under it | `RowLabel` (`Controls.tsx`) |+| Reorder by dragging | `pointerDrag` (`lib/pointer-drag.ts`), not native drag and drop: the pointer holds a closed hand, and a roster row lifts as a smaller, translucent copy that settles into its slot || A sheet's content | `<SheetPage>` with a `ModalHeader` (`Overlay.tsx`); `ModalHeader` takes a `subtitle`, and `onClose` when it heads a panel instead of a modal || One line with an ellipsis on an element that isn't `Text` | `.truncate` || Controls | `Controls.tsx`, `Overlay.tsx`, `Icon.tsx`; `Hairline`, `Pill`, `Switch` and `ProgressBar` take a `className` for a view's own sizing, and a panel beside an anchor is placed with `anchorPlacement` |@@ -28,3 +29,4 @@ How the desktop renderer (`apps/desktop/src/renderer/`) styles its views. Views2. Anything else static (padding, background, radius, size, position, borders) is a class in the view's CSS file, named after the view (`.bot-row`, `.unread-badge`), written with the tokens above.3. No static inline styles. Inline `style` only for values computed at runtime: a size or color from props or data, a measured width, a transform that follows state. Keep the static part of that element in its class.4. A pattern repeated across views becomes a primitive or a shared class here; don't copy it.+5. Anything clickable shows the pointing hand (a `:where` rule in `theme.css`, so a view's own `cursor` wins); text fields show the text cursor.