Repository navigation
feat: add "Import private key" sheet and colors - #748
HashEngineering merged 11 commits into
Conversation
📝 WalkthroughWalkthroughAdds a SwiftUI private-key import sheet, expands and reorganizes color tokens and asset catalogs, tweaks build/scheme settings and Podfile target, and adds a script to prepare DAPI-GRPC proto caches and pod installer artifacts. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
DashWallet/Sources/UI/Menu/Tools/ToolsMenuScreen.swift (1)
220-238:⚠️ Potential issue | 🟡 MinorRemove the unused
delegateInternalproperty.The
delegateInternalproperty (line 24) andDelegateInternalclass (lines 230-238) are initialized but never used. TheshowImportPrivateKey()method displays the SwiftUIImportPrivateKeySheetdirectly without utilizing the delegate. TheDWImportWalletInfoViewController.createController()extension (lines 220-227) remains in use by other parts of the codebase (e.g.,HomeViewController+Shortcuts.swift), so it should not be removed.
🤖 Fix all issues with AI agents
In
`@DashWallet/Resources/AppAssets.xcassets/Menu/image.import.private.key.large.imageset/Contents.json`:
- Around line 1-17: The asset set "import.private.key.large" currently lists the
same bitmap file for scale "1x", "2x", and "3x"; replace these duplicates with
properly scaled raster variants (e.g., [email protected],
[email protected], [email protected]) or switch the
asset to a single vector/PDF to let Xcode generate correct scales; update the
Contents.json entries for the "images" array to reference the correct filenames
for each scale so the import.private.key.large image renders crisply on all
device scale factors.
In `@scripts/prepare-dapi-grpc.sh`:
- Around line 7-8: The RELEASE_CACHE and EXTERNAL_CACHE variables are hardcoded
to a specific user path which will break on other machines; update the script to
build these paths dynamically by using the $HOME environment variable (or
fallback to `~`) and any necessary relative subpaths so RELEASE_CACHE and
EXTERNAL_CACHE are portable across systems; locate the assignments to
RELEASE_CACHE and EXTERNAL_CACHE in scripts/prepare-dapi-grpc.sh and replace the
hardcoded "/Users/ross/..." prefixes with a dynamic base (e.g.,
"$HOME/Library/Caches/...") and ensure any path concatenation uses safe shell
handling to avoid breaking on spaces.
In
`@Shared/Resources/SharedAssets.xcassets/Colors/Gray/Gray200.colorset/Contents.json`:
- Around line 1-20: The Gray200 color entry is using identical RGB hex
components ("red":"0xF5","green":"0xF6","blue":"0xF7") to Gray50; confirm the
design spec for the intended Gray200 value and, if Gray200 should be darker,
update the "red"/"green"/"blue" component strings in the Gray200 colorset (the
Contents.json entry for Gray200) to the correct darker hex components (or adjust
"alpha" if translucency was intended), then validate visually in the asset
catalog and run any token-generation scripts to ensure Gray200 no longer
duplicates Gray50.
In
`@Shared/Resources/SharedAssets.xcassets/Colors/White/WhiteAlpha15.colorset/Contents.json`:
- Around line 6-11: The "components" block in Contents.json for the WhiteAlpha
color sets red to "0xFE" while green and blue are "0xFF", causing a slight tint;
update the "red" component value from "0xFE" to "0xFF" in the
WhiteAlpha15.colorset (modify the "components" -> "red" entry) so RGB reads
"red":"0xFF","green":"0xFF","blue":"0xFF" for true white, unless the off-by-one
was intentionally required by design.
In
`@Shared/Resources/SharedAssets.xcassets/Colors/White/WhiteAlpha70.colorset/Contents.json`:
- Around line 6-11: The components block in the Colorset Contents.json has "red"
: "0xFE" while "green" and "blue" are "0xFF", producing a non‑pure white; update
the "red" value to "0xFF" in the components object (and check other
WhiteAlpha*.colorset Contents.json files for the same copy/paste error) so all
RGB components match for pure white with the existing "alpha" value.
🧹 Nitpick comments (8)
DashWallet/Resources/AppAssets.xcassets/Menu/icon-close-sheet.imageset/Contents.json (1)
1-23: Prefer SVG imageset for AppAssets icons.This imageset uses PNG variants; please consider switching to SVG with vector preservation + template rendering to match asset guidelines.
♻️ Proposed SVG imageset structure
{ "images" : [ { - "filename" : "icon-close-sheet.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "[email protected]", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "[email protected]", - "idiom" : "universal", - "scale" : "3x" + "filename" : "icon-close-sheet.svg", + "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 - } + }, + "properties" : { + "preserves-vector-representation" : true, + "template-rendering-intent" : "template" + } }Based on learnings: Applies to /AppAssets.xcassets//*.svg : Use SVG icons instead of PNG. Configure SVG imagesets with
preserves-vector-representation: trueandtemplate-rendering-intent: templatein Contents.json to enable scaling and color adaptation.scripts/prepare-dapi-grpc.sh (2)
18-22: Excessive error suppression may hide legitimate failures.Redirecting stderr and using
|| trueon git operations masks real errors. Ifgit submodule updatefails for a reason other than "already initialized," you won't know.♻️ Suggested improvement with conditional error handling
- git init 2>/dev/null || true - git submodule update --init --recursive 2>/dev/null || true + if [ ! -d ".git" ]; then + git init + fi + git submodule update --init --recursive || echo " Warning: submodule update failed" if [ -d "platform" ]; then - (cd platform && git reset --hard 2>/dev/null) || true + (cd platform && git reset --hard) || echo " Warning: git reset failed" fi
65-68: Hardcoded version in generated podspec may drift from actual version.The version
0.22.0-dev.8is hardcoded in the heredoc. If the cached pod version changes, this will produce a mismatch.♻️ Extract version dynamically
+ # Extract version from existing podspec before overwriting + DAPI_VERSION=$(grep -oP "s\.version\s*=\s*['\"]\\K[^'\"]+' DAPI-GRPC.podspec 2>/dev/null || echo "0.22.0-dev.8") + cat > DAPI-GRPC.podspec.new << PODSPEC_EOF Pod::Spec.new do |s| s.name = "DAPI-GRPC" - s.version = "0.22.0-dev.8" + s.version = "${DAPI_VERSION}"Note: You'd also need to remove the single quotes around
PODSPEC_EOFto enable variable expansion.DashWallet/Resources/AppAssets.xcassets/Menu/icon-close-sheet-white.imageset/Contents.json (1)
1-23: Consider using SVG instead of PNG for better scalability.This icon uses multiple PNG files at different scales. SVG would provide better scaling and allow color adaptation via template rendering.
♻️ Suggested SVG configuration
{ "images" : [ { "filename" : "icon-close-sheet-white.svg", "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 }, "properties" : { "preserves-vector-representation" : true, "template-rendering-intent" : "template" } }As per coding guidelines: "Use SVG icons instead of PNG. Configure SVG imagesets with
preserves-vector-representation: trueandtemplate-rendering-intent: templatein Contents.json to enable scaling and color adaptation."Shared/Resources/SharedAssets.xcassets/Colors/White/WhiteAlpha50.colorset/Contents.json (1)
6-11: Minor: Red component is 0xFE instead of 0xFF.The red component is 254 (0xFE) instead of 255 (0xFF) for pure white. This creates a barely perceptible tint. If intentional by design, this is fine; otherwise, consider using 0xFF for consistency.
DashWallet/Sources/UI/Menu/Tools/ImportWallet/ImportPrivateKeySheet.swift (1)
38-51: Optional: Address SwiftLint trailing closure warning.SwiftLint flags trailing closure syntax when multiple closures are passed. This is a minor style nit that can be addressed by using explicit
content:label.Suggested fix
Button(action: { presentationMode.wrappedValue.dismiss() - }) { + }, label: { Image(colorScheme == .dark ? "icon-close-sheet-white" : "icon-close-sheet") .resizable() .aspectRatio(contentMode: .fit) .frame(width: 9, height: 9) .foregroundColor(Color.primaryText) .frame(width: 34, height: 34) .overlay( Circle() .stroke(Color.gray300.opacity(0.3), lineWidth: 1.5) ) - } + })DashWallet/Sources/UI/SwiftUI Components/Color+DWStyle.swift (1)
191-200: TODO: Dark mode shadow color needs proper value.Line 195 has a TODO comment indicating the dark mode shadow color is a placeholder. Consider addressing this before release to ensure consistent dark mode appearance.
Would you like me to open an issue to track completing the dark mode shadow color implementation?
Shared/Resources/SharedAssets.xcassets/Colors/System/SystemRedColor.colorset/Contents.json (1)
2-14: Verify if dark mode variant is needed.The color asset defines only a universal appearance without separate light/dark mode variants. For UI colors, especially in an iOS app with system-wide dark mode support, it's common to provide appearance-specific variants.
Please verify whether
SystemRedColorshould have the same appearance in both light and dark modes, or if a dark mode variant should be added.
Replace full-page navigation with SwiftUI bottom sheet presentation for Import Private Key feature. Includes custom grabber, close button, and updated layout matching design specifications. Sheet height set to 460px with proper spacing and content positioning. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove AtmDetailsView.swift references from project file - Set build configuration to Debug - Disable implicit dependencies to avoid WatchApp build issues Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Created scripts/prepare-dapi-grpc.sh to pre-generate proto files - Workaround for DAPI-GRPC submodule initialization issue in CocoaPods - Script handles both Release and External cache locations - Modifies podspec to skip failing prepare_command - Updated Podfile.lock with all 49 successfully installed pods - Requires CocoaPods 1.15.2 Usage: Run ./scripts/prepare-dapi-grpc.sh before pod install Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Replace --quiet with --silent flag (1.15.2 doesn't support --quiet) - Fix cd platform command to prevent script errors - Update Podfile.lock checksum from regeneration Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
…ary version - Changed TodayExtension platform from iOS 13.0 to iOS 14.0 - Fixes library mismatch error (was looking for DSDynamicOptions-iOS13.0, now uses DSDynamicOptions) - Consistent with post_install script that sets all iOS targets to 14.0 Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Add PIGGYCARDS_ENABLED compiler flag to all build configurations (Debug, Testnet, Testflight, Release) - Add GeoRestrictionService.swift to Xcode project with proper build file and group references - Remove hardcoded DSDynamicOptions-iOS14.0 linker flags that prevented successful builds - Add Gray1000 color asset to SharedAssets These changes fix compilation errors introduced when master (with PiggyCards geo-restriction feature) was merged into this branch. The GeoRestrictionService file existed on disk but wasn't in the Xcode project, and the hardcoded linker flags conflicted with CocoaPods configuration. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
faeef74 to
10ffd5b
Compare
HashEngineering
left a comment
There was a problem hiding this comment.
we will fix any problems in the next PR
aa9603f
into
feat/tool-menuitems-and-components
Issue being fixed or feature implemented
What was done?
How Has This Been Tested?
Breaking Changes
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Style
Chores