Skip to content

BB-887: fix: Prevent navigation from invalid tabs in Unified Form#1259

Open
atharvsp02 wants to merge 1 commit intometabrainz:masterfrom
atharvsp02:BB-887
Open

BB-887: fix: Prevent navigation from invalid tabs in Unified Form#1259
atharvsp02 wants to merge 1 commit intometabrainz:masterfrom
atharvsp02:BB-887

Conversation

@atharvsp02
Copy link
Copy Markdown
Contributor

@atharvsp02 atharvsp02 commented Mar 9, 2026

Problem

Ticket: BB-887
Users can navigate away from a tab in the Unified Form even if they have left required fields empty or invalid. This allows them to reach the final Submit tab, but find the "Submit" button disabled with no clear indication of what went wrong.

Solution

Navigation is now blocked when leaving a tab with validation errors:

  • The "Next" button is disabled.
  • Forward tab navigation via the tab headers is blocked.
  • A Bootstrap Danger Alert appears above the buttons explaining which tab needs attention (eg.Fix errors in 'Cover' to continue).
  • Users can still freely navigate through completely empty tabs to allow them to browse the form structure before filling it out.

Areas of Impact

  • unified-form.tsx - Tab validation and navigation blocking
  • navbutton.tsx - Added error alert above navigation buttons
  • type.ts - Added errorMessage prop to NavButtonsProps

Screenshot

Cover Tab(when some required fields are empty or invalid)

image

Content Tab(reached while previous tabs are empty)

image

Let me know if you have any suggestions or changes you’d like me to make.

Testing

  • I have run the code and manually tested the changes

AI usage

  • I have used AI in this PR (add more details below)
  • I understand all the changes made in this PR

@faizanakhtar123
Copy link
Copy Markdown
Contributor

faizanakhtar123 commented Mar 9, 2026

Hi @atharvsp02 Thank you for opening this PR.... Please fill in the "AI usage" section in the PR template, it is there for a reason...
For better understanding - metabrainz/listenbrainz-server#3610

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.

2 participants