admin.panel: false to open records on their edit page instead.
Layout
From the top, the panel shows:- The header, one bar pinned to the top, the same bar every side panel uses. On the right, always in this order: a status slot, a ••• menu, open full page and close (✕). The status slot shows one thing: Unsaved and Save while a collection without autosave has unsaved edits (and Save on a new record), otherwise Mark complete for collections with
useAsDone, which saves at once and reads Completed in green, otherwise Saved for drafts autosave. Below 480 px wide, Mark complete shrinks to a check icon. The menu holds copy link, duplicate, create new, youractions, the last saved time and delete in red. On the left the header never repeats what you can see: nothing at rest, since the view behind the panel already names the collection (also after a reload or a shared link), and a back link (‹ Budget feature) when the record was opened from inside the panel. The title joins it once the body’s title scrolls under the header. At narrow widths the back link and title truncate; the buttons never wrap. - The
useAsTitlefield as a large heading you edit in place, wrapping onto more lines rather than cutting off. It needs a text, textarea or email field. Without one, the header always shows the title. - Your
beforeFieldscomponents. - The
propertiesfields as label and value rows. - Every other field, in config order. No field appears twice.
- Your
afterFieldscomponents. - Your
footercomponents, pinned under the scrolling body.
trash.
A replaced Header keeps the title in the body. Esc closes the panel unless a menu, picker or dialog inside it is open.
Settings
Settings go inadmin.panel, React components in admin.components.panel, the same split as the edit view.
Components
Every slot gets
PanelComponentProps:
payload, req, permissions and doc. Functions can’t cross from the server, so a server component’s client children read close and expand from useRecordPanel():
Component renders inside the edit form, so it can use the form hooks such as useField and useDocumentInfo. The footer is portalled below the form’s element, so a <form> of its own, such as a comment box, doesn’t nest inside the edit form, and Enter in it doesn’t save the record.
Building blocks
@frogbotai/ui/admin exports the pieces the panel is made of, so your slots look like the built-in parts:
SidePanelMenuItemfrom@frogbotai/uiis an item in the header’s ••• menu. Render it fromactions;onSelectruns when it’s chosen, anddangercolours it red.PanelIconButtonis the panel’s 32 px icon button. Give it aniconat 16 px and alabel, which is also its tooltip.PanelSectionis a titled block: aheading, an optional add button (onAdd,addLabel) and its content.- The
fb-pill-tabsclass on a tabs field gives it small pill tabs. The error count on a tab with invalid fields and the remembered tab per record work as before.
Opening a record from inside the panel
A component inside the panel that opens another record of the collection passesfrom: 'panel', so the header shows a back link to the record it came from:
Activity and comments
Activity and comments are fields, so the full edit page shows them too. Put a tabs field at the end offields, with commentsField() from the comments plugin in one tab and activityField() from the audit log plugin in another:
Saving
The panel saves the way the edit page does: the Save button or Cmd/Ctrl-S, or autosave when the collection hasversions.drafts.autosave, which hides Save. A save updates the record’s card, row or event; unsaved values never show on it. Switching records, closing, Esc and clicking outside ask before throwing away unsaved edits.
Custom views hear about saves and deletes with useRecordPanelEvents:
Behavior
- The open record is
?record=<id>on every view. Reload, Back and shared links reopen it. Opening or switching a record replaces the history entry, so Back doesn’t step through each record. - Cmd, Ctrl or Shift-click, or a middle click, opens the record’s edit page in a new tab.
- Esc, the close button, or a click on the view outside a record closes the panel.
- A record that is missing or the user can’t read closes the panel with a not-found message.
- Below 768 px the panel covers the view.
- With
panel: false,?record=<id>redirects to the record’s edit page, so shared links keep working. - Create, from a board column or a calendar slot, opens the create form in the panel; the first save switches it to the new record.