Skip to content

fix(wallet): hide unavailable account entry points#776

Merged
romchornyi merged 3 commits into
feat/release-8.6.0from
feat/disable-crowdnode-functionality
Jun 10, 2026
Merged

fix(wallet): hide unavailable account entry points#776
romchornyi merged 3 commits into
feat/release-8.6.0from
feat/disable-crowdnode-functionality

Conversation

@romchornyi

@romchornyi romchornyi commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

CrowdNode sign-up, deposit, and related entry points should no longer be exposed in parts of the app where that functionality is temporarily unavailable. This change removes or hides those entry points so users only see actions that are currently supported.

What was done?

  • Hid the Staking item in Explore Dash unless the user has a linked CrowdNode account.
  • Removed CrowdNode from customizable shortcut options when no linked account exists.
  • Filtered previously saved custom shortcuts so a stale CrowdNode shortcut is not restored without an account.
  • Updated CrowdNode portal items to always hide Deposit and Online Account, leaving only supported portal actions visible.
  • Kept the portal table layout aligned with the filtered portalItems source.
  • Updated the CrowdNode Getting Started screen to hide sign-up/link buttons and show a temporary unavailability message.

How Has This Been Tested?

  • Verified the code changes by reviewing all affected CrowdNode entry points and ensuring the filtering logic is applied at the source of truth.
  • Confirmed the relevant Explore, Home shortcut, CrowdNode portal, and Getting Started flows now read from the updated visibility rules.
  • Full app build / automated tests were not run in this pass.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

Bug Fixes

  • CrowdNode sign-up and deposit features are temporarily unavailable and have been hidden from the user interface.
  • CrowdNode-related menu items and shortcuts now appear only when an active account has been established.
  • Updated the Explore Dash menu to conditionally display staking options based on account status.
  • Updated UI messaging to inform users that sign-up services are temporarily unavailable.

Why:
- CrowdNode sign-up and deposit flows are temporarily unavailable in several entry points.

What:
- Hide Explore staking unless the user has a linked CrowdNode account.
- Remove CrowdNode from customizable and restored shortcuts when no account exists.
- Filter portal items and adjust the portal table layout to the reduced item set.
- Hide sign-up and link actions on the getting started screen.

Validation:
- Not run.
Why:
- CrowdNode deposit and online account entry points should stay unavailable in the portal.

What:
- Always filter deposit and online account out of portalItems.

Validation:
- Not run.
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@romchornyi, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 55 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 032b52d8-d8ca-43da-8435-f22ede8eb01b

📥 Commits

Reviewing files that changed from the base of the PR and between a2d567f and 906584b.

📒 Files selected for processing (3)
  • DashWallet/Sources/UI/Explore Dash/ExploreMenuScreen.swift
  • DashWallet/Sources/UI/Home/Views/HomeViewModel.swift
  • DashWallet/Sources/UI/Home/Views/Shortcuts/Models/ShortcutAction.swift
📝 Walkthrough

Walkthrough

This PR gates CrowdNode features based on signup state. Portal items are filtered to hide deposit and account-linking actions. The portal UI displays an unavailable message and hides signup buttons. Portal view tables resize dynamically based on filtered item count. Explore menu and home shortcuts conditionally display CrowdNode features only when signup is complete.

Changes

CrowdNode Feature Availability

Layer / File(s) Summary
Portal item filtering
DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift
portalItems now filters out .deposit and .onlineAccount cases, returning only the remaining portal action items.
Portal UI and layout updates
DashWallet/Sources/UI/CrowdNode/Getting Started/GettingStartedViewController.swift, DashWallet/Sources/UI/CrowdNode/Portal/CrowdNodePortalViewController.swift
Getting Started screen hides account signup buttons and displays a localized unavailable message. Portal table view dynamically computes section count (ceiling of half the item count) and row counts per section (maximum 2 items) based on the filtered item count.
App-wide feature visibility
DashWallet/Sources/UI/Home/Views/Shortcuts/Models/ShortcutAction.swift, DashWallet/Sources/UI/Home/Views/HomeViewModel.swift, DashWallet/Sources/UI/Explore Dash/ExploreMenuScreen.swift
customizableActions becomes a computed property that conditionally includes .crowdNode only when signup is finished. Home screen shortcuts filter .crowdNode actions by signup state. Explore menu conditionally renders the Staking menu item only when CrowdNode account is present.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 A hop through the CrowdNode gate,
Features tucked away, the app will wait,
Till signup's done and state is bright,
Portal items trimmed, the UI's right! 🎯✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main objective of the PR—hiding unavailable CrowdNode entry points across multiple UI screens.
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
  • Commit unit tests in branch feat/disable-crowdnode-functionality

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.

@romchornyi romchornyi changed the title Feat/disable crowdnode functionality fix(wallet): hide unavailable account entry points Jun 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

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/CrowdNode/Portal/CrowdNodePortalViewController.swift (1)

151-157: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Dynamic section count now makes fixed reload index paths crash-prone.

Line 201 can produce only one section, but Line 156 still reloads section: 1. That will trigger an out-of-bounds crash when onlineAccountState publishes.

Suggested fix
-        viewModel.$crowdNodeBalance
+        viewModel.$crowdNodeBalance
             .receive(on: DispatchQueue.main)
             .removeDuplicates()
             .sink(receiveValue: { [weak self] _ in
                 self?.balanceView.dataSource = self
-                self?.tableView.reloadRows(at: [
-                    IndexPath(item: 0, section: 0),
-                    IndexPath(item: 1, section: 0),
-                ],
-                with: .none)
+                self?.tableView.reloadData()
             })
             .store(in: &cancellableBag)

         viewModel.$walletBalance
             .receive(on: DispatchQueue.main)
             .removeDuplicates()
             .sink(receiveValue: { [weak self] _ in
-                self?.tableView.reloadRows(at: [
-                    IndexPath(item: 0, section: 0),
-                ],
-                with: .none)
+                self?.tableView.reloadData()
             })
             .store(in: &cancellableBag)

         viewModel.$onlineAccountState
             .receive(on: DispatchQueue.main)
             .sink { [weak self] _ in
-                self?.tableView.reloadRows(at: [
-                    IndexPath(item: 1, section: 0),
-                    IndexPath(item: 0, section: 1),
-                ],
-                with: .none)
+                self?.tableView.reloadData()

Also applies to: 201-206

🤖 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 `@DashWallet/Sources/UI/CrowdNode/Portal/CrowdNodePortalViewController.swift`
around lines 151 - 157, The current sink on viewModel.$onlineAccountState calls
tableView.reloadRows with hard-coded IndexPath(section: 1) which can be
out-of-bounds when the table has only one section; update the closure in the
viewModel.$onlineAccountState sink to compute valid index paths before calling
tableView.reloadRows — e.g., query tableView.numberOfSections and
tableView.numberOfRows(inSection:) (or consult the viewModel’s current sections)
and only include IndexPath(item: 1, section: 0) and IndexPath(item: 0, section:
1) if those sections/rows exist, otherwise skip or reload available
rows/sections to avoid the crash. Ensure the change is applied to the same
closure where tableView.reloadRows(at:...) is invoked.
🤖 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 `@DashWallet/Sources/UI/Explore` Dash/ExploreMenuScreen.swift:
- Around line 34-36: The visibility check for Staking is too strict: update
hasCrowdNodeAccount to treat linked accounts as valid by including the
.linkedOnline state in the predicate (e.g. CrowdNode.shared.signUpState ==
.finished || CrowdNode.shared.signUpState == .linkedOnline) so linked existing
CrowdNode users see Staking; apply the same change to the other occurrence(s)
that reference CrowdNode.shared.signUpState (the logic around lines 91–100 in
ExploreMenuScreen) so both places use the relaxed check.

In `@DashWallet/Sources/UI/Home/Views/HomeViewModel.swift`:
- Around line 719-724: In the HomeViewModel filter closure that currently checks
action.type == .crowdNode and then only allows CrowdNode.shared.signUpState ==
.finished, update the condition to also permit when CrowdNode.shared.signUpState
== .linkedOnline so saved CrowdNode shortcuts for linked-online users are not
filtered out; locate the anonymous closure inside the .filter call (the one
testing action.type == .crowdNode) and add a second allowed state
(.linkedOnline) alongside .finished when deciding to return true.

In `@DashWallet/Sources/UI/Home/Views/Shortcuts/Models/ShortcutAction.swift`:
- Around line 55-57: The gating only allows CrowdNode when
CrowdNode.shared.signUpState == .finished, excluding accounts with the
.linkedOnline state; update the condition in ShortcutAction (where
CrowdNode.shared.signUpState is checked before calling
actions.append(.crowdNode)) to also permit .linkedOnline (e.g., check for
.finished || .linkedOnline or use a set/contains on allowed states) so linked
online users see the CrowdNode action.

---

Outside diff comments:
In `@DashWallet/Sources/UI/CrowdNode/Portal/CrowdNodePortalViewController.swift`:
- Around line 151-157: The current sink on viewModel.$onlineAccountState calls
tableView.reloadRows with hard-coded IndexPath(section: 1) which can be
out-of-bounds when the table has only one section; update the closure in the
viewModel.$onlineAccountState sink to compute valid index paths before calling
tableView.reloadRows — e.g., query tableView.numberOfSections and
tableView.numberOfRows(inSection:) (or consult the viewModel’s current sections)
and only include IndexPath(item: 1, section: 0) and IndexPath(item: 0, section:
1) if those sections/rows exist, otherwise skip or reload available
rows/sections to avoid the crash. Ensure the change is applied to the same
closure where tableView.reloadRows(at:...) is invoked.
🪄 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: 4854c6f4-2857-4492-9dee-c46e461dc988

📥 Commits

Reviewing files that changed from the base of the PR and between 6f4ec9e and a2d567f.

📒 Files selected for processing (6)
  • DashWallet/Sources/UI/CrowdNode/CrowdNodeModel.swift
  • DashWallet/Sources/UI/CrowdNode/Getting Started/GettingStartedViewController.swift
  • DashWallet/Sources/UI/CrowdNode/Portal/CrowdNodePortalViewController.swift
  • DashWallet/Sources/UI/Explore Dash/ExploreMenuScreen.swift
  • DashWallet/Sources/UI/Home/Views/HomeViewModel.swift
  • DashWallet/Sources/UI/Home/Views/Shortcuts/Models/ShortcutAction.swift

Comment thread DashWallet/Sources/UI/Explore Dash/ExploreMenuScreen.swift
Comment thread DashWallet/Sources/UI/Home/Views/HomeViewModel.swift
Comment thread DashWallet/Sources/UI/Home/Views/Shortcuts/Models/ShortcutAction.swift Outdated

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

LGTM

@romchornyi romchornyi changed the base branch from master to feat/release-8.6.0 June 10, 2026 14:44
@romchornyi romchornyi merged commit bf3e7bf into feat/release-8.6.0 Jun 10, 2026
3 checks passed
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.

3 participants