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-416

6.12.8 Project settings — the "make public" toggle + the shareable public link + the Overview/README editor

Done
Description

Estimate: 55m · Depends on: 6.12.1, 6.12.3

Extend project settings with the FOUR-level Access control + the shareable public link, per the 6.12.1 design, over the 6.12.3 access extension. This is how a project admin turns a project public.

  • The make-public toggle: extend the existing 6.4 Access control (open / limited / private) to the FOUR levels public > open > limited > private, with the explanatory copy (public = anyone can view, no account, indexable by search engines; sign in only to submit/upvote/comment). Setting public calls the 6.4 setAccessLevel service (now accepting the new enum value); project-admin-gated (reuse the 6.4 project-admin check — non-admins see it read-only).
  • The shareable public link: a per-project public link (a stable public slug / route to the public view) shown when the project is public, with copy + disable + rotate. The link opens the public view with NO sign-in (the page is fully public + crawlable); decide the slug model so a project can rotate/disable its public link without changing the project key.
  • The Overview/README editor — a DEDICATED "Edit overview" view (per the 6.12.1 Panel 7 design): a split MarkdownEditor (left) + a LIVE MarkdownView PREVIEW (right) of the public landing, reached from an "Edit overview" entry point in settings (Panel 6) — NOT a cramped in-settings box. It edits the project.publicOverviewMd field (6.12.3) ONLY (the README body); the hero name/stats are auto and the Links sidebar pulls from existing project fields (website / repo / docs), so NO new schema beyond publicOverviewMd. The preview renders with the SAME MarkdownView the public tab (6.12.4) uses, so what the admin sees is what ships. Project-admin-gated; Save persists through a service method (the success-response-is-confirmation rule — no whole-tree refresh). A note states it shows on the public Overview tab and is hidden while the project is not public.
  • Design-system compliance: ONLY --el-* + [data-display-style] tokens + shipped components/ui/*; the access-level copy ("Public = anyone can view, no account, indexable") + the no-sign-in-to-view note per the 6.12.1 design; inline edits follow the no-whole-tree-refresh rule (a success response is the confirmation).

Stay 4-layer: the route parses + calls one service method (setAccessLevel / the link rotate/disable); project-admin-gated; no raw Prisma in the route.

Acceptance criteria

  • The Access control renders all FOUR levels (public > open > limited > private) with copy; setting public persists via the 6.4 setAccessLevel service; project-admin-gated (read-only for non-admins).
  • A shareable public link appears when the project is public, with copy / disable / rotate; the link opens the public view with NO sign-in (fully public + crawlable); rotating/disabling does not change the project key.
  • The dedicated "Edit overview" view (split MarkdownEditor + live MarkdownView preview), reached from the settings entry point, persists publicOverviewMd (body only) via a service method (success-response-is-confirmation, no whole-tree refresh), project-admin-gated; the preview matches the public Overview tab (6.12.4) render; no new schema beyond publicOverviewMd.
  • Only --el-* + [data-display-style] tokens + shipped primitives; matches the 6.12.1 design; inline edits use the success-response-is-confirmation pattern.
  • 4-layer respected (route → service; no raw Prisma in the route).

Context refs

  • 6.12.1 (design asset — required), 6.12.3 (the public enum value + access extension).
  • scripts/plan-seed/data/story-6.4.ts § 6.4.4 (setAccessLevel service) + § 6.4.5 (the project-settings Access UI this extends) — mirror + extend, do not fork.
  • motir-core/components/ui/* + app/globals.css; motir-core/CLAUDE.md § 4-layer + § colour/shape tokens + the inline-edit no-whole-tree-refresh rule.