Skip to content

feat(canvas): open a single-item default content run by default in the outline - #1314

Open
bpauli wants to merge 2 commits into
adobe:mainfrom
bpauli:dcsingle
Open

bpauli wants to merge 2 commits into
adobe:mainfrom
bpauli:dcsingle

Conversation

@bpauli

@bpauli bpauli commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What

In the Experience Workspace Outline panel, a "Default content" run that holds a single item now starts expanded, so its one child is visible without a click. The run keeps its chevron and stays collapsible - only the default state changes. Multi-item runs are unchanged (still default-collapsed).

Closes #1306.

How

  • ew-page-outline.js: a run with children.length === 1 renders expanded by default. Multi-item runs track open keys in _expandedContent; single-item runs default open and track explicit collapses in a symmetric _collapsedContent set. Both are keyed by proseIndex, both reset on a structural reparse.
  • _toggleContentGroup(key, single) flips the key in whichever set applies.
  • _expandRunForProse clears a single-item run's collapse so a doc selection always reveals it (the "selection never hides" invariant).
  • No CSS change: the chevron stays as-is.

Testing

  • test/unit/.../ew-page-outline.test.js: added cases for a single-item run showing its child by default with the chevron kept, collapse/re-expand on header click, and child selection. Existing tests that used single-item fixtures to assert default-collapsed behaviour were moved to multi-item runs.
  • All 21 outline unit tests pass; eslint clean on the changed files.

…e outline

A "Default content" run that holds one item now starts expanded, so its
child shows without a click. The run keeps its chevron and stays
collapsible. Multi-item runs do not change.

Closes #3. Refs adobe#1306.
# Conflicts:
#	blocks/canvas/ew-page-outline/ew-page-outline.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EW] When a default content run contains only a single item, don't collapse it

2 participants