From a6443c577ea720c8575bc132162d53487d49d897 Mon Sep 17 00:00:00 2001 From: aniongithub Date: Sun, 10 May 2026 22:58:41 -0700 Subject: [PATCH 1/6] webui: resizable/collapsible sidebar, table styling, collapsible backlinks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Sidebar: drag-to-resize handle (160–480px) with collapse/expand toggle button. Width and collapsed state persisted in localStorage. - Tables: proper borders, cell padding, header background, and hover rows. - Backlinks: clickable header toggles collapse; state persisted in localStorage. --- webui/src/App.tsx | 144 ++++++++++++++++++++++++++++++++----------- webui/src/styles.css | 82 ++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 35 deletions(-) diff --git a/webui/src/App.tsx b/webui/src/App.tsx index a1792f9..328fab1 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -59,6 +59,55 @@ export function App() { return window.matchMedia('(prefers-color-scheme: dark)').matches; }); + // Sidebar resize/collapse state + const [sidebarWidth, setSidebarWidth] = useState(() => { + const saved = localStorage.getItem('mm-sidebar-width'); + return saved ? parseInt(saved, 10) : 240; + }); + const [sidebarCollapsed, setSidebarCollapsed] = useState(() => { + return localStorage.getItem('mm-sidebar-collapsed') === 'true'; + }); + const isResizing = useRef(false); + + useEffect(() => { + localStorage.setItem('mm-sidebar-width', String(sidebarWidth)); + }, [sidebarWidth]); + + useEffect(() => { + localStorage.setItem('mm-sidebar-collapsed', String(sidebarCollapsed)); + }, [sidebarCollapsed]); + + const startResize = (e: MouseEvent) => { + e.preventDefault(); + isResizing.current = true; + document.body.style.cursor = 'col-resize'; + document.body.style.userSelect = 'none'; + + const onMouseMove = (ev: MouseEvent) => { + if (!isResizing.current) return; + const newWidth = Math.max(160, Math.min(480, ev.clientX)); + setSidebarWidth(newWidth); + }; + const onMouseUp = () => { + isResizing.current = false; + document.body.style.cursor = ''; + document.body.style.userSelect = ''; + document.removeEventListener('mousemove', onMouseMove); + document.removeEventListener('mouseup', onMouseUp); + }; + document.addEventListener('mousemove', onMouseMove); + document.addEventListener('mouseup', onMouseUp); + }; + + // Backlinks collapse state + const [backlinksCollapsed, setBacklinksCollapsed] = useState(() => { + return localStorage.getItem('mm-backlinks-collapsed') === 'true'; + }); + + useEffect(() => { + localStorage.setItem('mm-backlinks-collapsed', String(backlinksCollapsed)); + }, [backlinksCollapsed]); + useEffect(() => { document.documentElement.classList.toggle('dark', isDark); localStorage.setItem('mm-theme', isDark ? 'dark' : 'light'); @@ -243,40 +292,59 @@ export function App() { return (
{/* Sidebar */} - ) : ( <> -
+
Date: Sun, 10 May 2026 23:52:53 -0700 Subject: [PATCH 5/6] webui: inline edit icon next to page title Replace the standalone edit button with a pencil SVG icon inline with the title. Icon is hidden by default and appears on hover, turning accent-colored on icon hover. Save/cancel buttons remain in page-actions when editing. --- webui/src/App.tsx | 13 +++++++++---- webui/src/styles.css | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 50c814b..f246cdb 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -492,7 +492,14 @@ export function App() { ) : current ? ( <> diff --git a/webui/src/styles.css b/webui/src/styles.css index 026f300..dbefffb 100644 --- a/webui/src/styles.css +++ b/webui/src/styles.css @@ -211,6 +211,24 @@ html, body, #root { font-size: 36px; font-weight: 200; letter-spacing: -1px; + display: flex; + align-items: center; + gap: 12px; +} + +.edit-icon-btn { + background: none; + border: none; + color: var(--fg-dim); + cursor: pointer; + padding: 4px; + display: flex; + align-items: center; + transition: color 0.15s; +} + +.edit-icon-btn:hover { + color: var(--accent); } .page-meta { From 2f151cd5a69259beeac5f26408f905451beed864 Mon Sep 17 00:00:00 2001 From: aniongithub Date: Mon, 11 May 2026 00:07:47 -0700 Subject: [PATCH 6/6] testdata: add feature table and architecture diagram to mind-map page --- testdata/projects/mind-map.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/testdata/projects/mind-map.md b/testdata/projects/mind-map.md index d05ccac..20f5d58 100644 --- a/testdata/projects/mind-map.md +++ b/testdata/projects/mind-map.md @@ -1,10 +1,34 @@ --- +status: active title: mind-map type: project -status: active --- # mind-map A wiki engine for AI agents and humans. Built with [[Go]]. Links back to [[index]]. + +## Feature Status + +| Feature | Status | Notes | +|---------|--------|-------| +| Wiki engine | ✅ Done | SQLite-backed, FTS5 search | +| Wikilinks | ✅ Done | [[target]] and [[target|display]] | +| Backlinks | ✅ Done | Auto-tracked in DB | +| MCP server | ✅ Done | read, write, search tools | +| Web UI | 🔧 WIP | Sidebar, markdown, mermaid | +| Git sync | 🔧 WIP | Push/pull with remotes | +| Auth | ⏳ Planned | Token-based access | + +## Architecture + +```mermaid +graph TD + A[Web UI] -->|REST API| B[Go Server] + C[MCP Client] -->|stdio/SSE| B + B --> D[(SQLite + FTS5)] + B --> E[Markdown Files] + B --> F[Git Sync] + F --> G[Remote Repos] +```