Skip to content

[6.x] Keep the current tab when switching forms - #16057

Merged
jasonvarga merged 1 commit into
6.xfrom
16057-keep-form-tab-when-switching
Nov 27, 2026
Merged

jasonvarga merged 1 commit into
6.xfrom
16057-keep-form-tab-when-switching

Conversation

@jaygeorge

@jaygeorge jaygeorge commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Description of the Problem

Closes #16047

Switching forms from the breadcrumb dropdown or the sidebar goes to /cp/forms/{handle}, which redirects to Results if the form has submissions and to Edit if it doesn't. So you get bounced between tabs depending on which form you pick, and whatever tab you were on (Logic, Connect, Configure) is lost.

What this PR Does

When you arrive at a form from another form's tab, you land on the same tab. If you don't have permission for that tab, or you came from somewhere else (like the forms listing), you get the existing redirect.

I've used the previous page's URL rather than remembering the last tab in the session. That way only switching between forms is affected, and clicking a form in the listing still lands where it always has. It also means the breadcrumb and the sidebar both behave the same without any front-end changes.

I didn't make the breadcrumb itself carry the rest of the URL over, as that would break for pages with IDs in them, like entries.

16047-keep-form-tab.mp4

How to Reproduce

  1. Have one form with submissions and one without
  2. Open the first form's Logic tab
  3. Switch to the other form from the breadcrumb dropdown
  4. Before: you land on Edit. After: you stay on Logic

- Forms show page reuses the tab you came from (Logic, Results, etc.) when switching from another form
- Falls back to the old redirect without permission for that tab, or when not coming from a form
@jaygeorge
jaygeorge requested a review from jasonvarga November 25, 2026 14:56
@jasonvarga
jasonvarga merged commit 640e113 into 6.x Nov 27, 2026
66 checks passed
@jasonvarga
jasonvarga deleted the 16057-keep-form-tab-when-switching branch November 27, 2026 19:59
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.

Confusing UX when switching between forms

2 participants