Skip to content

fix: show tokens without description#363

Merged
pauldelucia merged 1 commit into
dashpay:v0.9-devfrom
thephez:codex/fix-missing-token-descriptions-on-more-info
Jun 13, 2025
Merged

fix: show tokens without description#363
pauldelucia merged 1 commit into
dashpay:v0.9-devfrom
thephez:codex/fix-missing-token-descriptions-on-more-info

Conversation

@thephez
Copy link
Copy Markdown
Contributor

@thephez thephez commented Jun 12, 2025

Summary

  • ensure FetchContractsWithDescriptions returns token info even if contract description is missing. Previously, contracts with no description (descriptions are optional) would not be displayed.

Generated by Codex

Summary by CodeRabbit

  • Refactor
    • Improved internal handling of optional contract descriptions for enhanced code clarity. No changes to user-facing features or behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 12, 2025

Walkthrough

The code refactors how optional contract documents are handled in the FetchContractsWithDescriptions task. It replaces an explicit conditional with the use of Option::map to streamline the creation of Option<ContractDescriptionInfo>, simplifying the insertion logic without changing the overall control flow or error handling.

Changes

File(s) Change Summary
src/backend_task/contract.rs Refactored to use Option::map for constructing Option<ContractDescriptionInfo>, simplifying logic.

Suggested reviewers

  • pauldelucia

Poem

In the code where contracts dwell,
A rabbit hops and maps quite well.
With Option::map, the path is clear,
Less cluttered code, more cheer to cheer!
No more if-let to slow the run,
Refactoring done, the task is fun!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4139e4c and 1eff802.

📒 Files selected for processing (1)
  • src/backend_task/contract.rs (1 hunks)
🔇 Additional comments (2)
src/backend_task/contract.rs (2)

127-134: Use Option::map to streamline description creation
The new document_option.map(...) replaces the previous if let block cleanly, preserving None when no document is fetched and wrapping present documents in Some(ContractDescriptionInfo). The unwrap_or_default() ensures you always have a valid String.


136-139: Clean insertion of description and tokens into results
Inserting (contract_description_info, token_infos) into the BTreeMap is concise and maintains the original behavior. Duplicate keys will be overwritten, matching expectations for unique contract IDs.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@thephez
Copy link
Copy Markdown
Contributor Author

thephez commented Jun 12, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 12, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@pauldelucia pauldelucia merged commit aae994e into dashpay:v0.9-dev Jun 13, 2025
2 checks passed
lklimek pushed a commit that referenced this pull request Jun 17, 2025
QuantumExplorer added a commit that referenced this pull request Jun 26, 2025
…364)

* fix: Error loading identities from local DB on token creation screen

* feat: add token by token id (#353)

* feat: add token by token id

* fmt

* update cargo toml

* fix: display error for invalid seed phrase in import wallet (#356)

* fix: could not load identity with owner key (#357)

* fix: overwrite dash.conf setting wasnt persisting (#358)

* fix: hard to see password strength text with color (#359)

* fix: message unclear when identity doesnt have appropriate private keys loaded (#360)

* feat: token info button on tokens screen (#361)

* Show tokens without description (#363)

* feat: enable vertical scrolling on network chooser screen (#366)

Previously, if the content did not fit on the screen there was no way to view it unless the application window could be made larger

* fix: overwrite dash.conf setting still wasnt persisting and revert previous attempt  (#372)

* ok

* fix

* fmt

* fix: missing dash-qt path

* chore: remove .env and dash_core_configs from release workflow (#373)

* chore: clippy

* chore: review

* feat: dark mode (#375)

* feat: dark mode

* ok

* fmt

* clippy

* chore: bump version

* fix: identity not found error when refreshing identities (#374)

* fix: identity not found error when refreshing identities

* chore: ui - gray out inactive identities

* chore: minor ui fixes

* chore: identity status creation failed cannot be reliably determined

* fix: det overwrites pending/failed creation status

* chore: copilot's review

* chore: refactor

* Update src/model/qualified_identity/mod.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: not needed migration call removed

* chore: clippy

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: improved err msg on db migration failute.

* chore: improve version number detection

* feat: enhance input decoding to support multiple formats (#376)

* feat: enhance input decoding to support multiple formats

* more work

* more work

* feat: add context menu for contract actions in contract chooser panel (#378)

* fix: token balance decimals (#379)

* fix: token balances displaying decimals incorrectly

* fix

* fix

* fmt

* fix: token creator perpetual distribution was not allowing multiple ids per timestamp (#381)

* chore: wallet is optional for identity - not tested

---------

Co-authored-by: Paul DeLucia <69597248+pauldelucia@users.noreply.github.com>
Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: pauldelucia <pauldelucia2@gmail.com>
Co-authored-by: pshenmic <pshenmic@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: QuantumExplorer <quantum@dash.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