Skip to content

Move the form outline into an Outline tab in the builder sidebar - #3689

Merged
Crabcyborg merged 1 commit into
form_outlinefrom
form_outline-ui
Nov 11, 2026
Merged

Crabcyborg merged 1 commit into
form_outlinefrom
form_outline-ui

Conversation

@tuguirazvan

Copy link
Copy Markdown
Collaborator

Follow-up to #3666, from the team review of the builder header.

  • The form outline is now a third sidebar tab next to Add Fields and Field Options, replacing the floating button and popover
  • It lists pages (on multi-page forms), sections and fields in form order, with search
  • The page you're scrolled to is highlighted as you scroll
  • No "More actions" (⋯) menu in the header: Build and Settings don't need one now
  • The form switcher chevron uses grey-500 to match the "Saved X min ago" label from the Form Revisions add-on

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@deepsource-io

deepsource-io Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in c0e191d...f72b2d0 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

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.

@franky-the-going-merry franky-the-going-merry Bot added the franky-working Franky is actively reviewing this label Nov 11, 2026

@franky-the-going-merry franky-the-going-merry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 reads aria-expanded on #frm-builder-outline-toggle, which is now an <a> inside an <li> and has no such attribute. Lines 83 and 87 assert cy.get('.frm-builder-outline').should('not.be.visible'), but .frm-builder-outline no longer exists in the DOM. Line 10 and lines 149-153 expect the panel to close on Escape and to be not.be.visible afterwards, but the Escape handler was deleted and a tab panel stays open. Lines 129-139 expect .frm-builder-outline-page rows 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-toggle and waiting for #frm-builder-outline to 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 labeled run e2e tests and on the default branch. It showed as skipped here only because the base is form_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 ) );

@franky-the-going-merry franky-the-going-merry Bot Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

@franky-the-going-merry franky-the-going-merry Bot removed franky-review franky-working Franky is actively reviewing this labels Nov 11, 2026

@Crabcyborg Crabcyborg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Razvan!

🚀

@Crabcyborg
Crabcyborg merged commit 79f38ea into form_outline Nov 11, 2026
56 checks passed
@Crabcyborg
Crabcyborg deleted the form_outline-ui branch November 11, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants