Skip to content

Add dark/light theme - #4

Merged
grunch merged 4 commits into
mainfrom
001-mostro-p2p-client
Mar 23, 2026
Merged

Add dark/light theme#4
grunch merged 4 commits into
mainfrom
001-mostro-p2p-client

Conversation

@grunch

@grunch grunch commented Mar 23, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation
    • Added comprehensive theme support: system-default dark/light, user override, semantic color tokens, persisted preference, and smooth no-flash transitions with WCAG AA contrast guidance
    • Expanded protocol and requirements: detailed order state behaviors, encryption/encrypted-chat persistence, diagnostic logging and range orders, identity/privacy clarifications, protocol versioning and action catalog
    • Enhanced edge-case, acceptance criteria, and checklist clarifications

@coderabbitai

coderabbitai Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@grunch has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cee6e086-3f3b-4e33-8ef7-f4a60f1a2030

📥 Commits

Reviewing files that changed from the base of the PR and between 81ccca0 and 9a77a17.

📒 Files selected for processing (2)
  • specs/001-mostro-p2p-client/checklists/requirements.md
  • specs/001-mostro-p2p-client/spec.md

Walkthrough

Adds dark/light Theme Support to the design system and expands the Mostro P2P client specification and validation checklists with protocol enrichment, order-state machine details, encryption layering, chat persistence, theme behavior requirements, and refined entity definitions.

Changes

Cohort / File(s) Summary
Design System Theme Documentation
.specify/DESIGN_SYSTEM.md
Introduces "11. Theme Support": system/default theme detection, user override persistence, semantic color token table with explicit dark/light hex values, guidance to use ThemeData/ColorScheme, Riverpod ThemeProvider, and avoid hardcoded colors. Removed prior Spanish instructions.
Specification: Protocol & Entities
specs/001-mostro-p2p-client/spec.md
Expanded protocol reference with Mostro order state machine (14 states including paymentFailed), supported protocol actions, NIP-59 three-layer encryption, protocol version negotiation, updated user stories, acceptance criteria, edge cases, and new Theme Preference entity.
Validation & Requirements
specs/001-mostro-p2p-client/checklists/requirements.md
Updated requirement checklist: clarified parity items, added Diagnostic Logging and Range Orders, added Protocol Enrichment Check and Dark/Light Theme Check (WCAG AA, system/default behavior, persistence, smooth transitions), and updated notes/clarifications.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through specs by lantern light,
Themes now dance in dark and bright,
Orders, states, and encrypted threads,
Checklist blooms where logic treads,
A little rabbit cheers the night! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Add dark/light theme' accurately reflects the main change: comprehensive dark/light theme support documentation and specification across design system, requirements checklist, and spec files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 001-mostro-p2p-client

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@specs/001-mostro-p2p-client/spec.md`:
- Around line 22-29: The spec uses two different admin-cancel state names
("canceledByAdmin" and "admin-canceled") and omits them in FR-043, causing
ambiguity; standardize the canonical name across the document (choose one, e.g.,
"canceledByAdmin"), update every occurrence (including the state machine listing
around pending→... and the references at lines ~310 and ~367), and update FR-043
to reference the chosen canonical state name so UI labels, acceptance tests, and
state-handling logic all use the same identifier.
- Around line 21-29: The two fenced code blocks in
specs/001-mostro-p2p-client/spec.md (the block containing the state diagram
"pending → waitingBuyerInvoice → ..." around lines 21–29 and the block with the
layer descriptions "Layer 1: Rumor ..." around lines 46–52) are missing language
identifiers and trigger MD040; update each opening triple-fence to include a
language identifier such as text (e.g., add the identifier text after the
opening fence) so both fenced blocks include a language and satisfy the markdown
linter.
- Around line 186-190: The acceptance-scenario numbering is duplicated: both the
"Given a user in preferences, When they change the language..." and "Given a
user in wallet settings, When they paste a NWC URI..." lines are numbered "6.";
update the ordered list so numbering is unique and sequential (change the
wallet-settings NWC URI scenario from "6." to "7." and the following "Given a
user has connected relays..." scenario from "7." to "8."), editing the lines
containing those exact scenario texts in spec.md to maintain unambiguous
references.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27284932-f4cc-4b6f-a516-3c3ed6a0c475

📥 Commits

Reviewing files that changed from the base of the PR and between 273b6c4 and 9767c2f.

📒 Files selected for processing (3)
  • .specify/DESIGN_SYSTEM.md
  • specs/001-mostro-p2p-client/checklists/requirements.md
  • specs/001-mostro-p2p-client/spec.md

Comment thread specs/001-mostro-p2p-client/spec.md Outdated
Comment thread specs/001-mostro-p2p-client/spec.md
Comment thread specs/001-mostro-p2p-client/spec.md Outdated
grunch added 2 commits March 23, 2026 08:40
- Add Mostro Protocol Reference section (15-state machine, NIP-59 layers,
  action catalog, versioning)
- Expand FR-019 into full dark/light theme requirements (FR-019a-f)
- Add FR-043-051 (order states, privacy modes, encrypted chat storage,
  NWC reconnect, Blossom fallback, paymentFailed, silent notifications,
  diagnostic logging)
- Enrich key entities (Identity, Order, Message, Relay, NWC Wallet)
- Add architectural constraints to Assumptions (Rust core, NIP-59, key path)
- Add 5 new edge cases and 4 new success criteria (SC-019-022)
- Resolve 4 clarifications: admin scope, privacy mode toggle, range orders,
  diagnostics logging
- Standardize canceledByAdmin across all references (was admin-canceled)
- Add language identifiers to fenced code blocks
- Fix duplicate scenario numbering in US7

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@specs/001-mostro-p2p-client/checklists/requirements.md`:
- Line 51: Update the checklist line that currently reads "Full 14-state order
machine documented — Protocol Reference section, FR-043, Order entity" to say
"Full 15-state order machine documented — Protocol Reference section, FR-043,
Order entity" so it matches the Order State Machine defined in
specs/001-mostro-p2p-client/spec.md and FR-043; verify the wording exactly
references "Order State Machine" / "FR-043" to avoid future mismatch.
- Line 80: The summary line "13 user stories, 51 functional requirements, 22
success criteria, 16 edge cases." is incorrect because spec.md actually lists 15
edge cases; either update that line in requirements.md to read "15 edge cases"
or add the missing edge case entry into spec.md so the counts match; locate the
exact string "13 user stories, 51 functional requirements, 22 success criteria,
16 edge cases." in requirements.md and change the number or add the missing
edge-case item in spec.md so both documents are consistent.
- Line 57: The checklist entry "- [x] Rust core + flutter_rust_bridge
architecture — Assumptions section" is an implementation-detail and conflicts
with the "No implementation details" rule; either remove or reword this item to
a higher-level criterion (e.g., "Cross-language architecture documented" or
"Interop approach justified") or move the exact item into a technical-design
checklist; update the requirements.md checklist so the item no longer asserts a
specific implementation (or explicitly relax the rule by adding a clear
exception note) and ensure the checklist header or a nearby comment explains
which approach was taken.

In `@specs/001-mostro-p2p-client/spec.md`:
- Around line 426-428: Remove the stack-specific implementation sentences that
hard-code "v2 uses a Rust core layer bridged to the Flutter UI via
flutter_rust_bridge" and the accompanying "This is an architectural
constraint..." wording from the spec; move those details into an ADR/technical
design doc and replace them with a short non-technical reference like
"Implementation details (e.g., language/runtime, bridging) are documented in the
ADR." Keep protocol-level requirements that belong in the product spec (e.g.,
"NIP-59 three-layer encryption model (Rumor inside Seal inside Gift Wrap)" and
the key derivation requirement "m/44'/1237'/38383'/0/N") but ensure they are
phrased as product constraints, not implementation choices, and add a pointer to
the ADR for architecture and stack decisions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d8dd095c-3058-4c14-8f8c-b91d8a6b08b4

📥 Commits

Reviewing files that changed from the base of the PR and between 9767c2f and 81ccca0.

📒 Files selected for processing (2)
  • specs/001-mostro-p2p-client/checklists/requirements.md
  • specs/001-mostro-p2p-client/spec.md

Comment thread specs/001-mostro-p2p-client/checklists/requirements.md Outdated
Comment thread specs/001-mostro-p2p-client/checklists/requirements.md Outdated
Comment thread specs/001-mostro-p2p-client/checklists/requirements.md Outdated
Comment thread specs/001-mostro-p2p-client/spec.md Outdated
- Update order state count from 14 to 15 (canceledByAdmin was missing)
- Fix edge case count from 16 to 15 in checklist (matches spec)
- Replace stack-specific Rust/Flutter/flutter_rust_bridge references in
  spec Assumptions with technology-agnostic core/UI layer constraint
- Reword checklist architecture entry to remove implementation details
- Defer stack decisions to ADR
@grunch
grunch merged commit b77ff3b into main Mar 23, 2026
1 check passed
@grunch
grunch deleted the 001-mostro-p2p-client branch March 23, 2026 11:48
grunch added a commit that referenced this pull request Apr 2, 2026
  orders.rs — Fix #7: store_trade_key_index before publish
  Moved store_trade_key_index(&order_id, trade_index) from before the action dispatch to inside the publish-success else branch. A publish failure no longer leaves a stale key mapping.

  orders.rs — Fix #5: ln_address logged in plain text
  Replaced ln_address={:?} (which printed the actual address) with ln_address=present/none using if ln_address_ref.is_some().

  orders.rs — Fix #4: fixed 30-min deadline regardless of activity
  Replaced the fixed deadline with a last_activity instant that resets on each matching event. The idle timeout is now 30 minutes of inactivity, not 30 minutes of total uptime.

  add_lightning_invoice_screen.dart — Fix #2: Lightning Address sent with 1-sat amount
  _isValid now returns false for @ inputs when _resolvedSats is null. _submit also guards against it and surfaces an error instead of falling through to BigInt.one.

  trade_detail_screen.dart — Fix #3: OrderStatus.pending mapped to TradeStatus.active
  Added TradeStatus.loading to the enum and made it the default branch in _mapOrderStatus. Unresolved/initial statuses no longer match the active-trade action button sections.
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