Skip to content

[Feature] Wire wiki Edit / Archive / Restore into the dashboard UI #588

@brendandebeasi

Description

@brendandebeasi

Summary

The wiki backend already supports full CRUD: create, edit, archive, restore from history, and search. The agent tools cover the same surface. The dashboard UI, however, only exposes create and read. Edit, archive, and version restore are not reachable from the web interface — users have to ask an agent to do it for them.

Current state — backend (works)

  • src/api/wiki.rs exports list_pages, search_pages, create_page, get_page, edit_page, get_history, restore_version, archive_page (lines 170-374)
  • src/wiki/store.rs (885 lines) has the full implementation: create, edit, read, list, search, history, restore, archive
  • Agent tools: src/tools/wiki_create.rs, wiki_edit.rs, wiki_history.rs, wiki_list.rs, wiki_read.rs, wiki_search.rs
  • API client wires it all up: interface/src/api/client.ts:2576-2630 exports listWikiPages, searchWikiPages, getWikiPage, createWikiPage, editWikiPage, getWikiHistory, restoreWikiVersion, archiveWikiPage

Current state — UI (gap)

interface/src/routes/Wiki.tsx:

  • CreatePageForm calls api.createWikiPage (line 144) ✅
  • Page detail view renders title, body, and history list — read-only ✅
  • No call to api.editWikiPage anywhere in the route
  • No call to api.archiveWikiPage anywhere in the route
  • No call to api.restoreWikiVersion anywhere in the route (history is shown but not actionable)

(verified by grep — api.editWiki, api.archiveWiki, api.restoreWiki return zero matches in routes/ and components/)

Proposed change

Wire the existing API into routes/Wiki.tsx:

  • Edit: Add an "Edit" button on the page detail view that opens an editor (similar shape to CreatePageForm) and POSTs to editWikiPage(slug, { content, edit_summary, … })
  • Archive: Add a destructive-style button (with confirm) calling archiveWikiPage(slug) and routing back to the list
  • Restore: Make each entry in the history list actionable — clicking calls restoreWikiVersion(slug, version) and refreshes the page

This is purely a frontend wiring task — no backend, API, or agent-tool changes required.

Related pattern

  • AgentConfig UI missing ROLE.md editor #280 — same shape: ROLE.md is supported by the backend but absent from AgentConfig.tsx. Worth a small audit pass for other backend-supported features missing UI affordances.

Open questions

  • Soft archive (today's archiveWikiPage) vs offering hard delete — does the UI need both, or is archive sufficient?
  • Should edit history show the full diff inline, or just edit_summarys as today?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions