feat(ui): page header actions — Edit (accent) + Revisions menu (view/restore) + Export, top-right

Editor refactored to expose controls; Edit moved into the doc header as the orange
primary action; new Revisions dropdown lists page_revisions with a modal preview + Restore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-04 23:26:36 +10:00
parent 0a490e4e68
commit 6d01cb34a7
4 changed files with 92 additions and 43 deletions

View File

@@ -5,6 +5,7 @@ import { markdownEditor } from '../components/markdown_editor.js';
import { backButton } from '../components/backbtn.js';
import { breadcrumb } from '../components/breadcrumb.js';
import { exportMenu } from '../components/export_menu.js';
import { revisionsMenu } from '../components/revisions_menu.js';
export async function render(main, ctx) {
const id = ctx.params.id;
@@ -33,11 +34,15 @@ export async function render(main, ctx) {
mount(main,
el('div', { class: 'doc-head' },
el('div', { class: 'doc-head-left' }, backButton(), breadcrumb(page)),
exportMenu({ filenameBase: page.slug, getContent: async () => ({ title: page.title, md: page.body_md || '' }) })
el('div', { class: 'doc-actions' },
revisionsMenu(id, (md) => editor.setValue(md)),
editor.controls,
exportMenu({ filenameBase: page.slug, getContent: async () => ({ title: page.title, md: editor.value() }) })
)
),
el('h1', { class: 'view-h1' }, page.title),
el('p', { class: 'view-sub muted' }, '/' + page.slug),
editor,
editor.pane,
backlinksCard
);