Skip to content

feat(about): implement About screen per v1 spec - #84

Merged
grunch merged 3 commits into
mainfrom
feat/about-screen-v1
Apr 3, 2026
Merged

feat(about): implement About screen per v1 spec#84
grunch merged 3 commits into
mainfrom
feat/about-screen-v1

Conversation

@grunch

@grunch grunch commented Apr 3, 2026

Copy link
Copy Markdown
Member
  • 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)

Summary by CodeRabbit

  • New Features

    • Redesigned About screen with detailed Mostro node info (version, fees, order limits, timing, and Lightning details).
    • Per-field info dialogs, copy-to-clipboard actions, and retry/loading states for node data.
    • Embedded MIT license dialog.
  • Improvements

    • App now shows build commit and richer documentation links (copyable).
  • Localization

    • Added comprehensive About-screen translations and a generic "Copy" label across languages.

grunch added 2 commits April 3, 2026 10:44
- 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
@coderabbitai

coderabbitai Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ca8f7710-c343-4bdc-8bd7-b03a3873238c

📥 Commits

Reviewing files that changed from the base of the PR and between 70e5d5a and 80fb95f.

📒 Files selected for processing (5)
  • lib/features/about/providers/mostro_node_provider.dart
  • lib/features/about/screens/about_screen.dart
  • lib/l10n/app_it.arb
  • lib/l10n/app_localizations_it.dart
  • rust/src/api/nostr.rs

Walkthrough

Adds dynamic Mostro node support to About: new immutable MostroInstance Dart model with tag parsing, a mostroNodeProvider that fetches instance tags via a new Rust FFI API, a refactored localized About screen showing detailed node/LND fields, and corresponding localization entries and FFI/FRB updates.

Changes

Cohort / File(s) Summary
Mostro model & provider
lib/features/about/models/mostro_instance.dart, lib/features/about/providers/mostro_node_provider.dart
New immutable MostroInstance with fromTags() factory and feePercent getter; new mostroNodeProvider (autoDispose FutureProvider) calls Rust FFI to fetch tags and returns parsed model.
About screen UI
lib/features/about/screens/about_screen.dart
Major UI refactor to use localized strings, new card/row widgets, git commit display, MIT license dialog, multiple documentation link rows (copy-to-clipboard + SnackBar), and detailed Mostro/LND node info with loading/error/retry and per-field info dialogs.
Localization resources
lib/l10n/app_*.arb, lib/l10n/app_localizations.dart, lib/l10n/app_localizations_*.dart
Added copyButtonLabel and ~70+ about* localization keys across EN/DE/ES/FR/IT ARB files and corresponding Dart getters/overrides in localization classes.
Rust Nostr API
rust/src/api/nostr.rs
Added fetch_mostro_instance_tags(mostro_pubkey_hex: String) async function: queries relay pool for Kind 38385 events authored by the pubkey, applies a 10s timeout, and returns event tags as Vec<Vec<String>> or None.
FFI / FRB generated
rust/src/frb_generated.rs
Updated FRB content hash; added wire handler for fetch_mostro_instance_tags, added handlers for other new wire calls, SSE encode/decode impls for Vec<Vec<String>> and Option<Vec<Vec<String>>>, and renumbered dispatcher function IDs.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 Hopping through tags with a twitch of my nose,
I fetch pubkeys, fees, and commit-hash prose.
Rust digs the relays, Dart stitches the strands,
About gleams with Mostro info in neat little bands.
Copy, peek, and retry — hooray for tiny commands!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 32.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: implementing an About screen feature according to v1 specification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/about-screen-v1

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8db2fa9 and 70e5d5a.

📒 Files selected for processing (16)
  • lib/features/about/models/mostro_instance.dart
  • lib/features/about/providers/mostro_node_provider.dart
  • lib/features/about/screens/about_screen.dart
  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_localizations.dart
  • lib/l10n/app_localizations_de.dart
  • lib/l10n/app_localizations_en.dart
  • lib/l10n/app_localizations_es.dart
  • lib/l10n/app_localizations_fr.dart
  • lib/l10n/app_localizations_it.dart
  • rust/src/api/nostr.rs
  • rust/src/frb_generated.rs

Comment thread lib/features/about/providers/mostro_node_provider.dart
Comment thread lib/features/about/screens/about_screen.dart
Comment thread lib/features/about/screens/about_screen.dart
Comment thread lib/l10n/app_it.arb Outdated
Comment thread rust/src/api/nostr.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
@grunch
grunch merged commit 28ac82c into main Apr 3, 2026
1 check was pending
@grunch
grunch deleted the feat/about-screen-v1 branch April 3, 2026 14:19
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.

1 participant