Spec: Accordion block editing
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, typescript
- Domain
- developer-experience, frontend
Research direction
Start with the interactive prototype linked in the issue and inspect the existing Volto and Aurora block editing entry points. The specification describes the selection hierarchy, panel and block operations, accessibility behavior, and preview behavior; compare these with the existing editor before identifying implementation boundaries. Done means the shared editing experience follows the specified behavior, with the toolbar variant, allowed blocks, filtering rules, and migration mapping resolved.
Written by the indexing model from the issue text.
Description
Summary
Spec for the editing experience of the Accordion block: one interaction model meant to work for both Volto and Aurora. It comes from an interactive prototype that shows the edit view, the sidebar and the published view side by side:
👉 Prototype:
Accordion editing prototype – Accordion editor (interactive).html
An accordion is a list of panels. Each panel has a title and its own list of blocks. Editing follows a selection hierarchy: Page › Accordion › Panel › Block.
Data model
type AccordionBlock = {
'@type': 'accordion';
exclusive: boolean; // "Only one panel open at a time" (published view only)
theme: 'white' | 'grey'; // background
panels: Panel[]; // at least 1
};
type Panel = {
id: string;
title: string;
startOpen: boolean; // "Open when the page loads"
anchor: string; // slug; links to #anchor open this panel and scroll to it
blocks: Block[]; // at least 1 (an empty text block if all are removed)
};
In the editor every panel also has an open state that is editor-only and is not saved.
Allowed blocks inside a panel
Text, Image, Teaser, Listing, Table, Separator.
- Accordions cannot be nested. Every block chooser inside a panel shows the note "Accordions can't be placed inside an accordion."
- Block settings inside an accordion are the block's usual settings, filtered by rules for blocks inside an accordion:
- Image: always uses the panel's full width, so size and alignment are not offered. Alt text stays.
- Teaser: takes the accordion's background, so its own background colour is not offered.
- Text: has no settings of its own; formatting comes from the inline toolbar shown when words are selected.
Edit view (canvas)
Accordion frame
- Labelled "Accordion" with Expand all and Collapse all actions.
- Add panel button at the end of the list.
- Clicking the frame or its label selects the accordion. Clicking the empty canvas selects the page.
Panel header
- Chevron to expand or collapse (
aria-expanded, label "Expand/Collapse <title>"). - Inline, editable title (placeholder: "Untitled panel").
- Block count ("3 blocks").
- Panel actions: Move up, Move down, Duplicate, Delete. Move up/down are disabled at the ends. Delete is disabled when only one panel is left.
- An insert point between panels adds a new panel at that position.
Panel body
- Blocks are listed in order. Each block has a toolbar with Move up, Move down and a "Block actions" menu (Move up, Move down, Duplicate, Delete, Turn this into… to change the block type).
- Insert points between blocks ("Insert a block at the top of this panel", "Insert a block between block 1 and 2") open the block chooser.
- An Add a block control at the end of each panel ("Add a block to “<title>”").
- A text block placeholder reads "Type text, or / for other blocks". Typing
/in an empty text block opens the chooser and replaces that block. - Image and Teaser show placeholders in the canvas ("choose or upload an image in the sidebar", "choose a target page in the sidebar").
- Insert points and add controls only show while the accordion (or something inside it) is selected.
Open state while editing
- While editing, panels open and close independently, even when
exclusiveis on, so editors can work on several panels at once. - Collapsing a panel that contains the selected block moves the selection up to that panel.
- Adding a block to a panel opens it.
Block toolbar visibility (open design question)
The prototype has a tweak to compare three variants:
- Faded: toolbars on all blocks, faded unless selected.
- Compact: a smaller toolbar.
- Selected only: only the selected block shows its toolbar.
In every variant the toolbars hide while the user is typing and come back when the mouse moves.
Sidebar
A breadcrumb at the top shows the selection path (Page › Accordion › Panel “…” › Block). Each crumb can be clicked to select that level.
- Page (nothing selected): "Click the accordion's frame or its label, a panel header or a block to see its settings here."
- Accordion
- Panel count.
- Panels outline: one row per panel (
1. Title, block count, "opens on load" if set). Drag to reorder, with a drop indicator before or after. Clicking a row selects and opens that panel. - Add panel.
- Behaviour: "Only one panel open at a time". Help text: it applies to the published page, and while editing panels open and close independently.
- Background: White (
#ffffff) or Grey (#ecebeb) swatches.
- Panel
- Position ("Panel 2 of 3 · 2 blocks").
- Title.
- Open when the page loads (checkbox).
- Link anchor: a slug. The placeholder is the slug of the title, or
panel-<n>. Help text: "Links to # open this panel and scroll to it." - Panel actions: Move up, Move down, Duplicate, Delete.
- Block
- Type and position ("Block 1 of 3 in “Opening hours”").
- The block's settings, filtered by the rules above.
- Move up, Move down, Delete.
Operations and their rules
| Operation | Behaviour |
|---|---|
| Add panel | New panel has an empty title, is open, and holds one empty text block. Focus goes to its title. |
| Duplicate panel | Inserted right after the original. Title gets " (copy)"; the anchor is cleared and startOpen is reset. Blocks get new ids. |
| Delete panel | Not possible on the last panel. Selection goes to the accordion. An Undo toast is shown. |
| Move panel | With the header buttons, sidebar buttons, drag in the outline, or Alt+Shift+↑/↓. |
| Add / insert block | Inserted at the chosen position; the panel opens; the new block is selected and focused. |
| Turn into… | Replaces the block type in place (the content is reset). |
| Delete block | Selection goes to the previous block. If the panel would be empty, an empty text block is added. An Undo toast is shown (not when an empty text block is removed with Backspace). |
| Undo toast | Restores the previous state and selection. It closes on its own after 8 s and can be dismissed. |
Keyboard
| Key | Action |
|---|---|
| Esc | Close an open chooser or menu; otherwise select the parent (block › panel › accordion › page) and move focus to it |
| Enter | New text block below; in a panel title, jump into the panel's first block |
/ |
In an empty text block: choose another block type |
| ↑ / ↓ | Previous or next block in the panel |
| Alt + Shift + ↑ / ↓ | Move the selected panel or block |
| Backspace | On an empty text block: remove it (when the panel has more than one block) |
| Delete | Remove the selected block (with undo) |
Accessibility
- Panel headers are buttons with
aria-expanded. Icon-only buttons havearia-labels (Move panel up, Delete block, Block actions…). The block menu usesrole="menu"/menuitemwitharia-expandedon its trigger. - The Edit/Preview switch and the theme swatches use
aria-pressed. - A live region announces structural changes, for example "Panel added at position 3 of 4", "Block moved to position 2 of 3", "Block changed to Image", "All panels collapsed", "Panel deleted", "Undone".
- Focus is managed after each operation: a new panel focuses its title, a new or moved block is focused, and Esc focuses the parent.
Published view (Preview)
- Only the panel titles are shown. Clicking one toggles it.
- When
exclusiveis on, opening one panel closes the others. - Panels marked "Open when the page loads" start open. When
exclusiveis on, only the first of them does. - Empty text blocks are not rendered.
- Links to
#<anchor>open the matching panel and scroll to it.
Out of scope / open questions
- Which block toolbar variant to use (Faded, Compact or Selected only).
- The final list of allowed blocks and the full per-block filtering rules beyond Image and Teaser.
- How this maps onto the existing Volto accordion add-on data (migration).
Review and merge guide
The work is a stack of 9 PRs, #389 → #397. Each PR is based on the branch of the one before it, and #389 is based on main, so each PR's diff shows only its own changes. Review and merge them bottom-up, in the order of the table.
The accordion is a Plate.js block of @plone/plate, so it works in any editor that uses the Plate presets, Aurora's and Volto's. An ESLint rule keeps the accordion's code from importing Aurora's application packages.
The stack
| # | PR | What | Size | Breaking | Backend |
|---|---|---|---|---|---|
| 1 | #389 | The block's data model, normalization and published view | 24 files | No, new block | Any |
| 2 | #390 | Inserting an accordion and editing its panels: titles, open and close, add panels | 14 files | No | Any |
| 3 | #391 | Moving, duplicating and deleting panels, with Undo and screen reader announcements | 13 files | No. PlateEditor now renders a toaster; a host that has one passes toaster={false} |
Any |
| 4 | #392 | The blocks inside panels: insert points, the block toolbar, "Turn into", the slash menu in a panel, and a fix for nested Plone blocks | 18 files | No | Any |
| 5 | #393 | The accordion and panel settings, in a popover or in the host's sidebar (settingsContainer) |
13 files | No | Any |
| 6 | #394 | Images and teasers inside an accordion follow its layout, and their settings say so | 10 files | No | Any |
| 7 | #395 | Aurora's sidebar shows the settings of the accordion, its panels and the blocks inside | 9 files | No | Any |
| 8 | #396 | The how-to guide, the theme tokens, and visual regression tests | 7 files | No | Any |
| 9 | #397 | Polish after manual testing: animation, insert controls, Tab order, the Esc levels, block actions in the sidebar | 34 files | No | Any |
"Backend" means what the PR's features need. No PR changes the backend: the accordion is saved in the page's Plate value, like the other Plate blocks, so every PR works on the released plone.restapi, which is what CI runs.
No PR changes pnpm-lock.yaml or a package.json.
#389 adds an accordion to the native blocks page, which changes the three Native blocks screenshots, and #396 adds three Accordion screenshots. The PRs don't add baselines. See step 5 of "How to merge".
Each PR's description has the details: what changed, and the tests that ran.
How to review
-
The block (#389): the node structure in
packages/plate/components/editor/plugins/accordion/types.tsand the normalizer that keeps it valid (normalize.tsand its tests). Also the published view incomponents/ui/accordion-node-static.tsx(a heading holding a button, witharia-expandedandaria-controls, and a region; closed panels arehidden="until-found"), and the classes and tokens instyles/content.css. Everything later builds on these, and Volto will use them too. -
Editing (#390, #391, #392, #397): compare it with the prototype attached above, in Storybook and in Aurora. The unit tests cover the transforms and the keyboard, and the acceptance tests the flows, so skim them.
-
#397 changes two things from earlier PRs, after manual testing:
- Panels are only added at the end. #390 also had insert points between panels.
- The "Add a block" control at the end of a panel shows faintly while the pointer is over the panel. In #392 it only shows while the accordion is selected.
-
The settings and the host contract (#393, #395, #397): what a host gives
PlateEditor(settingsContainer,toaster). Also what a host uses to render the settings of the blocks inside an accordion:enhanceInnerBlockSchema,InnerBlockSettingsHeader,InnerBlockSettingsActionsanduseAccordionSettingsTarget. Aurora's side is inpackages/cmsui/components/BlockEditor/. -
The rules for blocks inside an accordion (#394):
inner-block-schema.ts, and theinnerBlockSchemaEnhanceroption for add-on blocks. -
Accessibility: use the keyboard only:
- Tab goes from the accordion's controls through its settings in the sidebar to the text after it.
- Esc selects the level above: block › panel › accordion › page.
- Enter in a title moves into the panel.
- Alt+Shift+↑/↓ moves a panel or a block.
- Delete on a selected block removes it, with Undo.
Changes are announced in a polite live region (
[data-plate-announcer]). -
The docs (#396, #397):
docs/how-to-guides/configure-accordion-blocks.md, and the accordion's rows indocs/how-to-guides/style-blocks-in-a-theme.md.
Manual check after #397:
-
Storybook: run
pnpm --filter @plone/plate storybookand open the Accordion editor and Accordion renderer stories. -
Aurora: run
make acceptance-backend-start, thenpnpm start. Edit a page:- type
/and choose Accordion, write panel titles, and add panels and blocks (text, Image, Teaser, Table); - move, duplicate and delete panels and blocks, and undo;
- open the accordion's and the panels' settings in the sidebar: "Only one panel open at a time", the background, "Open when the page loads", the link anchor;
- try the keyboard as above.
Save, then on the published page:
- open and close panels with the mouse and the keyboard;
- follow a link to
#<anchor>; - use find-in-page on the text of a closed panel.
- type
-
Volto (not tested yet): in a Volto project with this
@plone/plate, theblock-editorandblock-rendererpresets have the accordion, and its settings open in popovers.
How to merge
The repository only allows squash merges, and deletes a branch once its PR is merged. For each PR, in order:
- Check it's ready: CI is green, and its base is
main. - Squash and merge with the stack. Keep the PR title as the commit subject.
- Restack the rest. GitHub changes the next PR's base to
main, but its branch still has the merged PR's original commit, whichmainnow has as a squash commit. Press the stack's Rebase button, or ask Claude to "rebase the stack on main". Afterwards, each PR's diff must be unchanged, with only its own commits. - Wait for CI on the next PR before merging it.
- After #397, run the Update VRT Screenshots workflow on
mainwith the patternNative blocks|Accordion, so the nightly visual check has the new baselines.
Never merge main into a branch of the stack: the stack stops being linear, and GitHub asks for a rebase. To bring the stack up to date with main, rebase it.
Restack by hand
After squash-merging PR N, from a clean checkout:
git fetch origin
old=$(gh pr view N --repo plone/aurora --json headRefOid -q .headRefOid)
new=origin/main
for b in <the remaining branches, bottom-up>; do
head=$(git rev-parse origin/$b)
git rebase --onto "$new" "$old" "$head"
git push --force-with-lease=$b:$head origin HEAD:refs/heads/$b
new=$(git rev-parse HEAD); old=$head
done
No PR changes pnpm-lock.yaml. If main changes it meanwhile, check each branch with pnpm install --frozen-lockfile, which is what CI runs.
The branches, bottom-up: accordion-model-view, accordion-editor-panels, accordion-panel-actions, accordion-panel-blocks, accordion-settings, accordion-inner-blocks, accordion-aurora-sidebar, accordion-docs, accordion-editing-polish.
Assisted-by: Claude Opus 5.5
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 9
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 54
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plone/aurora
-
01 type: bug 41 lvl: easy
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yOpen01 type: bug 99 tag: UX Accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
01 type: bug 99 tag: UX Accessibility
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
Similar issues
-
accessibility bug dark-mode dashboards
Difficulty 1/5 Under an hour Newbie friendliness 84/100
quarto-dev/quarto-cli#15447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4655 ·
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount duePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
bug CRIT-3
Difficulty 1/5 Under an hour Newbie friendliness 70/100
NASA-AMMOS/anms#426 ·