This feature gives one page in the admin area a consistent shell: a toolbar row, a scrollable main area, and an optional right-hand aside. `PlutoContentList` and `PlutoContentForm` both use it. It also adds the publish workflow to the generic content form, and a registry bucket that lets a layer add its own buttons to that form. It extends the [content model](../content-model/SKILL.md). Read that skill file first. This feature adds: - `app/components/Pluto/View/PlutoViewAdminPanel.vue`, `Plut...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Admin View Chrome?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/plutocms-admin-view-chrome)
# Admin view chrome
This feature gives one page in the admin area a consistent shell: a toolbar row, a scrollable
main area, and an optional right-hand aside. `PlutoContentList` and `PlutoContentForm` both use
it. It also adds the publish workflow to the generic content form, and a registry bucket that
lets a layer add its own buttons to that form.
It extends the [content model](../content-model/SKILL.md). Read that skill file first. This
feature adds:
- `app/components/Pluto/View/PlutoViewAdminPanel.vue`, `PlutoViewToolbar.vue`, `PlutoViewAside.vue`
— the three per-view chrome primitives described below.
- `PlutoContentType.form` on `shared/types/content.ts` — layout knobs for the generic form.
- `PlutoContentTypeCapabilities.publish` on `shared/types/content.ts` — the publish capability.
- `PlutoContentAction`/`PlutoContentActionContext` on `shared/types/registry.ts`, a
`contentActions` field on `PlutoExtension`, and a `contentActions` bucket on `PlutoRegistry`.
- `app/composables/pluto-content-actions.ts` — `usePlutoContentActions(typeName, placement)`.
- `shared/utils/content-map.ts` (extended) — `mapColumnsToFields` now also returns `item.status`.
- `PlutoContentList.vue` and `PlutoContentForm.vue` (rewired) — both now render inside
`PlutoViewAdminPanel`, and `PlutoContentForm` adds the publish workflow UI.
- `PlutoContentFormHeader.vue` — the toolbar of every form layout (see "The form toolbar").
- `PlutoContentCanvasPanel.vue`, `usePlutoContentForm()` and the `canvas` layout (see "The canvas
layout" and "The form context").
- `app/composables/internal/content-dirty.ts` — the pure part of the unsaved-changes guard.
- `test/content-actions.test.ts`, `test/content-dirty.test.ts` — unit tests.
## Three chrome primitives, not the global layout
Do not confuse these with `app/layouts/admin.vue` or `PlutoNavbarAdmin.vue`. Those two are
**app-level, one per admin session**: the layout owns the left sidebar and the page frame, and
`PlutoNavbarAdmin` is the single global top bar that core renders. A page's
own content renders inside the layout's body slot.
`PlutoViewAdminPanel`, `PlutoViewToolbar`, and `PlutoViewAside` are **per-view, one set per page**.
They give one page (a content list, a content form, or any other admin page) its own local
toolbar and optional aside, inside the space the global layout already gives it.
### The rules of an admin page
Every admin page uses the three primitives: the content lists and forms, Media, Settings (the
parent `pages/admin/settings.vue` draws the frame, a tab is only its content), the Users page of
the Git CMS, and the Users, Roles and Migrations pages of the Supabase layer.
- The title is in `PlutoViewToolbar`, with the icon of the menu item. No big `h1` in the body.
The page actions go in `#right` (ghost or solid buttons, natural width).
- The tabs of a section are `PlutoAdminNavTabs` in `#toolbar`, after the toolbar.
- A tab does not repeat its name as a heading. One muted intro line (`text-muted text-sm`) may
open it.
- Each part of a page is a `UCard` with a header: `h2` (`font-semibold`) and a muted
description. A group of cards has an `h2` + description above it (Deploy).
- A link to another site ends with the external icon of Nuxt UI (`i-lucide-arrow-up-right`, the
icon its menus add to an item with `target: '_blank'`): `trailing-icon` on a button, and
`PlutoExternalLink` for a link in a sentence or a cell (it adds the icon and an "opens in a new
tab" text for screen readers). An icon-only button to another site uses the same icon.
- Every icon-only button has a tooltip that says what it does (`UTooltip :text`), with the same
text as its `aria-label`. The trigger of a menu or a popover puts the tooltip inside the menu,
around the button (`PlutoBlockInsertMenu`). A button with a visible label needs none. This holds
for every layer and every admin surface: toolbars, cards, lists, the editor, the navbar. To find
the ones that miss it, look for a `UButton` with `icon` and no `label` and no text inside that
no `UTooltip` wraps.
- No page wrapper: the `container` width gives the padding and the gap (the old `AdminView`
component is gone).
- A page before sign-in uses the `auth` layout and `PlutoAdminAuthCard` (the Supabase setup
wizard too). The server-rendered GitHub App setup pages copy that look in plain CSS
(`github-setup-pages.ts`).
### `PlutoViewAdminPanel`
The outer shell for one view. Props:
- `width?: 'container' | 'full'` — default `'container'`. `'container'` wraps the main slot in a
max-width `UContainer`. `'full'` drops that wrap, for a view that wants to use the whole width
(a writing surface, a media grid).
- `asideOpen?: boolean` (`v-model:aside-open`) — default `false`. Pass the same value as the
aside's `v-model:open`.
While it is `true` on desktop, the aside sits in a resizable panel (see "Resizable aside"
below). Without it, the aside keeps its fixed `width`.
- `leftOpen?: boolean` (`v-model:left-open`) — default `false`. Whether the left panel is open.
See "The left panel".
- `panelToggles?: boolean` — default `false`. On desktop, draws a small floating button that opens
a closed side panel (see "The canvas layout"). Use it with `v-model:aside-open`. With a `#rail`
slot, the left panel has no floating button: the rail opens it.
- `#rail` slot — the action rail (desktop only): a column of icon buttons (`w-12`, no border, a
`nav` with the label "Editor actions") at the left edge of the row. It has the surface
`bg-pluto-rail` (`--ui-bg-muted` in light mode, transparent in dark mode). The content form fills it
in the canvas layout: one button for the left panel (its `icon` and `label`, `soft`/`primary`
and `aria-pressed` while open). It is the place for more actions of the view later (a layer,
an AI assistant).
- `leftTitle?: string` — the title of the left panel when it shows as a slideover.
- `fill?: boolean` — default `false`. The main region fills the panel's height and does not
scroll. The content scrolls inside its own region instead, for a view with one long list
(such as a virtualized table). The content must be a flex column child that takes
`flex-1 min-h-0` and scrolls itself.
Slots:
- `#toolbar` — a shrink-to-fit row pinned above the scrollable area. Put a `PlutoViewToolbar`
here.
- default — the scrollable main content.
- `#left` — a column left of the main content. Put the panel content here. See "The left panel".
- `#aside` — a column beside the main content, resizable when `asideOpen` is set. Put a
`PlutoViewAside` here. Leave
this slot empty on a view with nothing to show beside the main content — an empty aside slot
renders as a zero-width wrapper, so it costs nothing to leave unused.
### `PlutoViewToolbar`
One row of controls for a view: a back button, a title, and left/right button groups. Wraps
Nuxt UI's `UDashboardNavbar` with one fix — `:toggle="false"` — because the vendor default
toggle button controls the app-level LEFT sidebar through a global hook. A second, page-local
toolbar must never render that button, or it would open and close the wrong sidebar.
The toolbar row is `h-12`. Its buttons take the admin default size (`md`, see the admin-theme
skill), so a page button or a toolbar item of a layer fits the row without a `size`.
Props: `title?: string`, `icon?: string`, `backTo?: string` (renders a back arrow button, with an `aria-label` and a tooltip "Back", before
the title; the left padding is then `ps-2`, so the back button lines up with the rail buttons).
Slots: `#left` (replaces the whole leading area — icon, title, and trailing content — so only use
it when you also want to replace the title), `#title`, default (a centered slot), `#right`,
`#trailing` (renders right after the title, inside the same leading area, for a small status
next to the title). A content list keeps its Refresh button at the end of the search row.
### `PlutoViewAside`
On desktop it has the `bg-pluto-rail` surface. It is not a dark panel.
A right-hand panel bound to an `open` model (`v-model:open`). On a wide screen (`lg`, 64rem and
up) it renders as a plain `<aside>` beside the main content. On a narrow screen it renders as a
`USlideover` instead. Props: `title?: string`, `width?: number` (desktop width in px, default
320; ignored inside a resizable panel). On desktop the header has a collapse button
(`lucide:panel-right-close`, "Hide the panel", `pluto.common.hidePanel`) with an `aria-label` and a
tooltip.
Slot `#header` replaces the title, for example with tabs. On a narrow screen it goes into the
slideover title.
A `useMediaQuery` check renders the plain `<aside>` on wide screens only, and the `USlideover`
on narrow screens only, so the slot mounts once. Do not replace that check with `hidden lg:flex`
or `lg:hidden` classes:
- CSS hides a copy, but the copy stays mounted. Each copy fetches its own field options, so a
narrow screen made two requests per option list on every open.
- An open slideover is a modal dialog. It disables pointer events on the rest of the page even
while CSS hides it, so the desktop page stops taking clicks.
The slideover sets `unmount-on-hide="false"`. After the first open, its slot stays mounted
(hidden) when it closes. A reopen keeps the widget state, such as an open picker or a typed
search, and does not fetch the field options again. Field values live in the form state, so
they were never lost; only the widgets' own local state was.
### Resizable aside
`PlutoViewAdminPanel` puts the main content and the aside in a Nuxt UI `USplitter` when
`asideOpen` is `true` on desktop. The user drags the handle to resize the aside, between 240px
and 560px. The panel stores the width in px in the `pluto-view-aside-width` cookie and applies it
the next time the aside opens. `PlutoViewAside` reads the `plutoViewAsideResizableKey` injection
and fills the panel instead of using its own `width`.
Do not give the `USplitter` an `id`. With an id, Nuxt UI names each handle `<id>-handle-<index>`, and
reka-ui reads that name once, when the handle mounts. The left panel of the canvas layout joins later
(it loads on demand), so the indexes shift, two handles get the same name, and a drag on the aside
handle resized the left panel (fixed in 0.28). Without an id, each handle gets a unique id. The panels
keep their own `id` (`pluto-view-left`, `-main`, `-aside`).
Do not use the splitter's `sizeUnit: 'px'` or `autoSaveId` here. When the aside panel joins with
the aside already open (a page reload), reka-ui skips the px conversion and reads the px value as
a raw size, so the aside takes most of the width. The panel converts px to percentages itself,
against the measured row width.
Like `PlutoViewToolbar`, this is a hand-built stand-in rather than Nuxt UI's own
`UDashboardSidebar`, for the same reason: `UDashboardSidebar` listens to a global toggle hook,
and a second instance of it here would fight the app-level sidebar for that hook.
### The left panel
`PlutoViewAdminPanel` has a `#left` slot and a `leftOpen` model. It works like the aside:
- Desktop: the left panel sits in the same `USplitter` as the main content and the aside, in the
order left, main, aside. The user drags the handle, between 200px and 400px. The panel stores
the width in px in the `pluto-view-left-width` cookie (default 260) and converts it to
percentages itself, for the same reason as the aside.
- Below `lg`: the panel renders a left `USlideover` (`unmount-on-hide="false"`) with the slot
inside, and the splitter has no left panel. The slot mounts once.
- A view can fill `#left` after the first render (a widget that loads on demand adds it). The
panel reads `useSlots()` again before each update, because `useSlots()` is not reactive.
- The close button of the left panel goes in the header of the panel content: put
`<PlutoViewLeftCollapse />` there (an X, "Close the panel"; it shows on desktop only; the
slideover has its own close).
It reads `plutoViewLeftPanelKey` (`close()`, `collapseButtons`). The panel exposes
`leftCollapsible` (true while one is mounted) through a template ref.
## Titles in `PlutoContentList`
The title (`titleField`) links to the edit page: the title cell of the table (the
`<titleField>-cell` slot, when the field is `inList`) and the heading of each card. An item
without a title shows "Untitled" (`pluto.content.untitled`) in muted italics, so it still has a
link. A card does not repeat the title in its field list.
## List states in `PlutoContentList`
While the list has no rows, `PlutoContentList` shows one Nuxt UI `UEmpty` instead of the cards
(mobile) and the table (desktop):
- **Loading** — the first request is pending. Title "Loading <plural>…" with a spinner.
- **Error** — the request failed. Title "Could not load <plural>" and a "Try again" button.
- **Empty** — the request returned no rows. Title "No <plural> yet", the content type icon,
and a "New <label>" button if the user has `capabilities.write`.
With rows, a failed refresh keeps the rows and shows a `UAlert` above them, with a "Try again"
button. The toolbar Refresh button and both "Try again" buttons call `retry()`, which catches
the rejection. Do not call `refresh()` directly from a button: it rethrows, and the failure
becomes an unhandled rejection. The toolbar create button reads "New <label>", the same text
as the command palette.
### Long lists
`PlutoContentList` loads 50 rows at a time (`usePlutoContentList(type, { pageSize: 50 })`). It
uses `PlutoViewAdminPanel` with `fill`, so the list scrolls inside its own region and the page
does not scroll:
- Desktop: `UTable` with `virtualize` (only the visible rows render) and `sticky` (the header
row stays at the top). The table is as tall as its rows, up to the remaining height. Then it
scrolls. It does not fill the height, so a short list has no empty box under its rows. Each row
is a `group` (`ui.tr`), and Edit and Remove show on row hover (opacity only), and stay visible
on a device without hover and with the keyboard focus. The cards on mobile keep their buttons.
- While the first page loads, `PlutoSkeletonList` shows the table with the real column headers
and bars, or the cards on mobile, in a `role="status"` region with the "Loading" label.
- Mobile: the card list is a flex column that scrolls. Each card has `shrink-0`. In a grid or
flex container with a fixed height, a card without it collapses to its border.
- `useInfiniteScroll` on the table and on the card list calls `loadMore()` 240px before the
end. It stops while an error shows, so a failing page does not load in a loop.
- A footer shows "Showing <loaded> of <total> <plural>", and "Loading more…" while a page
loads.
### List text and numbers
Every list string is a key in `pluto.list.*` (and `pluto.common.*`). A phrase takes the labels as
parameters, such as `{labelPlural}`, so a language can reorder the words. The code passes the
label in lowercase (`usePlutoContentText(...).labelPluralLower`). The counts in the footer use
`n()` from `usePlutoI18n()`, so they follow the admin language. See the i18n skill.
## `PlutoContentType.form` — form layout knobs
```ts
form?: {
/**
* 'default' = fields in a container, aside on the right. 'focus' = minimal chrome for a writing
* surface. 'canvas' = a full-height field between a left panel and a right panel.
*/
layout?: 'default' | 'focus' | 'canvas'
/** The field that fills the main region in the 'canvas' layout. */
canvasField?: string
/** true = always show. false = never. 'auto' (default) = show when any field has region 'side'. */
aside?: boolean | 'auto'
/** Aside starts closed. Default false, or true when layout is 'focus'. */
asideCollapsed?: boolean
/** Drop the max-width container in the main region. Default false, or true when layout is 'focus'. */
width?: 'container' | 'full'
/** Keep a backup of the unsaved changes in the browser. Default true. */
backup?: boolean
}
```
`PlutoContentForm` reads all of them. `layout: 'focus'` uses the full width and defaults the aside
to collapsed — the shape a long-form writing surface wants. `layout: 'canvas'` is described below.
Leave `form` unset for the default two-column form every other content type already gets.
`PlutoContentType.previewUrl?: (item) => string | undefined` gives the public URL of an item. The
toolbar shows a "View" link (new tab) in edit mode when it returns a value. The function must be
pure, because the type is shared with the server. A function that throws shows no link.
## The form toolbar
Every layout (`default`, `focus`, `canvas`) has the same toolbar, `PlutoContentFormHeader`. The body
has no H1: the toolbar title is the heading. The toolbar shows, from left to right:
- Back, then the breadcrumbs, in `text-sm`: "<Type plural> › • <item title> [status] <save state>".
The type label links to the list (`backTo`); the title is the current page (`aria-current`). In edit
mode the title is the `titleField` value, or "Edit <type>" while it loads or when it is empty. A
new item shows "New <type>". The type label hides below `sm` (40rem) and the title truncates.
- Unsaved changes: a yellow dot before the title, with the tooltip "Unsaved changes" (no text).
- The status badge (when the type has a `status` workflow), after the title, from `sm`. The
badge and the save state are in the `#trailing` slot of `PlutoViewToolbar`
(`UDashboardNavbar`), so they sit right after the title.
- The save state after the badge, in a live region (`role="status"`; the dirty state is
`sr-only` text there): "Saving…" (a spinner); "Saved just now", then "Saved 2 minutes ago"
(`Intl.RelativeTimeFormat`, the admin locale, a 30 second tick, the text from `md`), after a
save while the form has no new change; "Save failed." with a "Retry" button, which repeats the
same save (Publish stays Publish).
- On the right: the "View" link, the
`contentToolbarItems` of the layers (a status or an indicator), the `contentActions` of the layer, the save and publish buttons (see "The publish workflow"), the overflow menu, and
the panel toggles.
- Below `sm`: the "View" link moves into the overflow menu, and a secondary button (a content
action, "Save draft") shows its icon only.
`PlutoContentFormHeader` holds no form logic. It gets plain props (`title`, `saveState`,
`viewUrl`, `buttons`, `actions`, and so on) and sends `press`, `retry`, `unpublish`, `delete`,
`toggleAside` and `toggleLeft`. `PlutoContentForm` builds the data and handles the events.
### Unsaved changes
The form is dirty when the payload (`buildContentPayload`, compared as sorted JSON) differs from
the baseline. The baseline follows the item **until the user first edits**, so a widget that
writes its own normal form of the value after it mounts (an editor) does not make the form
dirty. A key press, `input`, `change`, `paste`, `drop`, or a press on a control (button, link,
input, `role="option"` and similar) counts as an edit. An event during the load does not count.
A save sets a new baseline (twice: at once, and on the next tick). The logic is
`createDirtyTracker` in `app/composables/internal/content-dirty.ts`.
While the form is dirty:
- A navigation away (`onBeforeRouteLeave`, and `onBeforeRouteUpdate` for a new id) is cancelled
and opens an in-app dialog, "Leave without saving?", with "Stay on this page" and "Leave
without saving". Escape and a click outside mean "Stay". "Leave" navigates to the wanted route.
- `beforeunload` asks the browser to confirm a reload or a tab close.
The form skips the guard for its own navigation (after a create, an id change, and a delete).
A new item starts as an empty object. `buildContentPayload` reads the keys with `Object.keys`, which
a Vue computed tracks, and not with `Object.hasOwn`, which it does not. So a field that the item
gets later (the first keystroke in a new item) changes the snapshot.
**Backup.** The form also keeps the unsaved changes in `localStorage` and offers them again on the
next visit (`usePlutoContentBackup`, `PlutoContentBackupAlert` above the fields, `form.backup` to
opt out). "Leave without saving" removes the backup. See the
[content backup](../content-backup/SKILL.md) skill.
**Ctrl+S** (Cmd+S on macOS) saves like the Save button (not Publish) and stops the browser's save
dialog. It does nothing while a save runs, while a dialog is open, or when the user cannot write.
## The form context
`usePlutoContentForm()` (`app/composables/pluto-content-form.ts`, types in
`shared/types/content-form.ts`) gives a field widget the state of its form. It returns `null`
outside a `PlutoContentForm`, so check for it. The widget contract (`field`, `modelValue`,
`disabled`, `update:modelValue`) does not change.
```ts
const form = usePlutoContentForm()
form?.onSaved((saved) => refetchMedia(saved.id)) // after each save that worked
```
| Key | Meaning |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`, `item`, `editing` | the content type, the item (owned by the form), edit mode |
| `loading` | true while the item of an edit page loads. The form and its toolbar items mount before the item is there: code that reads the saved item waits for `editing && !loading` |
| `saving`, `dirty` | a save runs, the item has unsaved changes |
| `errorsByField` | the validation message of each field that failed the last save |
| `layout`, `canvas` | the layout, and true for 'canvas' |
| `onFlush(callback)` | runs synchronously before a save builds its payload, and before each backup write (also when the page hides). A widget that holds edits outside `modelValue` (an editor with a debounce) writes them to the model there. Returns a stop function. |
| `onSaved(callback)` | runs after each save that worked, with the saved item. Returns a stop function. Vue stops it with the calling scope. |
| `updateField(name, value)` | sets one field by name, with the rules of the form (a change of the slug field stops the auto slug). For a widget that edits a field other than its own (the post title) |
| `openPanel(id)` | opens the right panel on one `PlutoContentCanvasPanel` tab ('canvas' only) |
| `panelToggles` | `{ left, right }`: true while that panel is closed and its open button floats at the top of that side (desktop). `left` is always false in a canvas (the rail opens the left panel). A canvas widget keeps the corner free (the post preview adds `pe-12`) |
## Skeletons and scroll
The skeletons have the shape of the real content, so nothing jumps when it loads
(`app/components/Pluto/Skeleton/`):
- `PlutoSkeletonField` takes the `field`: the label, a description line when the field has one,
and a control by type (an input, a text area, a rich text editor with its toolbar, a switch,
media tiles or one image, a slug with its link line).
- `PlutoSkeletonList`: see "Long lists".
- `PlutoSkeletonCanvas`: a page (title, lead, paragraphs, image, cards) for the canvas field while
the item or the widget code loads (`PlutoContentField` with `canvas`).
- `PlutoSkeletonPanel`: a list panel (header, rows, an indented group, footer) for the left panel
of a canvas form. A type turns it on with `form.leftPanel` (a label, or `{ label, class }`). It
shows until the widget registers the panel, while the item loads or the canvas widget has not
rendered (`PlutoContentField` emits `ready` on Suspense resolve). After that, a missing panel is
final (for example the Markdown mode of the page editor).
- `PlutoSkeletonWidget`: a dashboard card with a header and a body.
The scroll regions keep the scrollbar space (`scrollbar-gutter: stable`), so the content does not
move sideways between a short and a long page: `<main>` of `PlutoViewAdminPanel`, and the body
of the admin layout panel unless it holds a `PlutoViewAdminPanel` (`data-pluto-view`), which
scrolls in its own region.
The splitter handles are a 1px line. A `::before` 2.5px wider on each side is the 6px grab area
and the 6px haze-400 bar, which fades in after 300ms of hover and shows at once while dragging.
## The canvas layout
`form: { layout: 'canvas', canvasField: 'body' }` gives a full-height field between a left panel and
a right panel. `defineContentType` warns in dev when `canvasField` names no field.
- The `canvasField` widget fills the main region (`PlutoViewAdminPanel` with `fill` and `width: 'full'`).
Its root must fill its parent (`h-full`) and scroll its own content.
- Every other field goes in a tab of the right panel, sorted by `order`. The tab takes the label of
the type ("Post", "Page"), else "Page" (`pluto.canvas.page`). `region` does not matter in this
layout.
- The core post editor (`widget: 'post-canvas'`, see the git-cms skill) is a canvas widget: an
outline in the left panel, the title above the text, and a Visual mode or a Markdown mode with a
preview of the site.
- With the rail (canvas form, desktop), `PlutoViewAdminPanel` draws a "sheet". The root has
`bg-pluto-frame`. The left panel and the main region form the sheet, with rounded top corners
(`rounded-ss-xl` on the left panel, or on main when there is no left panel, and `rounded-se-xl` on
main). There is no border under the toolbar and no border on the rail. The splitter handle is
transparent, except the line after the left panel. With no aside open, the frame shows 16px at the
right (`pe-4`), and the floating "show panel" button is at `right-6`.
- The alerts of the form (locked, recovery offer, backup conflict, other tab, other device,
validation errors) are one block. A widget can show it in its own element with
`claimAlerts(target)` of the canvas host (`PlutoCanvasHost`). The post editor shows it above the
title, in the text column. Without a claim, the block shows above the canvas, on the editor
background. `PlutoContentBackupAlert` has no `canvas` prop.
- A canvas widget that shows another field itself (the post editor shows the title) calls
`claimFields(() => [name])` of the canvas host (`inject(plutoCanvasHostKey)`): the right panel
leaves that field out. The call returns a function that gives it back (call it on unmount).
- A widget adds panels with `PlutoContentCanvasPanel` (props `side: 'left' | 'right'`, `id`,
`label?`, `icon?`; slot: the panel content):
- `left`: the content stacks in the left panel. Put `PlutoViewLeftCollapse` in its header.
- `right`: the content is one tab of the right panel (`UTabs`, widget panels first, then "Page").
With one tab, the aside title shows its label and there are no tabs.
- The panel content stays in the widget's component tree. Vue `Teleport`s the DOM into an element
of the form. The wrapper is `flex min-h-0 flex-1 flex-col`, so a left panel fills the column
and its footer sits at the bottom. The element is a ref, so the content mounts when the element exists (the panel is
open, the tab mounted) and the state of the widget does not reset. Outside a canvas form,
`PlutoContentCanvasPanel` renders its slot inline.
- Desktop: an open panel closes from the button in its own header (an X for the left panel). The
left panel opens from the rail (`#rail` of `PlutoViewAdminPanel`), and starts closed (the
cookie `pluto-content-left-<type>`, default `false`). A closed aside opens from a small square
button (`variant="outline"`, `size="sm"`) that floats at the top right of the row.
`PlutoViewAdminPanel` draws them with `panel-toggles` (the form sets it, with
`v-model:aside-open`; `asideOpen` is a model now). The form toolbar shows no panel toggle on
desktop, except the left one while the left panel is open and has no `PlutoViewLeftCollapse`.
- A left panel uses `PlutoViewSidePanel` (`app/components/Pluto/View/`) as its shell, so every
panel of every layer looks the same as the rail: the `bg-pluto-panel` background (`--ui-bg`, the editor
background; an `@utility` in `pluto-layer.css`), a 48px header with the `title`
(hidden below `lg`), the `#actions` slot and `PlutoViewLeftCollapse` (`collapse`, default
true), a body in a Reka UI scroll area with a thin scrollbar on hover (the default slot, no
padding), and an optional `#footer` slot. The Outline of a post uses it.
- Narrow screen: the toolbar toggles open the slideovers. Back (or the back swipe of a phone)
closes an open slideover and keeps the page: `usePlutoBackClose(open, enabled?)`
(`app/composables/pluto-back-close.ts`) adds a history entry with the same URL (the state of Vue
Router plus one key) while it is open, and goes back once when the slideover closes from itself.
A navigation from the slideover keeps the entry. `PlutoViewAside`, the left slideover of
`PlutoViewAdminPanel` and the navigation menu of the admin layout use it. Use it for any new
overlay of a narrow screen that changes the view.
- Below `lg`: the left panel is a slideover (a toggle), the right panel is a slideover (a toggle).
Both start closed and keep no cookie (a saved "open" would cover the page on the first visit).
On desktop the left state is the cookie `pluto-content-left-<typeName>` and the right state is
`pluto-content-aside-<typeName>`.
Use `openPanel('block')` from the widget to bring a tab forward, for example when the user selects
a block.
Every icon-only button in the form toolbar has an `aria-label` and a `UTooltip`: the aside toggle
("Show settings" / "Hide settings") and the overflow menu ("More actions").
**Narrow screens (below `lg`, 64rem).** With `layout: 'default'`, the form renders the aside
fields inline, in a titled "Settings" section under the main fields, and renders no slideover and
no aside toggle. A required field, such as a price, never hides behind a button. With
`layout: 'focus'` (the blog post type), the aside stays a slideover and the toggle stays. On a
wide screen nothing changes. The form reads the breakpoint with `useMediaQuery`, as
`PlutoViewAside` does.
The aside's open/closed state persists per content type, in a cookie keyed
`pluto-content-aside-<typeName>`, so a user's choice survives a page reload.
## The publish workflow
A content type opts into a draft/published workflow by setting `status` (see the content-model
skill for the full `PlutoContentStatus` shape: `values`, `default`, `publishedValue`,
`publishedAtColumn`, `column`). `PlutoContentForm` reads `type.status` to decide what to show:
- No `status` declared (`status` unset or `false`) — one plain "Save" button. Byte-identical to
a content type with no publish workflow at all; `onSave()` is called with no argument.
- `status` declared, current value is not `publishedValue` — a "Save draft" button right before
the "Publish" button. With a schedule, "Schedule" (a `ghost` button) comes first. Publish calls `onSave(publishedValue)`. A save with no override is a plain
"Saved" (the toast does not say "Unpublished").
- `status` declared, current value is `publishedValue` — an "Update" button, plus an "Unpublish"
entry in the overflow menu that calls `onSave(draftValue)`.
`status` travels at a fixed payload key: `onSave(statusOverride)` always writes the override to
`payload.status`, regardless of what `type.status.column` is. The generic write path already
maps `status` to the right storage column server-side (`mapFieldsToColumns`/the content adapter),
so the client never needs to know the column name.
**`capabilities.publish` falls back to `capabilities.write`** when unset — the same
"no capability declared means open" rule every other capability check in this project follows.
Never call `can('')` as a stand-in for "no capability declared":
```ts
const canPublish = computed(() => {
const cap =
contentType.value?.capabilities?.publish ??
contentType.value?.capabilities?.write
return !cap || can(cap)
})
```
`mapColumnsToFields` returns `item.status` symmetrically with the write side: when
`type.status` is set, it reads the status column (`type.status.column`, default `'status'`) back
off the stored row, the same column `@plutocms/supabase`'s `content-adapter.ts` already writes
to on create/update. Without this, the generic form would send a status value on save but never
read one back, and `PlutoContentForm`'s Save/Publish/Update button logic — which depends on
reading the current status from the loaded item — would never see anything but the default.
## The `contentActions` registry bucket
A layer adds its own button to the generic content form's toolbar (or aside) without a bespoke
form component, the same way it adds a nav item or a dashboard widget — through
`definePlutoExtension`:
```ts
definePlutoExtension({
id: 'supabase-shop',
contentActions: [
{
id: 'sync-inventory',
contentType: 'product',
label: 'Sync inventory',
icon: 'lucide:refresh-cw',
placement: 'toolbar',
show: (ctx) => ctx.editing,
onSelect: async (ctx) => {
await someInventorySync(ctx.item)
},
},
],
})
```
Match rule: `contentType` is either an exact content-type `name`, or `'*'` for every content
type — the same rule `PlutoContentFieldWidget` uses for field type. `placement` defaults to
`'toolbar'`.
`usePlutoContentActions(typeName, placement)` returns the matching, ordered action list as a
computed:
```ts
const toolbarActions = usePlutoContentActions('product', 'toolbar')
```
`show?: (ctx) => boolean` gates visibility per render — omit it to always show the action.
`onSelect(ctx)` receives a `PlutoContentActionContext`:
```ts
interface PlutoContentActionContext {
type: PlutoContentType
item: Record<string, unknown>
editing: boolean
saving: boolean
save: () => Promise<void>
remove: () => Promise<void>
}
```
`save` and `remove` call the form's own save/delete logic (including its confirm-delete modal),
so a registered action never re-implements either. There is no dedicated
`PlutoContentActions.vue` wrapper component — `PlutoContentForm` calls
`usePlutoContentActions` directly and renders the result as plain `UButton`s. A wrapper is not
worth adding while `PlutoContentForm` is the only consumer; revisit if a second one appears.
## The `contentToolbarItems` registry bucket
A layer adds a component (a status, an indicator) to the toolbar of the generic content form. The
toolbar renders it before the buttons, after the "View" link. The component gets no props. It
renders inside the form, so it calls `usePlutoContentForm()` to read the item and to run code
after a save (`onSaved`). It mounts before the item of an edit page loads: watch `editing && !loading`
(History and the build status do), not `onMounted` alone, or the item is still empty. The entry follows the rules of the other component buckets: register it
with `defineAsyncComponent` (dev warns about a sync component).
```ts
definePlutoExtension({
id: 'pluto-github',
contentToolbarItems: [
{
id: 'build-status',
contentType: '*', // a content type `name`, or '*' for every type
order: 50,
enabled: () => true,
component: defineAsyncComponent(() => import('./BuildStatus.vue')),
},
],
})
```
`usePlutoContentToolbarItems(typeName)` returns the matching entries as a computed (the same match
rule as `usePlutoContentActions`; the registry sorts by `order`). `PlutoContentForm` passes the list
to `PlutoContentFormHeader` in the `toolbarItems` prop. The component must show nothing when it has
nothing to say, because the item has no `show` test. Core uses it for History (`history`, order 40, every
type; see the content-model skill, "Revisions"), and the Git CMS for its build status (order 50, see
the git-cms skill). Tests: `test/content-toolbar-items.test.ts`.
## Known limits, out of scope for this pass
- No per-layer adoption of the publish workflow yet. A content type declares `status` and gets
the workflow for free, but no shipped content type in this repo declares one yet — that is a
backend layer's job, in a later wave.
- `contentActions` has no built-in ordering field beyond `PlutoEntry.order` (inherited, same as
every other registry bucket) — a layer that needs a specific position among several actions
sets `order` explicitly.