Skip to content

feat(about): show anti-abuse bond policy from node info event#617

Merged
grunch merged 2 commits into
mainfrom
add-bond-info
Jun 16, 2026
Merged

feat(about): show anti-abuse bond policy from node info event#617
grunch merged 2 commits into
mainfrom
add-bond-info

Conversation

@Catrya

@Catrya Catrya commented Jun 15, 2026

Copy link
Copy Markdown
Member
  • Add an Anti-abuse bond section to the About screen, parsed from the kind-38385 info event
  • Hide it on legacy nodes, show status only when disabled, full parameters when enabled
  • Add localized labels, per-row help dialogs and a concept explanation in en/es/it/de/fr
Captura desde 2026-06-15 16-42-04 Captura desde 2026-06-15 16-40-49

Summary by CodeRabbit

  • New Features

    • Added an “Anti-abuse bond” section to the Mostro node details card, showing current bond status and configuration (applicability, amount/percent, slash-on-timeout, node share, and claim window).
    • The section is shown only when supported, and the info icon opens a concept explanation dialog.
    • Missing values are displayed using localized “not available” placeholders.
  • Documentation

    • Added/extended localization strings for German, English, Spanish, French, and Italian for the anti-abuse bond UI.

  - Add an Anti-abuse bond section to the About screen, parsed from the kind-38385 info event
  - Hide it on legacy nodes, show status only when disabled, full parameters when enabled
  - Add localized labels, per-row help dialogs and a concept explanation in en/es/it/de/fr
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f154e8e-97b1-4483-8630-2614d826a2d2

📥 Commits

Reviewing files that changed from the base of the PR and between f60c70f and f76fee7.

📒 Files selected for processing (1)
  • lib/features/settings/about_screen.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/features/settings/about_screen.dart

Walkthrough

AboutScreen gains a new conditional "Anti-abuse bond" section inside the Mostro node card. The section is hidden when BondPolicy.unsupported and otherwise displays bond status and, when enabled, the full parameter set (apply-to, amount, slash-on-timeout, node share, claim window). New localization strings covering the feature are added in English, German, Spanish, French, and Italian.

Changes

Anti-abuse bond display in AboutScreen

Layer / File(s) Summary
Anti-abuse bond UI section and helpers
lib/features/settings/about_screen.dart
Calls _buildAntiAbuseBondSection from within the node card between fiat-currencies and technical details. Implements the builder and private helpers for section header (with tappable info icon), apply-to string mapping, bond amount formatting (including min and base amounts), and null-safe percent display, all conditioned on BondPolicy and the enabled flag.
Localization strings (5 languages)
lib/l10n/intl_en.arb, lib/l10n/intl_de.arb, lib/l10n/intl_es.arb, lib/l10n/intl_fr.arb, lib/l10n/intl_it.arb
Adds anti-abuse bond UI keys covering status labels, applicability (taker/maker/both), bond amount with {percent} and minimum-sat placeholders, slash-on-timeout configuration, node share percentage, and an ICU-pluralized claim-window value in each language.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • Anti-Abuse Bond Support #591: This PR directly implements the UI display of anti-abuse bond policy information in the AboutScreen node card with localization, which is the core requirement of that issue.

Possibly related PRs

  • MostroP2P/mobile#601: The conditional rendering based on BondPolicy.unsupported and the bond parameter fields displayed here correspond to the MostroInstance bond tag parsing fields added in that PR.
  • MostroP2P/mobile#204: This PR extends the AboutScreen Mostro node card and its helper pattern established in that earlier refactor.

Suggested reviewers

  • AndreaDiazCorreia
  • grunch

Poem

🐇 Hoppity-hop, a new bond in sight,
The node card now shows if the policy's right.
Em-dash for missing, percent for the rest,
In five tongues translated — the rabbit's impressed!
No abuse shall pass this fluffy decree! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: adding an anti-abuse bond policy section to the about screen by extracting data from the node info event.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 add-bond-info

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 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 `@lib/features/settings/about_screen.dart`:
- Around line 551-565: The bond field rendering logic is coercing null values
into business defaults (false becomes "No", 0 becomes "0 days"), which
misrepresents missing node policy data. In the _buildInfoRowWithDialog calls for
bondSlashOnWaitingTimeout, bondSlashNodeSharePct, and bondPayoutClaimWindowDays,
replace the null coercion operators (?? false, ?? 0) with explicit null checks
that display a localized "not available" fallback string instead. Use
S.of(context) to obtain the localized unavailability message and pass it through
the appropriate formatting methods or directly to _buildInfoRowWithDialog so
that truly missing fields are visually distinguished from zero/false values.
Apply this change at both the anchor location in the diff
(bondSlashOnWaitingTimeout, bondSlashNodeSharePct, bondPayoutClaimWindowDays
fields) and at the sibling location (also applies to 617-638) where similar bond
field rendering occurs.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c4b5e99b-cb1d-4851-98db-095008e13fb6

📥 Commits

Reviewing files that changed from the base of the PR and between 741535d and f60c70f.

📒 Files selected for processing (6)
  • lib/features/settings/about_screen.dart
  • lib/l10n/intl_de.arb
  • lib/l10n/intl_en.arb
  • lib/l10n/intl_es.arb
  • lib/l10n/intl_fr.arb
  • lib/l10n/intl_it.arb

Comment thread lib/features/settings/about_screen.dart Outdated
@Catrya

Catrya commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

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.

@grunch grunch merged commit fe4fe4a into main Jun 16, 2026
2 checks passed
@grunch grunch deleted the add-bond-info branch June 16, 2026 14:08
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