Skip to content

v0.8.3-dev to master#187

Merged
pauldelucia merged 5 commits into
masterfrom
v0.8.3-dev
Feb 26, 2025
Merged

v0.8.3-dev to master#187
pauldelucia merged 5 commits into
masterfrom
v0.8.3-dev

Conversation

@pauldelucia
Copy link
Copy Markdown
Member

@pauldelucia pauldelucia commented Feb 26, 2025

Summary by CodeRabbit

  • Chores

    • Updated package version to 0.8.3.
  • New Features

    • Bulk vote processing now delivers clearer, contextual feedback with tailored success and error messages.
  • Style

    • Improved layout spacing on the registration screen for a more organized and user-friendly interface.
  • Enhancements

    • Refined handling of voting results to provide more nuanced responses based on different outcomes.
    • Streamlined feedback for bulk voting, improving clarity for users regarding the success or failure of their votes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 26, 2025

Walkthrough

This pull request updates the package version in Cargo.toml and refines both backend and UI logic for handling contested names and voting. Backend changes include enhanced processing of vote results and removal of obsolete vote strength computations. UI updates improve the display of bulk vote schedules and adjust layout spacing on screens. The changes streamline control flow and messaging without altering public entity declarations.

Changes

File(s) Change Summary
Cargo.toml Package version updated from "0.8.2" to "0.8.3".
src/backend_task/contested_names/mod.rs Modified vote result processing in run_contested_resource_task using flat_map to handle three outcomes: successful DPNS vote results, error messages, and an unexpected success case.
src/backend_task/contested_names/vote_on_dpns_name.rs Removed the strength variable and its related vote accumulation and database update logic, simplifying the vote processing control flow.
src/ui/dpns/dpns_contested_names_screen.rs Enhanced bulk vote handling messaging: now displays conditional success or error messages based on bulk_schedule_message, and repositioned the navigation button for a cleaner UI layout.
src/ui/identities/register_dpns_name_screen.rs Adjusted UI spacing by adding vertical space before key elements, improving visual structure around the name input section and registration status messages.

Sequence Diagram(s)

sequenceDiagram
    participant AppCtx as AppContext
    participant VoteOp as Voting Operation
    participant VoteProc as Vote Processor

    AppCtx->>VoteOp: Initiate contested vote operation
    VoteOp-->>AppCtx: Return vote result (DPNSVoteResults / Err / unexpected Ok)
    AppCtx->>VoteProc: Process result via flat_map
    alt Successful DPNS vote
        VoteProc-->>AppCtx: Return platform results
    else Vote error
        VoteProc-->>AppCtx: Return error vector (name, choice, error message)
    else Unexpected case
        VoteProc-->>AppCtx: Return vector with Ok(())
    end
Loading
sequenceDiagram
    participant UI as DPNSScreen
    participant Backend as Backend Task

    UI->>Backend: Request bulk vote handling status
    Backend-->>UI: Return bulk_schedule_message
    alt Message is Error
        UI->>UI: Display error heading and message
    else Message is Success
        UI->>UI: Display success heading and confirmation message
        UI->>UI: Show navigation button for Scheduled Votes Screen
    end
Loading

Possibly related PRs

  • v0.8.2-dev to master #186: The changes in the main PR, which update the version number in Cargo.toml, are related to the retrieved PR that also modifies the version number in the same file, albeit to a different version.

Suggested reviewers

  • QuantumExplorer
  • ogabrielides

Poem

I'm a rabbit in the code field, hopping with delight,
New version tunes in the night, 0.8.3 is in sight!
Vote results now dance with grace in each backend line,
UI messages cheer and shine—everything aligns!
Through bouncy bytes and joyful leap, our code takes flight,
Celebrating changes with a twitch and a smile so bright!
🐇✨ Happy coding!

Tip

CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.

✨ Finishing Touches
  • 📝 Generate Docstrings

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 generate docstrings to generate docstrings for this 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
Copy Markdown
Contributor

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

🧹 Nitpick comments (4)
src/backend_task/contested_names/mod.rs (1)

72-86: Consider clarifying or logging the unexpected success case.

The Ok(_) => { ... } // This shouldn't occur branch potentially masks unexpected BackendTaskSuccessResult variants. It might be beneficial to log a warning or handle that branch more explicitly to help troubleshoot unforeseen cases.

 Ok(_) => {
-    // Got some other BackendTaskSuccessResult, this shouldn't occur
+    tracing::warn!("Unexpected BackendTaskSuccessResult variant encountered. Consider reviewing new or outdated result types.");
     vec![(name.clone(), vote_choice.clone(), Ok(()))]
 }
src/ui/dpns/dpns_contested_names_screen.rs (3)

1646-1658: Enhance user feedback for bulk schedule results.

When encountering an error, the code displays a ❌ icon and the raw error message. For partial or more nuanced failures, consider tailoring the content to convey the overall success/failure ratio. This could help users quickly interpret results.


1677-1684: Improve navigation clarity.

After completing a bulk vote, the user is offered two paths: "Go back to Active Contests" and "Go to Scheduled Votes Screen." The flow appears correct, but consider showing a brief description of each option to guide next steps more explicitly.


1796-1828: Refine success and error aggregation.

The logic neatly separates complete failure, partial success, and full success. However, the partial success state is being labeled as a general error message. For better UX, consider introducing an additional category (e.g., a "Warning" banner) to differentiate from total failure.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8e38e5 and af015c4.

📒 Files selected for processing (5)
  • Cargo.toml (1 hunks)
  • src/backend_task/contested_names/mod.rs (1 hunks)
  • src/backend_task/contested_names/vote_on_dpns_name.rs (0 hunks)
  • src/ui/dpns/dpns_contested_names_screen.rs (3 hunks)
  • src/ui/identities/register_dpns_name_screen.rs (2 hunks)
💤 Files with no reviewable changes (1)
  • src/backend_task/contested_names/vote_on_dpns_name.rs
✅ Files skipped from review due to trivial changes (2)
  • Cargo.toml
  • src/ui/identities/register_dpns_name_screen.rs

Copy link
Copy Markdown
Contributor

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

🧹 Nitpick comments (2)
src/ui/dpns/dpns_contested_names_screen.rs (2)

1654-1672: Enhanced bulk vote results display with better error handling

This change improves the user experience by providing more nuanced feedback on vote results, differentiating between partial success, complete failure, and complete success scenarios.

Consider making the success/failure determination more robust by using a structured approach rather than string checking with contains("Successes"). A dedicated enum or boolean flag in the message structure would be less fragile than string checking.


1813-1845: Enhanced error handling for vote results

The vote results processing has been improved to explicitly construct separate vectors for successes and errors, leading to more detailed feedback for users.

The error message formatting using {:?} for displaying errors might not be the most user-friendly. Consider a more structured approach where each error is formatted on its own line with clear context about which vote failed.

-                format!(
-                    "Successes: {}/{}\n\nErrors:\n\n{:?}",
-                    successes.len(),
-                    successes.len() + errors.len(),
-                    errors_string
-                ),
+                format!(
+                    "Successes: {}/{}\n\nErrors:\n\n{}",
+                    successes.len(),
+                    successes.len() + errors.len(),
+                    errors.iter().enumerate().map(|(i, err)| format!("{}. {}", i+1, err)).collect::<Vec<_>>().join("\n")
+                ),
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2d433c and 3101acf.

📒 Files selected for processing (1)
  • src/ui/dpns/dpns_contested_names_screen.rs (3 hunks)
🔇 Additional comments (2)
src/ui/dpns/dpns_contested_names_screen.rs (2)

1507-1515: Improved UX with conditional warning display

The code now only shows the warning about Dash Evo Tool needing to remain running for scheduled votes when relevant (when any votes are actually scheduled), rather than displaying it statically all the time.


1694-1701: Improved navigation with Scheduled Votes button

The button for navigating to the Scheduled Votes Screen has been repositioned with proper spacing, making the UI more intuitive after completing vote operations.

@pauldelucia pauldelucia merged commit 02103f3 into master Feb 26, 2025
@pauldelucia pauldelucia deleted the v0.8.3-dev branch February 26, 2025 10:19
pauldelucia added a commit that referenced this pull request Mar 12, 2025
* feat: devnet support

* fix: re-add zmq listeners

* progress

* local network connection working

* ok

* feat: register contract screen

* works

* add contracts to the db on register

* feat: tokens screen

* compiles but not done

* ok

* fix

* clean

* add mint button and search results

* add mint backend file

* search improvements

* feat: change to platform v2

* hacks

* ok

* moreee

* token balances query works

* some stuff is working

* token transfers

* ok

* fix token query

* mint token

* burn tokens

* destroy tokens

* freeze tokens

* unfreeze tokens

* pause and resume tokens

* ok

* display token names

* fix: identities being removed from identity table but not identity_order table

* fix local network loading

* remove token balance from det

* contracts screen

* chore: use GH runners for ARM

* chore: fix protobuf

* ok

* ok

* sequential backend tasks

* fix: identity custom ordering

* feat: input dashmate password

* enable zmq for local

* update tokens screen

* token screen

* remove tokens

* fix

* fix

* progress

* feat: set all vote options in voting screen

* feat: filter contests in dpns screens

* feat: filter owned names

* feat: token creator

* feat: more advanced token creator and cleaner

* v0.8.3-dev to master (#187)

* fix: error propagation in bulk voting

* refactor: only update local db vote counts with platform queries

* chore: bump version

* feat: better message display for vote results

* feat: better display of voting errors

* more robust token creation

* more on token creator

* select authorized action takers

* add token icon

* feat: top panel navigation

* feat: remove private key from DET button

* more rule configs

* more

* refined token creator

* more on token creator distribution

* token creator

* more on token creator

* feat: implement cookie authentication for DashCore RPC

* fix: dynamic grab different cookies for different networks

* trivial: use tracing::info instead of eprintln! and don't log success

* all configs done

* fix

* cleanup

* finished token creator for now

* format

* groups

* fix

* view json

* chore: bump version and rust version

* set sdk path dependency

* remove extra clone

* expect core client

---------

Co-authored-by: ktechmidas <daniel@ktechmidas.net>
Co-authored-by: pasta <pasta@dashboost.org>
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