Skip to content

Comments

fix: convert spaces to underscores in subwallet lightning address suggestion#2086

Open
Dunsin-cyber wants to merge 1 commit intogetAlby:masterfrom
Dunsin-cyber:fix/subwallet-address-sanitization
Open

fix: convert spaces to underscores in subwallet lightning address suggestion#2086
Dunsin-cyber wants to merge 1 commit intogetAlby:masterfrom
Dunsin-cyber:fix/subwallet-address-sanitization

Conversation

@Dunsin-cyber
Copy link
Contributor

@Dunsin-cyber Dunsin-cyber commented Feb 18, 2026

fixes #2070

This PR improves the subwallet creation UX by updating the lightning address suggestion logic to support underscores. Instead of stripping all non-alphanumeric characters, the code now converts spaces to underscores.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced lightning address generation to properly handle whitespace and support underscore characters in addresses.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The lightning address initialization logic in SubwalletCreated.tsx was modified to support underscores and handle whitespace more intelligently. Consecutive spaces are now converted to underscores, and the string is trimmed before filtering invalid characters.

Changes

Cohort / File(s) Summary
Lightning Address Logic
frontend/src/screens/subwallets/SubwalletCreated.tsx
Updated intendedLightningAddress initialization to support underscores, trim whitespace, replace consecutive spaces with underscores, and filter to allow only a-z, 0-9, and underscore characters.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 With whiskers twitched and ears held high,
We've taught addresses underscores to try!
Spaces become dashes, trimmed with care,
Lightning flows smoother through the air! ⚡

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting spaces to underscores in the subwallet lightning address suggestion logic.
Linked Issues check ✅ Passed The code changes directly address issue #2070 by modifying the lightning address initialization logic to convert spaces to underscores and support underscore characters.
Out of Scope Changes check ✅ Passed All changes are scoped to the intendedLightningAddress initialization logic in SubwalletCreated.tsx, directly addressing the issue requirements.

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

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Subwallet lightning address suggestion should support underscores

1 participant