WebUI improvements: sidebar, tables, sorting, edit icon, mermaid fix#30
Merged
Conversation
…links - 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.
Sort button in search bar cycles through Recent, A→Z path, and A→Z title. Icon reflects current mode (🕑/📂/🔤). Preference persisted in localStorage. API already returns pages sorted by modified DESC; path and title sorts are applied client-side.
Use inline SVG icons (recent/sort/A-Z) with currentColor fill so they adapt to light/dark theme. Attribution text removed from SVGs.
Two issues: (1) module-level mermaidCounter kept incrementing, generating new IDs each render — mermaid had already mutated the DOM nodes from the previous render, and Preact's dangerouslySetInnerHTML diffing reused them. (2) No key on the page-body div, so Preact could reconcile stale DOM. Fix: use a local counter (stable IDs per render) and add a key based on path+modified_at to force full DOM recreation after saves.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A batch of WebUI quality-of-life improvements:
Resizable & collapsible sidebar
Table styling
Page list sorting
currentColorCollapsible backlinks panel
Inline edit icon
Bug fix: mermaid diagrams after edit+save
keyon page-body to force DOM recreation after saves