Skip to content

Refactor haptics settings - #341

Merged
bordalix merged 4 commits into
masterfrom
refactor_haptics_settings
Feb 27, 2026
Merged

bordalix merged 4 commits into
masterfrom
refactor_haptics_settings

Conversation

@bordalix

@bordalix bordalix commented Feb 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added a Haptics settings option and a dedicated Haptics configuration screen to enable/disable haptic feedback.
  • UI Improvements

    • Increased vertical spacing and enabled subtext wrapping in toggle components for better readability.
    • General settings now shows Haptics as a read-only status instead of an inline toggle.
    • Notifications helper text consolidated into a single subtext for cleaner presentation.

@coderabbitai

coderabbitai Bot commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a Haptics settings flow: Toggle UI layout adjusted, Haptics added to SettingsOptions and options list, Haptics moved from General to a new dedicated Haptics screen (with config update logic), and Notifications updated to use Toggle's new subtext prop.

Changes

Cohort / File(s) Summary
Toggle Component Updates
src/components/Toggle.tsx
Adjusted vertical gap ('0' → '0.5rem') and enabled subtext wrapping via a wrap prop on the Text component.
Settings Types & Options
src/lib/types.ts, src/providers/options.tsx
Added Haptics = 'haptics feedback' to SettingsOptions and added a corresponding options entry under SettingsSections.Config.
Settings Screens
src/screens/Settings/General.tsx, src/screens/Settings/Index.tsx, src/screens/Settings/Notifications.tsx, src/screens/Settings/Haptics.tsx
Moved Haptics UI from General to a new Haptics screen (new component with updateConfig/backup logic); General no longer mutates config; Index now routes SettingsOptions.Haptics; Notifications passes subtext prop to Toggle instead of inline helper text.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User
participant HapticsScreen as Haptics Screen
participant ConfigCtx as ConfigContext/Provider
participant BackupSvc as Backup (nostrBackup)
User->>HapticsScreen: Click Toggle
HapticsScreen->>ConfigCtx: Read current config
HapticsScreen->>HapticsScreen: Build newConfig (flip haptics)
alt nostrBackup enabled
HapticsScreen->>BackupSvc: backupConfig(newConfig)
end
HapticsScreen->>ConfigCtx: updateConfig(newConfig)
ConfigCtx-->>HapticsScreen: config updated
HapticsScreen-->>User: UI reflects updated state

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • pietro909
  • tiero
🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Refactor haptics settings' accurately summarizes the main changes: restructuring the haptics feature by moving it from the General settings screen to a dedicated Haptics screen, adding it to the settings options, and updating the Toggle component.

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

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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Feb 27, 2026 •

Copy link
Copy Markdown

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 46cc287
Status: ✅  Deploy successful!
Preview URL: https://288ff27b.wallet-bitcoin.pages.dev
Branch Preview URL: https://refactor-haptics-settings.wallet-bitcoin.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Feb 27, 2026 •

Copy link
Copy Markdown

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 46cc287
Status: ✅  Deploy successful!
Preview URL: https://e5907bfd.arkade-wallet.pages.dev
Branch Preview URL: https://refactor-haptics-settings.arkade-wallet.pages.dev

View logs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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/screens/Settings/Index.tsx`:
- Line 22: Add the missing React component file src/screens/Settings/Haptics.tsx
that exports the default Haptics component used by the import in Index.tsx;
implement a functional React/React Native component named Haptics (matching the
import) that accepts the same props expected where it’s used in the switch
statement in Index.tsx (e.g., navigation or settings props) and renders the
intended UI (or a placeholder UI) so the import resolves and the build succeeds.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 93c9ece and b308b60.

📒 Files selected for processing (6)
  • src/components/Toggle.tsx
  • src/lib/types.ts
  • src/providers/options.tsx
  • src/screens/Settings/General.tsx
  • src/screens/Settings/Index.tsx
  • src/screens/Settings/Notifications.tsx

Comment thread src/screens/Settings/Index.tsx Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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/screens/Settings/Haptics.tsx`:
- Around line 11-15: The toggle handler handleChange currently awaits
backupConfig(newConfig) and therefore skips updateConfig(newConfig) if the
backup fails; change it so the UI update always occurs: either call
updateConfig(newConfig) before performing the backup, or start
backupConfig(newConfig) without awaiting it and catch/log errors (e.g.,
config.nostrBackup && backupConfig(newConfig).catch(...)); ensure you still only
attempt backup when config.nostrBackup is true and keep the same newConfig
calculation using config and haptics.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b308b60 and 46cc287.

📒 Files selected for processing (1)
  • src/screens/Settings/Haptics.tsx

Comment thread src/screens/Settings/Haptics.tsx Resolved
@bordalix
bordalix merged commit 7431563 into master Feb 27, 2026
5 checks passed
@bordalix
bordalix deleted the refactor_haptics_settings branch March 4, 2026 10:12
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