Skip to content

fix: change responsive button breakpoints and use them where necessary#2093

Merged
im-adithya merged 2 commits intomasterfrom
fix/responsive-buttons
Feb 26, 2026
Merged

fix: change responsive button breakpoints and use them where necessary#2093
im-adithya merged 2 commits intomasterfrom
fix/responsive-buttons

Conversation

@im-adithya
Copy link
Copy Markdown
Member

@im-adithya im-adithya commented Feb 26, 2026

Fixes #1816

The responsive buttons look good till md width, so changed the breakpoint from lg to md (verified ✅ on all screens)

Replaced all places where AppHeader uses non responsive buttons

Summary by CodeRabbit

  • Improvements
    • Optimized responsive button behavior to show text and adjust icon sizing starting from medium screen sizes for better visibility.
    • Updated button components throughout the app to use enhanced responsive implementations.
    • Refined button visibility thresholds to provide improved UX across different device sizes.

@im-adithya im-adithya requested a review from rolznz February 26, 2026 08:55
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

The changes adjust responsive design breakpoints from large-screen (lg) to medium-screen (md) thresholds in three button components and replace standard button implementations with their responsive counterparts in three screen components, improving layout behavior on smaller displays.

Changes

Cohort / File(s) Summary
Responsive Button Components
frontend/src/components/ResponsiveButton.tsx, frontend/src/components/ResponsiveExternalLinkButton.tsx, frontend/src/components/ResponsiveLinkButton.tsx
Updated responsive visibility and sizing breakpoints from lg to md, broadening when text is shown and adjusting icon sizing thresholds to trigger at medium screens instead of large screens.
Screen Component Updates
frontend/src/screens/internal-apps/ZapPlanner.tsx, frontend/src/screens/onchain/DepositBitcoin.tsx
Replaced standard button components with their responsive counterparts: DialogTrigger-wrapped Button replaced with ResponsiveButton in ZapPlanner; LinkButton replaced with ResponsiveLinkButton in DepositBitcoin, adding explicit icon and text props.
Peers Screen
frontend/src/screens/peers/Peers.tsx
Replaced LinkButton with ResponsiveLinkButton in AppHeader contentRight, updated imports to include RadioIcon and ResponsiveLinkButton while removing LinkButton.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 From lg to md, the buttons dance free,
Wrapping and sizing just right you shall see,
On phones and tablets, they play their part,
Responsive design from the very start!

🚥 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 changes: updating responsive button breakpoints from lg to md and deploying them across the codebase.
Linked Issues check ✅ Passed The PR addresses issue #1816 by changing button breakpoints to md and replacing header buttons with responsive variants to prevent overlap.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing responsive button behavior in headers and are within the scope of issue #1816.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/responsive-buttons

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.

@im-adithya im-adithya changed the title Fix/responsive buttons fix: change responsive button breakpoints and use them where necessary Feb 26, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
frontend/src/components/ResponsiveLinkButton.tsx (1)

31-38: ⚠️ Potential issue | 🟠 Major

Add an accessible name to the icon-only link button.

The mobile variant is icon-only (md:hidden), so it should explicitly expose aria-label.

♿ Suggested fix
       <LinkButton
         {...props}
         size="icon"
         className="md:hidden"
+        aria-label={text}
         variant={variant}
       >
-        <Icon />
+        <Icon aria-hidden="true" />
       </LinkButton>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/ResponsiveLinkButton.tsx` around lines 31 - 38, The
icon-only mobile variant in ResponsiveLinkButton lacks an accessible name;
update the LinkButton render in ResponsiveLinkButton to pass an explicit
aria-label (or ariaLabel prop accepted by LinkButton) when it renders the
icon-only version so screen readers can announce the button—ensure you use a
meaningful label (e.g., from props.label, props['aria-label'], or a dedicated
prop) and keep passing {...props} along with size="icon", className="md:hidden",
and variant={variant} so the accessible name is always present for the Icon-only
button.
frontend/src/components/ResponsiveExternalLinkButton.tsx (1)

31-38: ⚠️ Potential issue | 🟠 Major

Icon-only external-link variant should include an accessible label.

The md:hidden button renders only an icon; add aria-label so screen readers can identify the action.

♿ Suggested fix
       <ExternalLinkButton
         {...props}
         size="icon"
         className="md:hidden"
+        aria-label={text}
         variant={variant}
       >
-        <Icon />
+        <Icon aria-hidden="true" />
       </ExternalLinkButton>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/ResponsiveExternalLinkButton.tsx` around lines 31 -
38, The icon-only ExternalLinkButton rendered in ResponsiveExternalLinkButton
lacks an accessible label; update the icon-only branch (the ExternalLinkButton
with size="icon" and className="md:hidden") to include an aria-label prop.
Pass-through any incoming aria-label (props["aria-label"] or props.ariaLabel) if
provided, otherwise supply a sensible default like "Open external link" so
screen readers can identify the action; ensure you add the aria-label on the
ExternalLinkButton that renders <Icon />.
frontend/src/components/ResponsiveButton.tsx (1)

24-44: ⚠️ Potential issue | 🟠 Major

Add a fallback accessible name for mobile icon-only state.

When the label is hidden below md, this becomes icon-only and may be unnamed for assistive tech. Set a default aria-label from text.

♿ Suggested fix
 const ResponsiveButton = ({
   icon: Icon,
   text,
   variant,
   asChild,
   children,
   className,
   ...props
 }: Props) => {
   const content = (
     <>
-      <Icon />
+      <Icon aria-hidden="true" />
       <span className="hidden md:inline">{text}</span>
     </>
   );

   return (
     <Button
       {...props}
+      aria-label={props["aria-label"] ?? text}
       variant={variant}
       asChild={asChild}
       className={cn(
         className,
         "max-md:size-9" /* apply size="icon" only for mobile */
       )}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/ResponsiveButton.tsx` around lines 24 - 44, The
icon-only mobile state can be inaccessible because the visible label is hidden;
ensure an accessible name is provided by passing a default aria-label derived
from text when none was supplied: add logic in ResponsiveButton (around the
Button JSX and the React.cloneElement branch) to compute const ariaLabel =
props["aria-label"] ?? text and pass ariaLabel to the Button via
aria-label={ariaLabel}, and when asChild is true also merge aria-label into the
cloned child (only if the child lacks one) so the rendered element always has an
accessible name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@frontend/src/components/ResponsiveButton.tsx`:
- Around line 24-44: The icon-only mobile state can be inaccessible because the
visible label is hidden; ensure an accessible name is provided by passing a
default aria-label derived from text when none was supplied: add logic in
ResponsiveButton (around the Button JSX and the React.cloneElement branch) to
compute const ariaLabel = props["aria-label"] ?? text and pass ariaLabel to the
Button via aria-label={ariaLabel}, and when asChild is true also merge
aria-label into the cloned child (only if the child lacks one) so the rendered
element always has an accessible name.

In `@frontend/src/components/ResponsiveExternalLinkButton.tsx`:
- Around line 31-38: The icon-only ExternalLinkButton rendered in
ResponsiveExternalLinkButton lacks an accessible label; update the icon-only
branch (the ExternalLinkButton with size="icon" and className="md:hidden") to
include an aria-label prop. Pass-through any incoming aria-label
(props["aria-label"] or props.ariaLabel) if provided, otherwise supply a
sensible default like "Open external link" so screen readers can identify the
action; ensure you add the aria-label on the ExternalLinkButton that renders
<Icon />.

In `@frontend/src/components/ResponsiveLinkButton.tsx`:
- Around line 31-38: The icon-only mobile variant in ResponsiveLinkButton lacks
an accessible name; update the LinkButton render in ResponsiveLinkButton to pass
an explicit aria-label (or ariaLabel prop accepted by LinkButton) when it
renders the icon-only version so screen readers can announce the button—ensure
you use a meaningful label (e.g., from props.label, props['aria-label'], or a
dedicated prop) and keep passing {...props} along with size="icon",
className="md:hidden", and variant={variant} so the accessible name is always
present for the Icon-only button.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2af8fd and fafa6ad.

📒 Files selected for processing (6)
  • frontend/src/components/ResponsiveButton.tsx
  • frontend/src/components/ResponsiveExternalLinkButton.tsx
  • frontend/src/components/ResponsiveLinkButton.tsx
  • frontend/src/screens/internal-apps/ZapPlanner.tsx
  • frontend/src/screens/onchain/DepositBitcoin.tsx
  • frontend/src/screens/peers/Peers.tsx

@im-adithya
Copy link
Copy Markdown
Member Author

I'll merge this as there aren't any comments apart from aria labels, only thing worth mentioning is the RadioIcon added for "Connect Peer" button cc @rolznz

@im-adithya im-adithya merged commit 778f832 into master Feb 26, 2026
8 of 13 checks passed
@im-adithya im-adithya deleted the fix/responsive-buttons branch February 26, 2026 09:05
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.

"New Recurring Payment" button should wrap on small screens

1 participant