feat(about): implement About screen per v1 spec - #84
Conversation
- Add `fetch_mostro_instance_tags` Rust API to query Kind 38385 (Mostro
instance status) events from the connected relay pool; regenerate bridge
- Add `MostroInstance` model parsing Kind 38385 tags into typed fields
- Add `mostroNodeProvider` FutureProvider (autoDispose) that fetches and
parses the node info on demand
- Rewrite AboutScreen with three cards per spec:
1. App Information — version, GitHub link, commit hash, MIT license dialog
2. Documentation — three external links (en/es/technical) with copy snackbar
3. Mostro Node — live Kind 38385 data with loading/error/retry states,
General Info / Technical Details / Lightning Network sections,
ℹ️ explanation dialogs, 📋 copy-to-clipboard for pubkeys
- Add 70+ l10n keys for all labels and info-dialog explanations (en + 4 langs)
- Extract _showInfoDialog as a top-level helper, removing duplicated _showInfo methods in _NodeInfoRowInfo and _NodeInfoRowCopyable - Replace hardcoded 'OK' button with l10n.closeButtonLabel - Replace hardcoded 'Copy'/'Link copied to clipboard' in _InfoRowLink with l10n.copyButtonLabel and l10n.linkCopiedToClipboard - Fix _copy to use l10n.aboutCopiedToClipboard and call hideCurrentSnackBar() before showing a new SnackBar - Add copyButtonLabel l10n key to all 5 locale files - Spell out unit suffixes consistently: "sec" → "seconds" in EN ARB - Expand abbreviated labels: "Hold Invoice Exp." → "Hold Invoice Expiration", "Invoice Exp. Window" → "Invoice Expiration Window" - Add full translations for all About screen strings in es/de/fr/it
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughAdds dynamic Mostro node support to About: new immutable Changes
Sequence DiagramsequenceDiagram
participant About as About Screen
participant Provider as mostroNodeProvider
participant DartFFI as Dart FFI layer
participant Rust as Rust nostr.rs
participant Relay as Nostr Relay
About->>Provider: watch provider
Provider->>DartFFI: call fetch_mostro_instance_tags(pubkey)
DartFFI->>Rust: invoke FFI wire function
Rust->>Relay: query Kind 38385 events (filter by pubkey + tag)
Relay-->>Rust: return event(s) with tags
Rust->>Rust: extract tags -> Vec<Vec<String>>
Rust-->>DartFFI: return tags
DartFFI-->>Provider: deliver decoded tags
Provider->>Provider: MostroInstance.fromTags(tags)
Provider-->>About: emit MostroInstance
About->>About: render node and LND details
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/features/about/providers/mostro_node_provider.dart`:
- Around line 15-21: mostroNodeProvider currently always uses
defaultMostroPubkey so the About screen doesn't reflect the user-selected node;
update the provider to read the active pubkey from mostroPubkeyProvider (use
ref.watch or ref.read inside the FutureProvider.autoDispose) and pass that value
into nostr_api.fetchMostroInstanceTags instead of defaultMostroPubkey, falling
back to defaultMostroPubkey only if the watched value is null/empty, then
continue to return MostroInstance.fromTags(tags) as before.
In `@lib/features/about/screens/about_screen.dart`:
- Around line 742-757: The Row containing Text(label) and the trailing info Icon
(wrapped by GestureDetector that calls _showInfoDialog) can overflow on narrow
devices; wrap the label Text in an Expanded or Flexible so it takes remaining
space and truncates instead of forcing overflow, and keep the SizedBox and
GestureDetector/Icon as a trailing non-flexible group (e.g., put them inside a
small Row after the Expanded); apply the same change to the other identical Row
instance referenced (around the second occurrence).
- Around line 617-638: The SnackBar flow in _openLink leaves previous URL
SnackBars queued; before showing the initial URL SnackBar call
messenger.hideCurrentSnackBar() to clear any active/stale SnackBars, then show
the URL SnackBar, and keep the existing hideCurrentSnackBar() call inside the
SnackBarAction callback (which hides the URL SnackBar before showing the
"copied" SnackBar). Update the _openLink method to call
ScaffoldMessenger.of(context).hideCurrentSnackBar() (or
messenger.hideCurrentSnackBar()) immediately before messenger.showSnackBar(...)
so taps don't queue stale URL SnackBars.
In `@lib/l10n/app_it.arb`:
- Line 289: The localization string with key "aboutOrderLifespanExplanation"
contains a typo: "prendere" is the infinitive verb but should be a noun; update
the Italian translation for that key to use the correct noun (e.g., replace
"prendere" with "prenditore" or "acquirente") so the sentence reads naturally
about a taker/buyer in the order expiration explanation.
In `@rust/src/api/nostr.rs`:
- Around line 183-186: The Filter for Kind::from(38385u16) is under-constrained;
add a d-tag constraint using custom_tag(Alphabet::D, <instance_id>) so the query
matches this Mostro instance's identifier. Locate the Filter construction in
nostr.rs (the block creating `filter` with
`.kind(Kind::from(38385u16)).author(pubkey).limit(1)`) and append a
`.custom_tag(Alphabet::D, <the instance identifier variable used in this
module>)` similar to how `trade_order_filter()` filters orders by Alphabet::D,
ensuring the d-tag value equals this instance's unique identifier. Ensure you
import Alphabet if needed and use the same instance identifier variable already
present in the module.
🪄 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: 50398178-9ab0-425b-9046-f810a4aa3fb2
📒 Files selected for processing (16)
lib/features/about/models/mostro_instance.dartlib/features/about/providers/mostro_node_provider.dartlib/features/about/screens/about_screen.dartlib/l10n/app_de.arblib/l10n/app_en.arblib/l10n/app_es.arblib/l10n/app_fr.arblib/l10n/app_it.arblib/l10n/app_localizations.dartlib/l10n/app_localizations_de.dartlib/l10n/app_localizations_en.dartlib/l10n/app_localizations_es.dartlib/l10n/app_localizations_fr.dartlib/l10n/app_localizations_it.dartrust/src/api/nostr.rsrust/src/frb_generated.rs
- mostroNodeProvider: watch mostroPubkeyProvider instead of hardcoded defaultMostroPubkey so the About screen reflects the user-selected Mostro node, with fallback to default when value is empty - Row overflow: wrap label Text in Expanded with ellipsis overflow in both _NodeInfoRowInfo and _NodeInfoRowCopyable header rows - _openLink: call hideCurrentSnackBar() before showing the URL SnackBar to prevent stale entries from queuing on rapid taps - Rust filter: add d-tag constraint (.custom_tag Alphabet::D, pubkey hex) so fetch_mostro_instance_tags only matches the target instance event - Italian l10n: fix typo "prendere" (verb) → "prenditore" (noun) in aboutOrderLifespanExplanation
fetch_mostro_instance_tagsRust API to query Kind 38385 (Mostroinstance status) events from the connected relay pool; regenerate bridge
MostroInstancemodel parsing Kind 38385 tags into typed fieldsmostroNodeProviderFutureProvider (autoDispose) that fetches andparses the node info on demand
General Info / Technical Details / Lightning Network sections,
ℹ️ explanation dialogs, 📋 copy-to-clipboard for pubkeys
Summary by CodeRabbit
New Features
Improvements
Localization