Skip to content

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.

feat(desktop): drag the side panel's edge to resize it

leepokai9eac1ad36877
diff --git a/apps/desktop/src/renderer/lib/prefs.ts b/apps/desktop/src/renderer/lib/prefs.ts
index d983cd97..3c4b5d6e 100644
--- a/apps/desktop/src/renderer/lib/prefs.ts
+++ b/apps/desktop/src/renderer/lib/prefs.ts
@@ -56,6 +56,8 @@ export const prefs = {
textSize: pref('conversationFontSize', DEFAULT_TEXT_SIZE),
sidebarCompact: pref('sidebarCompact', false),
sidebarWidth: pref('desktopSidebarWidth', 266),
+ detailsPanelWidth: pref('detailsPanelWidth', 292),
+ repliesPanelWidth: pref('repliesPanelWidth', 420),
hiddenComputers: pref('hiddenComputers', ''),
computerOrder: pref<string[]>('computerOrder', []),
collapsedComputers: pref<string[]>('collapsedComputerSections', []),
diff --git a/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsx b/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsx
index e3e8fe22..f404ae0f 100644
--- a/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsx
+++ b/apps/desktop/src/renderer/views/thread/ChatSidePanel.tsx
@@ -1,18 +1,33 @@
-import { useRef, type ReactNode } from 'react'
+import { useRef, useState, type ReactNode } from 'react'
import { usePresence } from '../../components/Overlay'
-/** Animate the available conversation width on both opening and closing. */
-export function ChatSidePanel({ open, width, children }: { open: boolean; width: number; children: ReactNode }) {
+/** Animate the available conversation width on both opening and closing; the border drags the width. */
+export function ChatSidePanel({ open, width, onResize, children }: { open: boolean; width: number; onResize: (width: number) => void; children: ReactNode }) {
// Animate explicit open/close actions without animating the initial mount.
const { mounted, shown } = usePresence(open, 300, false)
const last = useRef({ width, children })
+ const dragStart = useRef<{ x: number; width: number } | null>(null)
+ const [resizing, setResizing] = useState(false)
if (open) last.current = { width, children }
const content = open ? { width, children } : last.current
+ const onDown = (e: React.PointerEvent) => {
+ e.currentTarget.setPointerCapture(e.pointerId)
+ dragStart.current = { x: e.clientX, width }
+ setResizing(true)
+ }
+ const onMove = (e: React.PointerEvent) => {
+ if (dragStart.current) onResize(dragStart.current.width + dragStart.current.x - e.clientX)
+ }
+ const onUp = () => {
+ dragStart.current = null
+ setResizing(false)
+ }
return (
- <div className={`side-panel ${shown ? 'shown' : ''}`} inert={!open}
+ <div className={`side-panel ${shown ? 'shown' : ''} ${resizing ? 'resizing' : ''}`} inert={!open}
style={{ width: shown ? content.width + 1 : 0 }}>
{mounted ? <>
- <div className="side-panel-border" />
+ <div className="side-panel-border" onPointerDown={onDown} onPointerMove={onMove} onPointerUp={onUp} onPointerCancel={onUp}
+ role="separator" aria-label="Resize panel" aria-valuenow={content.width} />
<div style={{ width: content.width, height: '100%', flex: 'none' }}>{content.children}</div>
</> : null}
</div>
diff --git a/apps/desktop/src/renderer/views/thread/ThreadView.tsx b/apps/desktop/src/renderer/views/thread/ThreadView.tsx
index 7e2a144c..c829d047 100644
--- a/apps/desktop/src/renderer/views/thread/ThreadView.tsx
+++ b/apps/desktop/src/renderer/views/thread/ThreadView.tsx
@@ -5,6 +5,7 @@ import { Spinner } from '../../components/Controls'
import { Icon } from '../../components/Icon'
import { Sheet } from '../../components/Overlay'
import { font } from '../../lib/fonts'
+import { prefs, usePref } from '../../lib/prefs'
import { useStore } from '../../store/context'
import { UpdateNeededCard } from '../UpdateNeededCard'
import { buildChat, rowIn, useArrivals, type ChatItem } from './chat-items'
@@ -50,6 +51,8 @@ export function ThreadView({ botId }: { botId: string }) {
const root = useRef<HTMLDivElement>(null)
const dock = useRef<HTMLDivElement>(null)
const [width, setWidth] = useState(800)
+ const [detailsWidth, setDetailsWidth] = usePref(prefs.detailsPanelWidth)
+ const [repliesWidth, setRepliesWidth] = usePref(prefs.repliesPanelWidth)
useReading(store, botId, null)
useLayoutEffect(() => {
@@ -67,6 +70,8 @@ export function ThreadView({ botId }: { botId: string }) {
}, [])
const wide = width >= WIDE
+ // The side panel's border drags its width, leaving the conversation at least 380 wide.
+ const panelWidth = (w: number) => Math.min(Math.max(260, w), width - 380)
// A compact Details presentation dismisses once the window is wide enough for the inspector.
useEffect(() => {
if (wide) setCompactDetails(false)
@@ -167,7 +172,11 @@ export function ThreadView({ botId }: { botId: string }) {
</div>
) : null}
</div>
- <ChatSidePanel open={wide && (!!openThread || showSettings)} width={openThread ? Math.min(420, width * 0.45) : 292}>
+ <ChatSidePanel
+ open={wide && (!!openThread || showSettings)}
+ width={panelWidth(openThread ? repliesWidth : detailsWidth)}
+ onResize={(w) => (openThread ? setRepliesWidth : setDetailsWidth)(panelWidth(w))}
+ >
{openThread ? <RepliesView key={openThread} botId={botId} rootId={openThread} close={closeThread} /> : details}
</ChatSidePanel>
diff --git a/apps/desktop/src/renderer/views/thread/thread.css b/apps/desktop/src/renderer/views/thread/thread.css
index 2474180b..79659229 100644
--- a/apps/desktop/src/renderer/views/thread/thread.css
+++ b/apps/desktop/src/renderer/views/thread/thread.css
@@ -359,13 +359,27 @@
flex: none;
opacity: 0;
transition: width var(--layout), opacity var(--morph);
- overflow: hidden;
+ /* The margin lets the border'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-border {
width: 1px;
background: var(--border);
flex: none;
+ position: relative;
+ z-index: 7;
+}
+.side-panel-border::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: -4px;
+ width: 9px;
+ cursor: col-resize;
}
@keyframes panel-slide {
from {