Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI - onboarding styling and colors #131

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

danielnordh
Copy link

@danielnordh danielnordh commented Oct 25, 2024

Description

This PR makes changes to the onboarding screen styling and colors.

image

Before / After light mode / After dark mode

Changelog notice

  • Updated onboarding screen UI with styling and color

Checklists

All Submissions:

  • I've signed all my commits
  • I have formatted my code with swift-format per .swift-format file

Summary by CodeRabbit

Release Notes

  • New Features

    • Redesigned Onboarding View with improved layout, including a new network selection Picker and updated styling for buttons and text fields.
    • Updated color definitions for the Accent Color to enhance visual appeal.
  • Bug Fixes

    • Removed outdated references to ldk-node package and streamlined package management.

Copy link

coderabbitai bot commented Oct 25, 2024

Walkthrough

The pull request introduces modifications to the LDKNodeMonday.xcodeproj/project.pbxproj file, updating Swift package dependencies and build file references for LDKNode. A new build file reference is added, replacing an older one, while a new entry for XCRemoteSwiftPackageReference for ldk-node is created, removing the outdated reference. Additionally, the AccentColor.colorset color definitions in Contents.json are updated to use a new color structure. Lastly, the OnboardingView.swift file is revised for layout and styling improvements, including changes to the network selection and wallet creation button.

Changes

File Change Summary
LDKNodeMonday.xcodeproj/project.pbxproj - Added new build file reference for LDKNode.
- Removed old reference for LDKNode.
- Added new XCRemoteSwiftPackageReference for ldk-node and removed the old one.
LDKNodeMonday/Assets.xcassets/AccentColor.colorset/Contents.json - Updated color definitions to use "display-p3" color space and RGBA components, removing previous platform and reference attributes.
LDKNodeMonday/View/Home/OnboardingView.swift - Simplified layout with adjusted spacing.
- Enlarged and centered wallet image.
- Updated title and subtitle text.
- Modified network selection to include a Picker with updated options.
- Changed seed phrase text field style.
- Restructured "Create wallet" button with updated styling.

Possibly related PRs

  • spm: local build ldk-node commit 246775d #90: Updates the LDKNodeMonday.xcodeproj/project.pbxproj file by adding a new build file reference for LDKNode, related to the changes in the main PR.
  • spm: bitcoinui main #101: Similar to the main PR, this PR updates the LDKNodeMonday.xcodeproj/project.pbxproj file, including changes to package references and build file management.
  • bip21 #110: Modifies the LDKNodeMonday.xcodeproj/project.pbxproj file, including the addition of a new reference for LDKNode, aligning with the main PR's updates.
  • spm: ldk-node 0.4.0 #130: Updates the ldk-node package version in the LDKNodeMonday.xcodeproj/project.pbxproj file, relevant to the main PR's focus on managing Swift package dependencies.
  • spm: ldk-node 0.4.2 #134: Also updates the ldk-node package version in the LDKNodeMonday.xcodeproj/project.pbxproj file, indicating a connection to the main PR's changes regarding package management.

🐇 In the code we hop and play,
New colors bright, a fresh display!
With wallets wide and networks clear,
Our onboarding's now a joyful cheer!
Dependencies linked, all in a row,
Hooray for changes, let’s watch them glow! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 5

🧹 Outside diff range and nitpick comments (3)
LDKNodeMonday/Assets.xcassets/AccentColor.colorset/Contents.json (1)

5-11: Consider using consistent hex notation for color components.

The color definition looks good, but for better maintainability, consider using hexadecimal notation consistently across both color definitions.

         "components" : {
           "alpha" : "1.000",
-          "blue" : "0.894",
-          "green" : "0.188",
-          "red" : "0.111"
+          "blue" : "0xE4",
+          "green" : "0x30",
+          "red" : "0x1C"
         }
LDKNodeMonday/View/Home/OnboardingView.swift (2)

28-38: Add accessibility label for the wallet icon.

While the styling looks good, consider adding an accessibility label to the image for better VoiceOver support.

 Image(systemName: "bolt.horizontal.fill")
     .resizable()
     .aspectRatio(contentMode: .fit)
     .foregroundColor(.accent)
     .frame(width: 150, height: 150, alignment: .center)
+    .accessibilityLabel("Monday Wallet Logo")
     .padding(40)

Line range hint 44-83: Consider responsive padding for different screen sizes.

The fixed horizontal padding of 50 points might be too large on smaller devices. Consider using a more responsive approach.

-}.padding(.horizontal, 50)
+}.padding(.horizontal, min(50, UIScreen.main.bounds.width * 0.15))
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 51f20aa and d206422.

📒 Files selected for processing (3)
  • LDKNodeMonday.xcodeproj/project.pbxproj (6 hunks)
  • LDKNodeMonday/Assets.xcassets/AccentColor.colorset/Contents.json (2 hunks)
  • LDKNodeMonday/View/Home/OnboardingView.swift (2 hunks)
🔇 Additional comments (1)
LDKNodeMonday/View/Home/OnboardingView.swift (1)

119-128: LGTM! Error handling implementation looks good.

The alert implementation provides clear error feedback with proper dismissal handling.

Comment on lines +23 to +29
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0xCD",
"green" : "0xF3",
"red" : "0x77"
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Dark mode accent color needs adjustment for better accessibility

The current dark mode accent color (77, F3, CD) has a very high brightness value, particularly in the green channel (F3). This combination:

  1. Has a relative luminance that may not provide sufficient contrast with light text
  2. Uses excessive brightness (especially green at 0xF3) that could cause visual discomfort in dark mode
  3. May not meet WCAG 2.1 contrast requirements for text legibility

Recommendations:

  • Reduce the green channel value (0xF3) significantly for dark mode
  • Consider using a more muted variant while maintaining the same hue
  • Test with both light and dark text against this background color
🔗 Analysis chain

Verify dark mode color contrast and brightness.

The selected color (0x77, 0xF3, 0xCD) appears quite bright for dark mode, which might cause eye strain or readability issues. Please verify that:

  1. The color provides sufficient contrast with text
  2. The brightness level is comfortable for dark mode viewing
  3. The color meets WCAG accessibility guidelines

Let's check if this color is used with text in the onboarding view:


Let me gather more information about where and how this accent color is specifically used in the UI.


Let me check if there are any dark mode specific color assets or alternative color sets defined for this accent color.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of accent color with text in OnboardingView
rg -l "\.accent" | xargs rg "Text|Label"

Length of output: 885


Script:

#!/bin/bash
# Search for accent color usage in SwiftUI views
rg -A 3 -B 3 "\.accentColor|AccentColor" 

# Also check for any color scheme or dark mode specific handling
rg -A 3 "preferredColorScheme|\.colorScheme"

Length of output: 1615


Script:

#!/bin/bash
# Check if there are any dark mode specific color definitions in the accent color asset
cat "LDKNodeMonday/Assets.xcassets/AccentColor.colorset/Contents.json"

# Look for any other color assets that might be related
fd colorset LDKNodeMonday/Assets.xcassets -x cat {}/Contents.json

Length of output: 1548

Comment on lines +105 to +114
Button("Create wallet") {
viewModel.saveSeed()
isFirstTime = false
} label: {
Text("Start Node")
.bold()
.foregroundColor(Color(uiColor: UIColor.systemBackground))
.frame(maxWidth: .infinity)
.minimumScaleFactor(0.9)
.padding(.all, 8)
}
.frame(width: 200, height: 25)
.buttonStyle(BitcoinFilled(tintColor: viewModel.buttonColor, isCapsule: true))
.disabled(!isFirstTime && viewModel.seedPhrase.isEmpty)
.padding(.all, 25)
.buttonStyle(
BitcoinFilled(
tintColor: .accent,
isCapsule: true
)
)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add loading state to wallet creation button.

Consider adding a loading state to provide feedback during wallet creation process.

+@State private var isCreatingWallet = false
+
 Button("Create wallet") {
+    isCreatingWallet = true
     viewModel.saveSeed()
     isFirstTime = false
 }
 .buttonStyle(
     BitcoinFilled(
         tintColor: .accent,
         isCapsule: true
     )
 )
+.disabled(isCreatingWallet)
+.overlay {
+    if isCreatingWallet {
+        ProgressView()
+            .tint(.accent)
+    }
+}

Committable suggestion was skipped due to low confidence.

Comment on lines +85 to +99
TextField(
isFirstTime
? "24 word seed phrase (optional)" : "24 word seed phrase (required)",
text: $viewModel.seedPhrase
)
.textFieldStyle(.roundedBorder)
.submitLabel(.done)
.padding(.horizontal, 50)
.padding(.vertical, 10)
if viewModel.seedPhraseArray != [] {
SeedPhraseView(
words: viewModel.seedPhraseArray,
preferredWordsPerRow: 2,
usePaging: true,
wordsPerPage: 6
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance security and user experience of seed phrase input.

Consider adding appropriate keyboard type and content type specifications for better security and user experience.

 TextField(
     isFirstTime
         ? "24 word seed phrase (optional)" : "24 word seed phrase (required)",
     text: $viewModel.seedPhrase
 )
 .textFieldStyle(.roundedBorder)
 .submitLabel(.done)
+.keyboardType(.asciiCapable)
+.textContentType(.none)
+.autocorrectionDisabled(true)
+.autocapitalization(.none)
 .padding(.horizontal, 50)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TextField(
isFirstTime
? "24 word seed phrase (optional)" : "24 word seed phrase (required)",
text: $viewModel.seedPhrase
)
.textFieldStyle(.roundedBorder)
.submitLabel(.done)
.padding(.horizontal, 50)
.padding(.vertical, 10)
if viewModel.seedPhraseArray != [] {
SeedPhraseView(
words: viewModel.seedPhraseArray,
preferredWordsPerRow: 2,
usePaging: true,
wordsPerPage: 6
TextField(
isFirstTime
? "24 word seed phrase (optional)" : "24 word seed phrase (required)",
text: $viewModel.seedPhrase
)
.textFieldStyle(.roundedBorder)
.submitLabel(.done)
.keyboardType(.asciiCapable)
.textContentType(.none)
.autocorrectionDisabled(true)
.autocapitalization(.none)
.padding(.horizontal, 50)
.padding(.vertical, 10)
if viewModel.seedPhraseArray != [] {
SeedPhraseView(
words: viewModel.seedPhraseArray,
preferredWordsPerRow: 2,
usePaging: true,
wordsPerPage: 6

Comment on lines +897 to +904
65875A912CCB9809000D3E70 /* XCRemoteSwiftPackageReference "ldk-node" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/lightningdevkit/ldk-node.git";
requirement = {
kind = exactVersion;
version = 0.4.0;
};
};
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider using a version range for LDKNode dependency.

While pinning to exact version 0.4.0 provides stability, it may cause you to miss important security updates. Consider using a version range that allows minor updates.

Update the package requirement to allow minor version updates:

 requirement = {
-    kind = exactVersion;
-    version = 0.4.0;
+    kind = upToNextMinor;
+    minimumVersion = "0.4.0";
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
65875A912CCB9809000D3E70 /* XCRemoteSwiftPackageReference "ldk-node" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/lightningdevkit/ldk-node.git";
requirement = {
kind = exactVersion;
version = 0.4.0;
};
};
65875A912CCB9809000D3E70 /* XCRemoteSwiftPackageReference "ldk-node" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/lightningdevkit/ldk-node.git";
requirement = {
kind = upToNextMinor;
minimumVersion = "0.4.0";
};
};

@@ -173,7 +173,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
AEFA825E2CC15C7C0095B0BA /* LDKNode in Frameworks */,
65875A932CCB9809000D3E70 /* LDKNode in Frameworks */,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate LDKNode framework references.

There are multiple framework references to LDKNode which can cause build issues. Only one reference should be maintained.

Remove the duplicate references and keep only one:

- 65875A932CCB9809000D3E70 /* LDKNode in Frameworks */,
- AE060C382C051B59006724F1 /* LDKNode in Frameworks */,
- AE80C2052C4AB5E4006E7193 /* LDKNode in Frameworks */,
+ 65875A932CCB9809000D3E70 /* LDKNode in Frameworks */,

Committable suggestion was skipped due to low confidence.

@reez
Copy link
Owner

reez commented Oct 27, 2024



Thanks for the side-by-side screenshots!



Color

Color change looks good, but there are some additional considerations I'm thinking about it:

  • current button color is due to network color, if we make the proposed change then we should concurrently make the same change across the entire app where that similar button's color was based on network color
  • if we make proposed change, and don't need a network color across the onboarding/app anymore we should remove related code from view models and views, as a part of that change, if not needed anymore
  • my opinion is I wouldn't mind using their dark blue (000628 from background of lightningdevkit.org in dark mode) instead of the regular blue, but I understand why you used the regular blue since it is matching the light/dark modes that are being matched here from their website. The dark blue things is strictly my opinion of what is more aesthetically pleasing to me of the two blues that is still based in the lightningdevkit website
  • maybe we can have a larger discussion now or later about color scheme since we have more freedom with that and don't necessarily need to be tied to lightningdevkit website even though that is a good grounding point/basis

Overall I'm good with the proposed color change though for now, but do think it should be made across the entire app for cohesion.

Casing

https://developer.apple.com/design/human-interface-guidelines/writing

“Title or sentence case. Decide whether you want to use title case or sentence case for alerts, page titles, headlines, button labels, and links. Throughout the HIG, you’ll find guidelines for specific components, but how you format your text is a reflection of your app’s voice. Title case is more formal, while sentence case is more casual. Choose a style that fits your app.”

https://developer.apple.com/design/human-interface-guidelines/buttons
“Consider using text when a short label communicates more clearly than an icon. To use text, write a few words that succinctly describe what the button does. Using title-style capitalization, consider starting the label with a verb to help convey the button’s action — for example, a button that lets people add items to their shopping cart might use the label “Add to Cart.”

https://www.apple.com/wallet/

Screenshot 2024-10-27 at 1 06 18 PM

I’m definitely not against apps that use Sentence case (one of my favorite bitcoin apps uses it), and don’t think Apple even thinks one is always better than the other, but it does seem like the strongest case for which would be the standard for an iOS wallet would be Title (per combination of HIG+Wallet)?

UI

Does not work well on non-DynamicType or with Dynamic Type (even though I'm not as explicit about that here (yet) as I am in BDKSwiftExampleWallet), here are screenshots of proposed changes:

Screenshot 2024-10-27 at 9 03 59 AM Screenshot 2024-10-27 at 9 04 10 AM

Text

I'm good with changing "create wallet" from "start node", good change!

Other

Would encourage continuing discussion on each of these as separate Issues/PR's because this PR discussion might get too large and span too many different topics (and possibly opening up Issues before PR's for these items)

Would love your help on some existing ui changes like #133 or large feature experimentation/implemenation like #132

I appreciate the experimentation on the OnboardingView!

Copy link
Owner

@reez reez left a comment

Choose a reason for hiding this comment

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

See prev comments above

Copy link

@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

🧹 Outside diff range and nitpick comments (2)
LDKNodeMonday/View/Home/OnboardingView.swift (2)

31-43: LGTM! Consider enhancing accessibility.

The styling follows iOS design guidelines. Consider adding accessibility identifiers for UI testing.

 Image(systemName: "bolt.horizontal.fill")
     .resizable()
     .aspectRatio(contentMode: .fit)
     .foregroundColor(.accent)
     .frame(width: 150, height: 150, alignment: .center)
     .padding(40)
+    .accessibilityIdentifier("onboarding-logo")

Line range hint 49-89: Remove commented code.

Remove the commented picker implementation to maintain clean production code. If needed, this code can be retrieved from version control history.

-    // Default picker style
-    /*
-    HStack {
-        Text("Network")
-        Spacer()
-        Picker(
-            "Network",
-            selection: $viewModel.selectedNetwork
-        ) {
-            Text("Signet").tag(Network.signet)
-            Text("Testnet").tag(Network.testnet)
-        }
-        .pickerStyle(.automatic)
-        .tint(.accent)
-        .accessibilityLabel("Select bitcoin network")
-    }
-    [... rest of commented code ...]
-     */
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d206422 and 6fcd2ff.

📒 Files selected for processing (1)
  • LDKNodeMonday/View/Home/OnboardingView.swift (3 hunks)
🔇 Additional comments (4)
LDKNodeMonday/View/Home/OnboardingView.swift (4)

91-127: LGTM! Form-based picker implementation.

The new implementation using Form and NavigationLink provides a more native iOS experience and better accessibility.


132-139: ⚠️ Potential issue

Enhance security and user experience of seed phrase input.

The TextField implementation should include security-focused modifiers.

 TextField(
     isFirstTime
         ? "24 word seed phrase (optional)" : "24 word seed phrase (required)",
     text: $viewModel.seedPhrase
 )
 .textFieldStyle(.roundedBorder)
 .submitLabel(.done)
+.keyboardType(.asciiCapable)
+.textContentType(.none)
+.autocorrectionDisabled(true)
+.autocapitalization(.none)
 .padding(.horizontal, 50)

152-161: ⚠️ Potential issue

Add loading state to wallet creation button.

The button should provide feedback during wallet creation process.

+@State private var isCreatingWallet = false
+
 Button("Create wallet") {
+    isCreatingWallet = true
     viewModel.saveSeed()
     isFirstTime = false
 }
 .buttonStyle(
     BitcoinFilled(
         tintColor: .accent,
         isCapsule: true
     )
 )
+.disabled(isCreatingWallet)
+.overlay {
+    if isCreatingWallet {
+        ProgressView()
+            .tint(.accent)
+    }
+}

164-164: Verify accessibility requirements for text size limitations.

The view limits dynamic type size to .accessibility1. Verify if this limitation aligns with your app's accessibility requirements and if users requiring larger text sizes are adequately supported.

Comment on lines 18 to 19
let airdropOptions = ["Receiving Off", "Contacts Only", "Everyone for 10 minutes"]
@State private var selectedAirdropOption = "Receiving Off"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove unused airdrop-related code.

The airdropOptions array and selectedAirdropOption state variable appear to be unused in the current implementation.

-    let airdropOptions = ["Receiving Off", "Contacts Only", "Everyone for 10 minutes"]
-    @State private var selectedAirdropOption = "Receiving Off"

Copy link

@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: 2

🧹 Outside diff range and nitpick comments (3)
LDKNodeMonday/View/Home/OnboardingView.swift (3)

28-40: LGTM! Consider adding accessibility label for the logo image.

The layout and styling changes look good. The centered logo with accent color and properly weighted text create a clean hierarchy.

Add an accessibility label to the logo image:

 Image(systemName: "bolt.horizontal.fill")
     .resizable()
     .aspectRatio(contentMode: .fit)
     .foregroundColor(.accent)
     .frame(width: 150, height: 150, alignment: .center)
     .padding(40)
+    .accessibilityLabel("Monday Wallet Logo")

Line range hint 47-86: Remove commented code.

The old picker implementation is commented out and should be removed to maintain code cleanliness.

-    // Default picker style
-    /*
-    HStack {
-        Text("Network")
-        Spacer()
-        Picker(
-            "Network",
-            selection: $viewModel.selectedNetwork
-        ) {
-            Text("Signet").tag(Network.signet)
-            Text("Testnet").tag(Network.testnet)
-        }
-        .pickerStyle(.automatic)
-        .tint(.accent)
-        .accessibilityLabel("Select bitcoin network")
-    }
-    HStack {
-        Text("Server")
-        Spacer()
-        Picker(
-            "Esplora server",
-            selection: $viewModel.selectedURL
-        ) {
-            ForEach(viewModel.availableURLs, id: \.self) { url in
-                Text(
-                    url.replacingOccurrences(
-                        of: "https://",
-                        with: ""
-                    ).replacingOccurrences(
-                        of: "http://",
-                        with: ""
-                    )
-                )
-                .tag(url)
-            }
-        }
-        .pickerStyle(.automatic)
-        .tint(.accent)
-        .accessibilityLabel("Select esplora server")
-    }
-     */

165-171: Enhance error alert messaging.

The error alert could provide more specific guidance to users.

 Alert(
-    title: Text(viewModel.onboardingViewError?.title ?? "Unknown"),
-    message: Text(viewModel.onboardingViewError?.detail ?? ""),
+    title: Text(viewModel.onboardingViewError?.title ?? "Error"),
+    message: Text(viewModel.onboardingViewError?.detail ?? "An unexpected error occurred. Please try again."),
     dismissButton: .default(Text("OK")) {
         viewModel.onboardingViewError = nil
     }
 )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6fcd2ff and ffae221.

📒 Files selected for processing (1)
  • LDKNodeMonday/View/Home/OnboardingView.swift (2 hunks)
🔇 Additional comments (2)
LDKNodeMonday/View/Home/OnboardingView.swift (2)

129-136: Enhance security and user experience of seed phrase input.

The TextField needs additional security and usability configurations.

 TextField(
     isFirstTime
         ? "24 word seed phrase (optional)" : "24 word seed phrase (required)",
     text: $viewModel.seedPhrase
 )
 .textFieldStyle(.roundedBorder)
 .submitLabel(.done)
+.keyboardType(.asciiCapable)
+.textContentType(.none)
+.autocorrectionDisabled(true)
+.autocapitalization(.none)
 .padding(.horizontal, 50)

149-158: Add loading state to wallet creation button.

The button should provide feedback during wallet creation.

+@State private var isCreatingWallet = false
+
 Button("Create wallet") {
+    isCreatingWallet = true
     viewModel.saveSeed()
     isFirstTime = false
 }
 .buttonStyle(
     BitcoinFilled(
         tintColor: .accent,
         isCapsule: true
     )
 )
+.disabled(isCreatingWallet)
+.overlay {
+    if isCreatingWallet {
+        ProgressView()
+            .tint(.accent)
+    }
+}

}
}
.tint(.accent)
.frame(maxHeight: 150)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Reconsider fixed height constraint for Form.

The fixed height of 150 might cause content clipping with larger Dynamic Type sizes or when additional options are added.

-    .frame(maxHeight: 150)
+    .frame(minHeight: 150)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.frame(maxHeight: 150)
.frame(minHeight: 150)


}
}.dynamicTypeSize(...DynamicTypeSize.accessibility1) // Sets max dynamic size for all Text
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Reconsider dynamic type size limitation.

The current constraint might make the app less accessible to users who need larger text sizes.

-.dynamicTypeSize(...DynamicTypeSize.accessibility1)
+// Consider testing with larger sizes and adjusting layout instead of limiting text size

Committable suggestion skipped: line range outside the PR's diff.

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.

2 participants