Repository navigation
Move the form outline into an Outline tab in the builder sidebar - #3689
Conversation
The outline is now a third tab next to Add Fields and Field Options instead of a floating button and popover. It lists every page (on multi-page forms), section and field in form order, with search, and tracks the current page while scrolling. The form switcher chevron uses grey-500 to match the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Nov 11, 2026 7:59a.m. | Review ↗ | |
| JavaScript | Nov 11, 2026 7:59a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Request Changes: the existing Cypress spec for the outline was not updated for the new tab, so it will fail once this reaches a branch where CI runs it. Two smaller UX issues are inline.
Blocking
tests/cypress/e2e/Forms/formOutline.cy.js(not touched by this PR) still tests the removed floating button and popover. Line 6 readsaria-expandedon#frm-builder-outline-toggle, which is now an<a>inside an<li>and has no such attribute. Lines 83 and 87 assertcy.get('.frm-builder-outline').should('not.be.visible'), but.frm-builder-outlineno longer exists in the DOM. Line 10 and lines 149-153 expect the panel to close on Escape and to benot.be.visibleafterwards, but the Escape handler was deleted and a tab panel stays open. Lines 129-139 expect.frm-builder-outline-pagerows to appear only for multi-page forms and a search to hide fields, which is also changed here. Fix: rewrite the spec for the tab. Open it by clicking#frm-builder-outline-toggleand waiting for#frm-builder-outlineto be visible, drop the "hidden until the form has pages" and Escape cases, and assert that every field, section and page row is listed without a search, plus the search, empty-state and jump cases. This spec runs on PRs labeledrun e2e testsand on the default branch. It showed as skipped here only because the base isform_outline.
Non-blocking (inline)
- On a multi-page form the first field repeats under its page row.
- The "current page" highlight is stale when the tab is opened after scrolling.
Tests run: Cypress spec not run. The failures above are from reading the spec against the new markup, and I did not bring up the Cypress stack in this pass. No new tests were added for the new tab behavior.
Checked live (preview env, Lite at f72b2d0, form with 7 fields): the Outline tab appears beside Add Fields and Field Options and opens the panel. All 7 fields are listed in order, search "work" shows only Work email, and "zzzz" shows "No results for “zzzz”". Clicking a row highlights the field and leaves the tab open. The panel lays out correctly at 1440px and at 800px. Single-page screenshot: https://github.com/user-attachments/assets/310920dc-1f04-4ce5-b3ab-9e115d23bef3
Not checked live: Formidable Pro was not active in the env, so Page Break and Section fields could not be added. For the multi-page view I changed data-type on existing builder rows to break and divider in the DOM. That exercises the outline's render logic but not Pro's real markup, or the scroll-based page tracking, which needs Pro's page pills. Simulated screenshot: https://github.com/user-attachments/assets/8970ee34-5527-4027-ba17-e63c66e4ea22
Nit, no action needed: the variable popover in js/src/admin/formOutline.js (line 41 and later) now refers to a tab panel. Renaming it to panel would match the new design.
| sectionButton.dataset.fieldId = field.dataset.fid; | ||
| sectionButton.dataset.pageIndex = page.index; | ||
| children.push( tag( 'li', { child: sectionButton } ) ); | ||
| rows.push( makeButton( isSection ? 'frm-builder-outline-section' : 'frm-builder-outline-field', text, field, page.index ) ); |
There was a problem hiding this comment.
On a multi-page form the first field of each page is listed twice in a row. The page row's title falls back to the first non-HTML field's label when the page has no heading (getPages, title), and this line then also adds that field as its own row. The old code skipped this duplicate for sections; the check above (isSection && field === firstField && text === page.title && pages.length > 1) still only covers sections. Seen in a simulated multi-page DOM (screenshot in the review body): Page 2: Text is followed directly by a Text row, and Page 1: Bringing a guest? by a Bringing a guest? row.
Fix: apply that skip to any first field when no search is active (a search result must still show its match):
if ( field === firstField && text === page.title && pages.length > 1 && query === '' ) {
return;
}Replace the existing isSection && field === firstField && ... check with this one.
| const updateDock = () => { | ||
| const pills = getPagePills(); | ||
| const updateCurrentPage = () => { | ||
| if ( ! isOpen() ) { |
There was a problem hiding this comment.
updateCurrentPage returns early while the tab is closed, and updateOutline (line 230) renders without calling it, so currentPageIndex is only refreshed by scroll events that happen while the Outline tab is open. If the user scrolls down to page 3, then opens the Outline tab, the highlight sits on page 1 (the last value computed) until they scroll again. The PR description says the page you are scrolled to is highlighted.
Fix: compute the index without rendering, and call it from updateOutline before render(). For example, split the loop into a getCurrentPageIndex() helper that updateCurrentPage and updateOutline both use, so opening the tab renders with the right page. (This is read from the source; page tracking needs Pro's page pills, which were not available in the preview env.)
Follow-up to #3666, from the team review of the builder header.
🤖 Generated with Claude Code