Skip to content

fix: disable Next until key setup option is selected - #3519

Open
Chewy-b0t wants to merge 1 commit into
getAlby:masterfrom
Chewy-b0t:fix-onboard-next-disabled-until-selection
Open

fix: disable Next until key setup option is selected#3519
Chewy-b0t wants to merge 1 commit into
getAlby:masterfrom
Chewy-b0t:fix-onboard-next-disabled-until-selection

Conversation

@Chewy-b0t

@Chewy-b0t Chewy-b0t commented Mar 27, 2026

Copy link
Copy Markdown

Summary

  • keep the key setup Next button disabled until the user selects an option
  • remove the implicit default selection from the master key onboarding screen
  • add a focused test covering the disabled-to-enabled flow

Fixes #3117.

Testing

  • corepack yarn test:unit src/app/screens/Accounts/GenerateMnemonic/new.test.tsx --runInBand
  • ./node_modules/.bin/eslint src/app/screens/Accounts/GenerateMnemonic/new.tsx src/app/screens/Accounts/GenerateMnemonic/new.test.tsx
  • corepack yarn prettier --check src/app/screens/Accounts/GenerateMnemonic/new.tsx src/app/screens/Accounts/GenerateMnemonic/new.test.tsx

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • The "Next" button on the account generation screen is now disabled until a selection is made, preventing users from proceeding without choosing an option.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3ed46108-4233-4522-9330-e5f450263e0e

📥 Commits

Reviewing files that changed from the base of the PR and between de0d373 and 10b6d71.

📒 Files selected for processing (2)
  • src/app/screens/Accounts/GenerateMnemonic/new.test.tsx
  • src/app/screens/Accounts/GenerateMnemonic/new.tsx

📝 Walkthrough

Walkthrough

This PR fixes a bug where the Next button in the GenerateMnemonic component was always enabled initially. The changes initialize the selectedCard state as null instead of "backup", add a disabled attribute to the Next button until a selection is made, and introduce a test validating this behavior.

Changes

Cohort / File(s) Summary
Component State & Validation
src/app/screens/Accounts/GenerateMnemonic/new.tsx
Updated selectedCard state initialization from fixed "backup" to union type `"backup"
Component Testing
src/app/screens/Accounts/GenerateMnemonic/new.test.tsx
Added new test file validating MnemonicExplanation component behavior. Tests verify the Next button is initially disabled and becomes enabled after selecting the "Create Master Key" option, with mocked API and theme dependencies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A button once eager, now patient and wise,
Waits for a choice before opening skies,
With null as the start, disabled the way,
Until options are picked—then Next saves the day!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: disable Next until key setup option is selected' clearly and concisely describes the main change in the pull request.
Description check ✅ Passed The description provides a clear summary of changes, links to issue #3117, specifies testing instructions, but does not follow the provided template structure with explicit Type of change section.
Linked Issues check ✅ Passed The PR directly addresses issue #3117 by disabling the Next button until a key setup option is selected, removing implicit default selection, and adding test coverage.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the bug in issue #3117: component behavior update, test file addition, and no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

[BUG] The NEXT button should be disabled until we select one of the two options

1 participant