Skip to content

add tabs to the settings page#92

Open
keraliss wants to merge 1 commit intomainfrom
settings_tab
Open

add tabs to the settings page#92
keraliss wants to merge 1 commit intomainfrom
settings_tab

Conversation

@keraliss
Copy link
Copy Markdown
Collaborator

@keraliss keraliss commented May 2, 2026

Summary by CodeRabbit

  • New Features

    • Settings page now organized into tabs for Wallet and Network sections with tab navigation.
  • UI Changes

    • Simplified Bitcoin configuration setup with external reference link.
    • Removed Bitcoin config copy-to-clipboard buttons.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

📝 Walkthrough

Walkthrough

The Settings component is restructured into tabbed panels ("Wallet" and "Network") with click-driven tab navigation. The Bitcoin configuration section is simplified by replacing inline previews and copy controls with a GitHub reference link. Config preview generation and related event handlers are removed.

Changes

Settings UI Restructuring & Network Config Simplification

Layer / File(s) Summary
Tabbed Layout Foundation
src/components/settings/Settings.js (lines 6–51)
HTML restructured with tab navigation buttons and a "Wallet" tab panel containing existing wallet-related controls (RPC, Tor, ZMQ inputs moved into tab structure).
Network Tab Markup
src/components/settings/Settings.js (lines 52–150)
"Network" tab panel HTML added with Tor server, auth, and password inputs repositioned and reformatted within the new tabbed layout.
Bitcoin Configuration Simplification
src/components/settings/Settings.js (lines 121–223)
Bitcoin Core config guidance replaced: inline Bitcoin.conf preview and "Copy ZMQ Config"/"Copy Full Config" buttons removed; new simplified "Bitcoin.conf Setup" card with external GitHub reference link added.
Backup Modal Repositioning
src/components/settings/Settings.js (lines 238–283)
"Encrypt Backup" modal markup moved earlier in the component's DOM tree; modal structure and field IDs preserved.
Tab Switching Logic
src/components/settings/Settings.js (lines 298–322)
New switchTab(tabName) function added to toggle .tab-panel visibility and update active tab button styling; click event listeners attached to .settings-tab buttons.
Config Load & Preview Removal
src/components/settings/Settings.js (lines 323–540, 878–882)
loadExistingConfig() updated to populate RPC/Tor/ZMQ fields without triggering preview updates; updateConfigPreviews() function, input event handlers, and clipboard copy button handlers removed; preview refresh call removed from "Reset settings" handler.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A warren of tabs now organizes the nest,
Bitcoin's old preview bids fond farewell,
A GitHub link guides where config does dwell,
Wallet and Network in harmony rest,
Settings now simpler—the restructuring's blessed! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% 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 'add tabs to the settings page' directly and accurately describes the main structural change—converting the Settings UI from a single layout to a tabbed interface with 'Wallet' and 'Network' tabs.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch settings_tab

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@keraliss keraliss linked an issue May 2, 2026 that may be closed by this pull request
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/settings/Settings.js`:
- Around line 12-19: The tab buttons currently only have visual styling (buttons
with class "settings-tab" and data-tab values like "wallet"/"network") but lack
ARIA roles and selected-state management; add role="tablist" to the container
div, add role="tab", aria-selected (true/false) and aria-controls on each
".settings-tab" button (use their data-tab value to generate a matching panel
id), give the corresponding content panels role="tabpanel" and ids that match
aria-controls, and update the aria-selected and the visible/hidden state of the
panels when tabs are clicked or navigated via keyboard (Enter/Space/Arrow keys)
so assistive tech sees selection changes; update any existing click handlers for
settings-tab to toggle these attributes and ensure initial states set one tab as
aria-selected="true" and its panel visible.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 25875f1f-1fb3-4859-a430-fdd90127173b

📥 Commits

Reviewing files that changed from the base of the PR and between 28df48b and a9f09f5.

📒 Files selected for processing (1)
  • src/components/settings/Settings.js

Comment on lines +12 to +19
<div class="flex border-b border-gray-700 mb-8">
<button data-tab="wallet" class="settings-tab px-5 py-3 text-sm font-medium border-b-2 border-bitcoin-orange text-bitcoin-orange transition-colors">
Wallet
</button>
<button data-tab="network" class="settings-tab px-5 py-3 text-sm font-medium border-b-2 border-transparent text-gray-400 hover:text-gray-200 transition-colors">
Network
</button>
</div>
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 | 🟡 Minor | ⚡ Quick win

Add ARIA tab semantics and selected-state updates for accessible navigation.

The tabs are visually correct, but they currently lack tab semantics/state for assistive tech (tablist/tab/tabpanel, aria-selected, aria-controls).

♿ Suggested patch
-        <div class="flex border-b border-gray-700 mb-8">
-            <button data-tab="wallet" class="settings-tab px-5 py-3 text-sm font-medium border-b-2 border-bitcoin-orange text-bitcoin-orange transition-colors">
+        <div class="flex border-b border-gray-700 mb-8" role="tablist" aria-label="Settings sections">
+            <button id="tab-btn-wallet" role="tab" aria-selected="true" aria-controls="tab-wallet" data-tab="wallet" class="settings-tab px-5 py-3 text-sm font-medium border-b-2 border-bitcoin-orange text-bitcoin-orange transition-colors">
                 Wallet
             </button>
-            <button data-tab="network" class="settings-tab px-5 py-3 text-sm font-medium border-b-2 border-transparent text-gray-400 hover:text-gray-200 transition-colors">
+            <button id="tab-btn-network" role="tab" aria-selected="false" aria-controls="tab-network" data-tab="network" class="settings-tab px-5 py-3 text-sm font-medium border-b-2 border-transparent text-gray-400 hover:text-gray-200 transition-colors">
                 Network
             </button>
         </div>
@@
-        <div id="tab-wallet" class="tab-panel space-y-8">
+        <div id="tab-wallet" role="tabpanel" aria-labelledby="tab-btn-wallet" class="tab-panel space-y-8">
@@
-        <div id="tab-network" class="tab-panel space-y-8 hidden">
+        <div id="tab-network" role="tabpanel" aria-labelledby="tab-btn-network" class="tab-panel space-y-8 hidden">
@@
   function switchTab(tabName) {
     content.querySelectorAll('.tab-panel').forEach((panel) => {
       panel.classList.add('hidden');
+      panel.setAttribute('aria-hidden', 'true');
     });
     content.querySelectorAll('.settings-tab').forEach((btn) => {
       btn.classList.remove('border-bitcoin-orange', 'text-bitcoin-orange');
       btn.classList.add('border-transparent', 'text-gray-400');
+      btn.setAttribute('aria-selected', 'false');
     });
@@
     const activePanel = content.querySelector(`#tab-${tabName}`);
-    if (activePanel) activePanel.classList.remove('hidden');
+    if (activePanel) {
+      activePanel.classList.remove('hidden');
+      activePanel.setAttribute('aria-hidden', 'false');
+    }
@@
     const activeBtn = content.querySelector(`[data-tab="${tabName}"]`);
     if (activeBtn) {
       activeBtn.classList.remove('border-transparent', 'text-gray-400');
       activeBtn.classList.add('border-bitcoin-orange', 'text-bitcoin-orange');
+      activeBtn.setAttribute('aria-selected', 'true');
     }
   }

Also applies to: 22-23, 53-53, 300-316

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/settings/Settings.js` around lines 12 - 19, The tab buttons
currently only have visual styling (buttons with class "settings-tab" and
data-tab values like "wallet"/"network") but lack ARIA roles and selected-state
management; add role="tablist" to the container div, add role="tab",
aria-selected (true/false) and aria-controls on each ".settings-tab" button (use
their data-tab value to generate a matching panel id), give the corresponding
content panels role="tabpanel" and ids that match aria-controls, and update the
aria-selected and the visible/hidden state of the panels when tabs are clicked
or navigated via keyboard (Enter/Space/Arrow keys) so assistive tech sees
selection changes; update any existing click handlers for settings-tab to toggle
these attributes and ensure initial states set one tab as aria-selected="true"
and its panel visible.

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.

Tab view for settings

1 participant