MotirBuilding in public
MOTIR · moooon
onMotir
You’re viewing a public project. Anyone can view it — no account needed. Sign in to submit, upvote, or comment on requests.View-only — you can’t edit work items
MOTIR-779

6.16.5 On-page admin Edit affordance + in-place edit (tagline + add/remove tags + body)

Done
Description

Estimate: 85m · Type: code · Depends on: 6.16.1, 6.16.3, 6.16.4

The core UX: on-page admin Edit page affordance + in-place edit mode. A 'use client' island over the public Overview page. When overview.viewerCanManage, render an "Edit page" button; entering edit mode makes editable ON the page: the tagline (inline input), the tags (chip list with remove ✕ + an "Add tag" input, enforcing max-count), and the README body (shipped MarkdownEditor), with a sticky Save / Cancel bar. Save persists all three via the 6.16.3 action; treat success as confirmation — no whole-tree refresh (inline-edit rule); the island owns the edited values' local state (page-state-after-mutation: client island over a server page). Unsaved-changes guard on cancel/navigate. Affordance is server-gated (never rendered for non-admins) AND the action re-checks assertCanManage (defense in depth). Anonymous/non-admin viewers get the normal read-only page.

Acceptance criteria

  • Admin on own public page: "Edit page" → edits tagline + adds/removes tags + edits body in place → Save persists (one action call); page reflects it without a full reload; Cancel restores.
  • Non-admin / anonymous: no affordance; direct action call by a non-admin → 403.
  • Reuses MarkdownEditor; --el-*/shape tokens; matches 6.16.1; AA-safe.

Context refs

  • app/(public)/p/[identifier]/page.tsx; components/ui/MarkdownEditor; 6.12.8 EditOverview.tsx (optimistic-save pattern to mirror, then delete in 6.16.6); CLAUDE.md "Page state after a mutation" + "inline-edit no-tree-refresh"