feat(dashpay): show the requested variant next to a normalized contested label - #960
Conversation
…ted label DPNS folds look-alike characters (i/l → 1, o → 0), so requesting "quiet" actually registers "qu1et" — and the In-network-vote row only showed the network's normalized form, which isn't what the user typed. The row now shows both: the requested variant (recovered from the submission bookmarks by SDK-normalizing each) as the title, with the normalized form beside it in the tertiary tone. Rows whose variant IS the normalized form are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe marketplace now recovers user-entered contested-label variants from pending requests. Contested-name rows show the requested variant and the normalized network label when they differ. ChangesUsername variant display
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
DashWallet/Sources/UI/Explore Dash/UsernameMarketplaceScreen.swift (1)
563-563: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winCache requested variants before rendering rows.
Line 563 performs a synchronous SDK-backed scan while SwiftUI builds each contested row. Each state update can repeat O(contested rows × pending labels) work on the main actor. Build a normalized-label-to-requested-label lookup when the ViewModel loads the data, then use a dictionary lookup in
contestedRow.As per coding guidelines, keep SwiftUI views lightweight.
🤖 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/Explore` Dash/UsernameMarketplaceScreen.swift at line 563, Update the ViewModel’s data-loading flow to precompute a normalized-label-to-requested-label dictionary for all contested rows, avoiding repeated SDK-backed scans during rendering. In contestedRow, replace requestedVariant(forNormalized:) with a direct lookup in the cached dictionary while preserving the existing row behavior when no requested label exists.Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@DashWallet/Sources/UI/Explore` Dash/UsernameMarketplaceScreen.swift:
- Line 563: Update the ViewModel’s data-loading flow to precompute a
normalized-label-to-requested-label dictionary for all contested rows, avoiding
repeated SDK-backed scans during rendering. In contestedRow, replace
requestedVariant(forNormalized:) with a direct lookup in the cached dictionary
while preserving the existing row behavior when no requested label exists.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6354b9a2-491c-4531-a642-086bf2cf1ecb
📒 Files selected for processing (1)
DashWallet/Sources/UI/Explore Dash/UsernameMarketplaceScreen.swift
Issue being fixed or feature implemented
Testnet QA: requesting "quiet" shows up under My Names → In network vote as "qu1et" — DPNS normalization folds look-alike characters (i/l → 1, o → 0), and the row only displayed the network's normalized label, not what the user typed.
What was done
contestedRownow shows both forms when they differ: the requested variant ("quiet") as the title — recovered by running each submission bookmark throughdpnsNormalizeLabeland matching it to the SDK cache's normalized label — with the normalized form ("qu1et") beside it in the tertiary tone. The variant is what the user asked for; the normalized form is what the network actually registers. Rows whose typed form already equals the normalized form are unchanged.How Has This Been Tested?
Clean
dashpayarm64 simulator build; installed on the testnet QA simulator carrying a live "quiet"→"qu1et" contest among four in-flight requests — screenshot verification in the same QA session. (Unit-test target pre-existing broken.)Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
Summary by CodeRabbit