refactor: extract shared Radio components and restyle Address Mode - #893
Conversation
|
Warning Review limit reached
Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
1db45fa to
172ba28
Compare
f3958e0 to
b91f860
Compare
b91f860 to
30a35e3
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/screens/AddressMode.js (1)
242-255: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPreference-screen layout styles (
container,content,intro,groupWrapper,bottomSpacer,buttonContainer) are duplicated verbatim across both screens. Given this PR's own goal of extracting shared preference-selection UI, consider extracting a small shared stylesheet (or aPreferenceScreenLayoutwrapper) for these common layout rules so future preference screens don't re-copy them.
src/screens/AddressMode.js#L242-L255: extractcontent/intro/introBold/groupWrapper(and the unchangedcontainer/bottomSpacer/buttonContainerbelow) into a shared stylesheet.src/screens/AmountFormat.js#L122-L123: extractgroupWrapper(and the unchangedcontainer/content/bottomSpacer/buttonContainer) using the same shared stylesheet.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/screens/AddressMode.js` around lines 242 - 255, Extract the duplicated preference-screen layout styles into one shared stylesheet and update both screens to reuse it: in src/screens/AddressMode.js lines 242-255, move content, intro, introBold, groupWrapper, and the unchanged container, bottomSpacer, and buttonContainer styles; in src/screens/AmountFormat.js lines 122-123, replace groupWrapper and the unchanged container, content, bottomSpacer, and buttonContainer styles with the shared definitions. Preserve each screen’s existing layout behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/screens/AddressMode.js`:
- Around line 200-205: Update the PreferenceSaveButton disabled state and the
onSave guard to include the in-flight saving state, using isSaveDisabled ||
saving in both places so rapid taps cannot start concurrent wallet mode updates.
---
Nitpick comments:
In `@src/screens/AddressMode.js`:
- Around line 242-255: Extract the duplicated preference-screen layout styles
into one shared stylesheet and update both screens to reuse it: in
src/screens/AddressMode.js lines 242-255, move content, intro, introBold,
groupWrapper, and the unchanged container, bottomSpacer, and buttonContainer
styles; in src/screens/AmountFormat.js lines 122-123, replace groupWrapper and
the unchanged container, content, bottomSpacer, and buttonContainer styles with
the shared definitions. Preserve each screen’s existing layout behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 630d7f56-2240-4cb3-ba4d-55e6a84a2c6f
📒 Files selected for processing (7)
src/components/PreferenceSaveButton.jssrc/components/Radio/RadioButton.jssrc/components/Radio/RadioGroup.jssrc/components/Radio/RadioOption.jssrc/components/Radio/index.jssrc/screens/AddressMode.jssrc/screens/AmountFormat.js
6be95a2 to
393a552
Compare
- Add shared RadioButton, RadioOption, RadioGroup and PreferenceSaveButton - Rebuild Amount Format from the shared components (no visual change) - Restyle Address Mode to match Amount Format: single bordered card + divider, primary radios, muted italic hints; keeps the async single-address check, warning banner and saving modal Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JngBrG33ttocfxorUk3Vew
- keep a selected radio visible while disabled: `selected` decides whether the inner dot renders, `disabled` only decides its color - drop `PreferenceSaveButton` in favour of `NewHathorButton`, and move the msgid to sentence case so `textTransform` applies the uppercase - fade the whole option text block when disabled so title, description and hint keep their relative weight - guard `onChange` on `option.disabled` as well as the touchable - block the save button while an address mode change is in flight - add `accessibilityRole` / `accessibilityState` to the radio row and group - narrow `value` and `options[].value` from `*` to `string|number` - export only `RadioGroup` from the barrel - align the boolean prop docs on MUI's phrasing - update translations, including the pt-br string for `Save preferences`
393a552 to
1a81328
Compare
Acceptance Criteria
RadioButton,RadioOption,RadioGroup,PreferenceSaveButton)feat/amount-format-settings(notmaster)Screenshot
Security Checklist
Summary by CodeRabbit
New Features
UI Improvements