Skip to content

feat(ui): add mobile responsive layout for narrow viewports#27

Open
thephez wants to merge 1 commit into
dashpay:mainfrom
thephez:style/mobile-improve
Open

feat(ui): add mobile responsive layout for narrow viewports#27
thephez wants to merge 1 commit into
dashpay:mainfrom
thephez:style/mobile-improve

Conversation

@thephez
Copy link
Copy Markdown
Contributor

@thephez thephez commented Jun 1, 2026

Append a @media (max-width: 600px) block that stacks key/manage rows, full-width nav buttons, drops the mnemonic grid to two columns, lets the address row and DPNS username row wrap cleanly, and allows the fee table to scroll horizontally.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Summary by CodeRabbit

  • Style
    • Improved mobile responsiveness with optimized layouts for screens up to 600px. Enhanced navigation elements, form controls, and tables for better usability on mobile. Adjusted spacing, typography, and element stacking to ensure content displays properly and remains readable on small screens.

Append a @media (max-width: 600px) block that stacks key/manage rows, full-width nav buttons, drops the mnemonic grid to two columns, lets the address row and DPNS username row wrap cleanly, and allows the fee table to scroll horizontally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

A single CSS @media (max-width: 600px) block is added to index.html that reflows UI components for mobile screens, adjusting network selectors, action buttons, configuration rows, modals, typography, spacing, and table scrolling behavior.

Changes

Mobile Responsive Layout

Layer / File(s) Summary
Mobile responsive CSS adjustments
index.html
Mobile breakpoint rules wrap network selectors and configuration labels, stack primary/secondary action buttons vertically with full width, adjust modal action button layout, reduce padding and font sizes across processing/mnemonic/complete steps, enable horizontal scrolling for fee tables, and prevent identity/contract ID row overflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop and a skip for screens both tall and wide,
Mobile layouts flow with grace and stride,
Buttons stack, and selectors dance,
Tables scroll—no missed chance,
Responsive magic, one breakpoint blessed!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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: adding mobile responsive CSS for narrow viewports, which is the primary focus of the +274 lines added to index.html.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

Copy link
Copy Markdown

@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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
index.html (2)

2459-2462: 💤 Low value

Consider visual consistency of network selector wrapping.

The flex-basis: 100% on .devnet-dropdown forces it to take a full row, while .network-btn (Testnet/Mainnet) can wrap together. This creates inconsistent button widths where the devnet dropdown is always full-width but the other network buttons can share a row.

If this visual inconsistency is intentional for prominence, it's fine. Otherwise, consider letting all network controls wrap naturally by removing flex-basis: 100%.

🤖 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 `@index.html` around lines 2459 - 2462, The CSS rule .devnet-dropdown forces
the dropdown to occupy a full row via flex-basis: 100%, causing inconsistent
widths vs .network-btn; remove the flex-basis: 100% (or replace it with flex: 0
1 auto / flex-basis: auto) on .devnet-dropdown so it can wrap naturally like
.network-btn and match the visual behaviour of the other network controls.

2651-2653: 💤 Low value

Verify the visual order of modal buttons.

Using flex-direction: column-reverse will display the "Save"/"Confirm" button above the "Cancel" button on mobile. While this emphasizes the primary action, it reverses the conventional left-to-right desktop order (Cancel, Confirm), which might momentarily confuse users.

If the reversed order is intentional to highlight the primary action on mobile, consider adding a comment to document this choice.

🤖 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 `@index.html` around lines 2651 - 2653, The CSS rule .devnet-modal-actions {
flex-direction: column-reverse; } reverses the vertical stacking so the primary
action (Save/Confirm) appears above Cancel on mobile; if this reversal is
intentional, add an inline comment above the rule explaining the UX rationale
(e.g., "Primary action placed first on mobile for emphasis") to document the
choice, otherwise change the rule to column (or remove column-reverse) and, if
you need to maintain visual emphasis while preserving conventional order, keep
flex-direction: column and use the order property on the specific button
elements (e.g., .primary { order: 2 } .cancel { order: 1 }) to control placement
without reversing semantic order.
🤖 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 `@index.html`:
- Around line 2428-2697: Small touch targets on mobile: increase the tappable
area for .remove-key-btn, .remove-dpns-username-btn, and
.remove-manage-new-key-btn inside the existing `@media` (max-width: 600px) block
by setting explicit width and height to at least 44px (and adjust
font-size/line-height if needed) so they meet the recommended touch target;
ensure any flex alignment or padding is updated (e.g., maintain align-self or
margin) so layout doesn’t break when these elements grow.

---

Nitpick comments:
In `@index.html`:
- Around line 2459-2462: The CSS rule .devnet-dropdown forces the dropdown to
occupy a full row via flex-basis: 100%, causing inconsistent widths vs
.network-btn; remove the flex-basis: 100% (or replace it with flex: 0 1 auto /
flex-basis: auto) on .devnet-dropdown so it can wrap naturally like .network-btn
and match the visual behaviour of the other network controls.
- Around line 2651-2653: The CSS rule .devnet-modal-actions { flex-direction:
column-reverse; } reverses the vertical stacking so the primary action
(Save/Confirm) appears above Cancel on mobile; if this reversal is intentional,
add an inline comment above the rule explaining the UX rationale (e.g., "Primary
action placed first on mobile for emphasis") to document the choice, otherwise
change the rule to column (or remove column-reverse) and, if you need to
maintain visual emphasis while preserving conventional order, keep
flex-direction: column and use the order property on the specific button
elements (e.g., .primary { order: 2 } .cancel { order: 1 }) to control placement
without reversing semantic order.
🪄 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

Run ID: ae2891f1-7796-4ba7-a7ca-d03385a3047f

📥 Commits

Reviewing files that changed from the base of the PR and between bf94f56 and b0ff5a1.

📒 Files selected for processing (1)
  • index.html

Comment thread index.html
Comment on lines +2428 to +2697
@media (max-width: 600px) {
body {
padding: 10px;
align-items: flex-start;
}

.bridge-container {
padding: 20px 16px;
border-radius: 12px;
}

h1 {
font-size: 1.4rem;
}

header {
margin-bottom: 20px;
}

/* Network selector: allow wrap, drop max-widths so buttons fit */
.network-selector {
flex-wrap: wrap;
gap: 8px;
}

.network-btn {
max-width: none;
padding: 12px 14px;
font-size: 0.9rem;
}

.devnet-dropdown {
max-width: none;
flex-basis: 100%;
}

/* Mode buttons */
.mode-btn {
padding: 18px;
}

/* Primary/secondary buttons */
.primary-btn {
padding: 16px 24px;
font-size: 1rem;
}

/* Configure keys row: stack label above controls, each select on its own row */
.key-row {
flex-wrap: wrap;
padding: 12px;
gap: 8px;
}

.key-name {
width: 100%;
}

.key-config {
flex-wrap: wrap;
width: 100%;
}

.key-config select {
flex: 1 1 100%;
font-size: 0.85rem;
min-width: 0;
}

.key-config .key-purpose-select {
min-width: 0;
}

.key-config .remove-key-btn {
align-self: flex-end;
}

/* Nav / action buttons: stack full-width */
.nav-buttons {
flex-direction: column;
}

.nav-buttons .primary-btn,
.nav-buttons .secondary-btn {
width: 100%;
white-space: normal;
}

.error-actions .primary-btn,
.error-actions .secondary-btn {
flex: 1 1 100%;
}

.dpns-action-buttons .primary-btn,
.dpns-action-buttons .secondary-btn,
.manage-action-buttons .primary-btn,
.manage-action-buttons .secondary-btn {
width: 100%;
}

/* Deposit screen */
.deposit-headline {
font-size: 1.1rem;
}

.qr-container {
padding: 12px;
max-width: 100%;
}

.qr-container img {
max-width: 100%;
height: auto;
}

.address-display {
flex-direction: column;
gap: 10px;
}

.address {
font-size: 0.8rem;
padding: 10px 12px;
width: 100%;
}

/* Mnemonic: 2 columns on small screens */
.mnemonic-section {
padding: 18px;
}

.mnemonic-words {
grid-template-columns: repeat(2, 1fr);
gap: 8px;
}

.mnemonic-word {
font-size: 0.85rem;
padding: 8px 10px;
}

/* Processing details */
.processing-headline {
font-size: 1.2rem;
}

.processing-details {
padding: 14px;
}

/* Manage keys rows */
.manage-key-row {
padding: 12px;
font-size: 0.85rem;
}

.manage-key-row .key-disable-toggle {
margin-left: 0;
width: 100%;
}

.add-key-config {
gap: 8px;
flex-direction: column;
align-items: stretch;
}

.add-key-config select {
flex: 1 1 100%;
width: 100%;
min-width: 0;
}

.add-key-config .manage-key-purpose-select {
min-width: 0;
}

.add-key-config .remove-manage-new-key-btn {
align-self: flex-end;
}

/* DPNS username row */
.dpns-username-row {
flex-wrap: wrap;
gap: 8px;
}

.dpns-username-input-wrapper {
flex: 1 1 100%;
order: 1;
}

.dpns-username-status {
flex: 1;
text-align: left;
order: 2;
min-width: 0;
}

.remove-dpns-username-btn {
order: 3;
}

.dpns-username-input {
padding: 12px 14px;
font-size: 1rem;
}

/* Input with button (fetch identity) */
.input-with-button {
flex-direction: column;
}

.fetch-btn {
width: 100%;
}

/* Devnet modal */
.devnet-modal {
padding: 20px;
width: 95%;
}

.devnet-modal-actions {
flex-direction: column-reverse;
}

.devnet-modal-actions .primary-btn,
.devnet-modal-actions .secondary-btn {
width: 100%;
}

/* Faucet hero */
.faucet-section.faucet-hero {
padding: 18px;
}

.faucet-btn.faucet-btn-hero {
padding: 14px 24px;
font-size: 1rem;
width: 100%;
}

/* Identity / contract id rows */
.id-row {
flex-wrap: wrap;
}

.id-row .identity-id {
font-size: 0.8rem;
}

/* Fee table — let it scroll if too wide */
.fee-breakdown {
overflow-x: auto;
}

.fee-table {
font-size: 0.8rem;
}

/* Complete stats: shrink padding */
.complete-stats {
gap: 8px;
}

.stat {
padding: 8px 10px;
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Increase touch target sizes for small interactive buttons.

Several interactive buttons have dimensions below the minimum recommended touch target size of 44×44px (WCAG 2.1 AA, iOS HIG) or 48×48px (Android Material Design):

  • .remove-key-btn: 20×20px (line 649-650)
  • .remove-dpns-username-btn: 32×32px (line 1336-1337)
  • .remove-manage-new-key-btn: 32×32px (line 1805-1806)

On narrow viewports where users rely on touch input, these small targets are difficult to tap accurately and create accessibility barriers.

Consider adding mobile-specific rules to increase these to at least 44×44px, for example:

`@media` (max-width: 600px) {
  .remove-key-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .remove-dpns-username-btn,
  .remove-manage-new-key-btn {
    width: 44px;
    height: 44px;
  }
}
🤖 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 `@index.html` around lines 2428 - 2697, Small touch targets on mobile: increase
the tappable area for .remove-key-btn, .remove-dpns-username-btn, and
.remove-manage-new-key-btn inside the existing `@media` (max-width: 600px) block
by setting explicit width and height to at least 44px (and adjust
font-size/line-height if needed) so they meet the recommended touch target;
ensure any flex alignment or padding is updated (e.g., maintain align-self or
margin) so layout doesn’t break when these elements grow.

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.

1 participant