v0.8.2-dev to master#186
Conversation
WalkthroughThe pull request updates the package version in Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant S as DPNSScreen
U->>S: Enter filter term for active/past/owned contests
S->>S: Process filter term (normalize characters)
S->>U: Render filtered contest list
U->>S: Select bulk voting option ("No Vote", "Cast Now", "Schedule")
S->>S: Update set_all_option state
S->>U: Display voting scheduling inputs if "Schedule" is selected
Suggested reviewers
Poem
✨ Finishing Touches
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/ui/dpns/dpns_contested_names_screen.rs (3)
348-372: Filter implementation for active contestsThe filter implementation includes smart character replacement ('o'/'O' to '0' and 'l' to '1'), which helps match common typos or visual ambiguities.
However, users may not be aware of these automatic replacements. Consider adding a tooltip explaining this behavior.
698-725: Filter implementation for past contestsI notice the filtering code for past contests is almost identical to the active contests implementation. Consider extracting this logic into a helper function to reduce duplication and ensure consistent behavior across all filters.
-// 1) Filter by `past_filter_term` -if !self.past_filter_term.is_empty() { - let mut filter_lc = self.past_filter_term.to_lowercase(); - // Convert o and O to 0 and l to 1 in filter_lc - filter_lc = filter_lc - .chars() - .map(|c| match c { - 'o' | 'O' => '0', - 'l' => '1', - _ => c, - }) - .collect(); - - cn.retain(|c| { - c.normalized_contested_name - .to_lowercase() - .contains(&filter_lc) - }); -} +if !self.past_filter_term.is_empty() { + cn = self.apply_name_filter(cn, &self.past_filter_term); +}Then add a helper method to the
DPNSScreenimplementation:fn apply_name_filter<T>(&self, items: Vec<T>, filter_term: &str) -> Vec<T> where T: HasNormalizedName { if filter_term.is_empty() { return items; } let mut filter_lc = filter_term.to_lowercase(); filter_lc = filter_lc .chars() .map(|c| match c { 'o' | 'O' => '0', 'l' => '1', _ => c, }) .collect(); items.into_iter() .filter(|item| { item.get_normalized_name() .to_lowercase() .contains(&filter_lc) }) .collect() }
860-873: Filter implementation for owned namesThe filter for owned names doesn't include the character replacement logic (o/O→0, l→1) that's present in the active and past contest filters. This inconsistency might confuse users who expect the same behavior across all filters.
Consider applying the same character replacement logic to the owned names filter for consistency:
if !self.owned_filter_term.is_empty() { - let filter_lc = self.owned_filter_term.to_lowercase(); + let mut filter_lc = self.owned_filter_term.to_lowercase(); + // Convert o and O to 0 and l to 1 in filter_lc + filter_lc = filter_lc + .chars() + .map(|c| match c { + 'o' | 'O' => '0', + 'l' => '1', + _ => c, + }) + .collect(); name_infos.retain(|c| c.1.name.to_lowercase().contains(&filter_lc)); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Cargo.toml(1 hunks)src/ui/dpns/dpns_contested_names_screen.rs(10 hunks)
✅ Files skipped from review due to trivial changes (1)
- Cargo.toml
🔇 Additional comments (4)
src/ui/dpns/dpns_contested_names_screen.rs (4)
123-125: Added filter fields for DPNS contested namesGood addition of filter fields for the three types of contested names. These will improve the usability of the UI by letting users quickly find specific names.
Also applies to: 194-196
136-136: Added set_all_option for bulk votingNice addition of a
set_all_optionfield initialized toVoteOption::CastNowto enable bulk operations on all identities.Also applies to: 207-207
839-845: Improved display of awarded identifiersGood UI enhancement for past contest identifier display, making it truncatable and hoverable for better visibility of long identifiers.
1329-1407: Added bulk voting options UIExcellent UX improvement for setting voting options on all identities at once. The UI is clear and includes all necessary inputs for scheduling votes.
The implementation handles different voting options effectively and provides a clear way to apply settings to all identities.
Summary by CodeRabbit
Chores
New Features