Skip to content

docs: HOME & NAVIGATION specs - #20

Merged
grunch merged 2 commits into
mainfrom
docs/home-navigation-spec
Mar 24, 2026
Merged

docs: HOME & NAVIGATION specs#20
grunch merged 2 commits into
mainfrom
docs/home-navigation-spec

Conversation

@mostronatorcoder

@mostronatorcoder mostronatorcoder Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Specs for Home Screen, Navigation, Order Book, and Drawer Menu

4 nuevos specs basados en análisis profundo del código v1:

Nuevos archivos

  • HOME_SCREEN.md: Pantalla principal con order book público, tabs Buy/Sell, filtros (moneda, método de pago, reputación, prima), FAB con menú Buy/Sell, pull-to-refresh, empty state. Documenta los 4 providers de filtrado y el flujo completo.
  • NAVIGATION_ROUTES.md: Mapa de las 25 rutas GoRouter, deep links mostro:, guards de firstRun, navegación programática (NavigationNotifier), BottomNav, transiciones fade de 150ms.
  • ORDER_BOOK.md: Order book público vs My Trades — diferencias clave, providers, filtros por estado, empty/loading states. Documenta TradesScreen, TradesListItem, StatusFilterWidget.
  • DRAWER_MENU.md (actualizado): Overlay personalizado 70% width con gesture handling, BottomNavBar con 3 tabs, drawerProvider, relación entre drawer/appBar/bottomNav.

Actualizaciones

  • README.md: Agregados los 4 specs a la tabla de índice con descripción y relevancia V2.
  • ARCHITECTURE.md: Referencias cruzadas a NAVIGATION_ROUTES.md y HOME_SCREEN.md en estructura de directorios.
  • AUTHENTICATION.md: Referencias cruzadas a HOME_SCREEN.md en los flow diagrams.

Todos los specs son documentos puros de código — lo que el código realmente hace, no lo que debería hacer.

Summary by CodeRabbit

Release Notes

  • Documentation
    • Added comprehensive reference guides for app navigation routes, home screen layout, and order book filtering
    • Updated architecture documentation with explicit cross-references to feature specifications
    • Documented drawer menu implementation with custom overlay design and state management
    • Expanded specification index with new feature documentation sections

…RAWER_MENU

New specs:
- HOME_SCREEN.md: Home screen con order book público, tabs buy/sell,
  filtros, FAB, pull-to-refresh, empty state. Providers de filtrado.
- NAVIGATION_ROUTES.md: Mapa completo de 25 rutas GoRouter, deep links
  mostro:, redirects (firstRun), navegación programática, transiciones.
- ORDER_BOOK.md: Order book público vs My Trades, filtros por estado,
  providers, empty/loading states, diferencias clave entre ambas vistas.
- DRAWER_MENU.md: Actualizado con overlay personalizado 70% width,
  BottomNavBar con 3 tabs, drawer provider, gesture handling.
- README.md: Agregados los 4 nuevos specs a la tabla de índice.
- ARCHITECTURE.md: Referencias cruzadas a NAVIGATION_ROUTES.md y HOME_SCREEN.md.
- AUTHENTICATION.md: Referencias cruzadas a HOME_SCREEN.md en flow diagrams.
@grunch

grunch commented Mar 24, 2026

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor
✅ 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.

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ae86bada-f353-48d5-94be-97e57d8ef6c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This pull request updates v1 reference documentation across seven files, adding comprehensive specifications for navigation routes, home screen layout, and order book filtering, while introducing a Riverpod-driven drawer provider for state management. Updates existing architecture and authentication documentation with cross-references to new specs.

Changes

Cohort / File(s) Summary
Navigation & Routing References
/.specify/v1-reference/NAVIGATION_ROUTES.md, .specify/v1-reference/ARCHITECTURE.md, .specify/v1-reference/AUTHENTICATION.md
Added comprehensive routing specification document; updated existing docs with explicit cross-references to NAVIGATION_ROUTES.md and HOME_SCREEN.md in first-run flow diagrams.
Screen Documentation
.specify/v1-reference/HOME_SCREEN.md, .specify/v1-reference/ORDER_BOOK.md
Added new specifications for home screen layout (app bar, tabbed BUY/SELL, order list, FAB), and order book contexts with filtering, status chips, and navigation behavior.
Drawer Implementation & Reference
.specify/v1-reference/DRAWER_MENU.md, lib/shared/providers/drawer_provider.dart
Redesigned drawer from hamburger menu to Stack-based overlay with left-slide animation; introduced drawerProvider StateProvider with toggleDrawer(), closeDrawer(), and openDrawer() extensions; updated menu item navigation to close drawer before routing.
Documentation Index
.specify/v1-reference/README.md
Expanded document index with new "Screens & Navigation" section and updated "Features" section; added v2 relevance guidance for Rust core vs Flutter UI migration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Poem

🐰 Hop through new routes and home screens so bright,
Order books and drawers—specs set just right!
With Riverpod's state, our menu slides smooth,
Navigation maps guide us through every groove!

🚥 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 title clearly and concisely summarizes the main changes: addition of HOME_SCREEN.md and NAVIGATION_ROUTES.md specifications, with supporting documentation updates.
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 docs/home-navigation-spec

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 @.specify/v1-reference/DRAWER_MENU.md:
- Around line 124-130: The extension `DrawerNotifier` is declared on the wrong
type: change its target from StateNotifier<bool> to StateController<bool> so it
matches the notifier returned by `StateProvider<bool>` (drawerProvider); update
the extension declaration `extension DrawerNotifier on StateNotifier<bool>` to
`extension DrawerNotifier on StateController<bool>` while keeping the methods
`toggleDrawer`, `closeDrawer`, and `openDrawer` unchanged.

In @.specify/v1-reference/HOME_SCREEN.md:
- Around line 107-114: The onRefresh callback for RefreshIndicator is returning
the synchronous value from ref.refresh(filteredOrdersProvider) which mismatches
the expected Future<void>; update the callback to call
ref.refresh(filteredOrdersProvider) without returning it (i.e., drop the
`return`) so onRefresh completes as a Future<void>, or if the orders load
asynchronously, change filteredOrdersProvider from Provider<List<Order>> to
FutureProvider<List<Order>> and adapt usages so
ref.refresh(filteredOrdersProvider) returns a Future that can be awaited by
onRefresh. Ensure you update the RefreshIndicator.onRefresh and any dependent
code accordingly.

In @.specify/v1-reference/NAVIGATION_ROUTES.md:
- Around line 28-38: Several fenced code blocks in
.specify/v1-reference/NAVIGATION_ROUTES.md (for example the ASCII tree starting
with "MostroApp", the deep-link examples like
"mostro:order?id={orderId}&relay={relayUrl}..." and the numbered step lists "1.
Sistema operativo envía deep link" and "1. MostroApp initState()") are missing
language identifiers and trigger MD040; update each triple-backtick fence that
wraps those blocks to include a language tag (e.g., ```text) so all code fences
(including the blocks around the URI examples and numbered sequences) explicitly
specify a language. Ensure you modify every fenced block referenced (roughly the
ranges around 28-38, 141-148, 152-184, 345-369) to add the same consistent tag.

In @.specify/v1-reference/ORDER_BOOK.md:
- Around line 57-59: The docs are inconsistent: OrderBookFilter's fields
minAmount/maxAmount are described as fiat amounts but the filter table labels
them "Min-Max sats"; update the documentation to use a single unit
convention—either change the field comments and any references to explicitly say
"sats" (e.g. update minAmount/maxAmount and related table headings to "Min-Max
sats") or change the table heading to "Min-Max fiat" and clarify currency (e.g.
"amount in [currency]"). Make the change consistently for OrderBookFilter, the
minAmount/maxAmount field comments, and the filter table entries (also at the
referenced second occurrence) so all descriptions match the chosen unit.
- Around line 91-101: The fenced visual block showing the seller card (the block
starting with the box characters and containing "SellerNick", "Payment: Bank
Transfer", "SATS: 250,000", and the "Seller status indicator" comment) is
missing a fenced code language tag; change the opening fence from ``` to ```text
(and keep the closing fence) so markdownlint MD040 is satisfied. Ensure the
opening fence immediately precedes the box characters and the closing fence
remains after the final box line.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cddc8873-6bac-4b0a-a400-2327869e4dce

📥 Commits

Reviewing files that changed from the base of the PR and between 6f91fdf and f781a78.

📒 Files selected for processing (7)
  • .specify/v1-reference/ARCHITECTURE.md
  • .specify/v1-reference/AUTHENTICATION.md
  • .specify/v1-reference/DRAWER_MENU.md
  • .specify/v1-reference/HOME_SCREEN.md
  • .specify/v1-reference/NAVIGATION_ROUTES.md
  • .specify/v1-reference/ORDER_BOOK.md
  • .specify/v1-reference/README.md

Comment thread .specify/v1-reference/DRAWER_MENU.md Outdated
Comment on lines +107 to +114
```dart
RefreshIndicator(
onRefresh: () async {
return await ref.refresh(filteredOrdersProvider);
},
child: /* list or empty state */,
)
```

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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Locate relevant files =="
fd home_screen.dart
fd home_order_providers.dart

echo
echo "== Inspect provider declaration(s) =="
rg -n -C4 'final\s+filteredOrdersProvider\s*=|Provider<|FutureProvider<|StreamProvider<' $(fd home_order_providers.dart)

echo
echo "== Inspect RefreshIndicator onRefresh usage =="
rg -n -C6 'RefreshIndicator|onRefresh|ref\.refresh\(filteredOrdersProvider\)' $(fd home_screen.dart)

Repository: MostroP2P/app

Length of output: 123


🏁 Script executed:

# Verify the documentation file exists
find . -name "HOME_SCREEN.md" -o -name "home_screen.md" | head -20

Repository: MostroP2P/app

Length of output: 95


🏁 Script executed:

# Search for any provider definitions related to orders or filtering
rg -i "ordersprovider|filteredordersp|order.*provider" --type dart | head -30

Repository: MostroP2P/app

Length of output: 205


🏁 Script executed:

# Search for RefreshIndicator usage in the codebase
rg "RefreshIndicator" --type dart -B3 -A8 | head -50

Repository: MostroP2P/app

Length of output: 205


🏁 Script executed:

# Get a general idea of the project structure
fd -t d "lib|src|\\.specify" --max-depth 2 | head -20

Repository: MostroP2P/app

Length of output: 39


🏁 Script executed:

# Check if there are any Dart files at all
find . -name "*.dart" -type f | head -10

Repository: MostroP2P/app

Length of output: 39


🏁 Script executed:

# Check HOME_SCREEN.md file size and content
wc -l ./.specify/v1-reference/HOME_SCREEN.md

Repository: MostroP2P/app

Length of output: 99


🏁 Script executed:

# Read the specific lines from HOME_SCREEN.md that are mentioned in the review
sed -n '107,114p' ./.specify/v1-reference/HOME_SCREEN.md

Repository: MostroP2P/app

Length of output: 209


🏁 Script executed:

# Also check context around line 174 mentioned in the scratchpad (provider definition)
sed -n '170,180p' ./.specify/v1-reference/HOME_SCREEN.md

Repository: MostroP2P/app

Length of output: 368


🏁 Script executed:

# Search for any provider or Riverpod references in markdown files
rg "Provider|ref\.refresh|FutureProvider" ./.specify/ -B2 -A2 | head -80

Repository: MostroP2P/app

Length of output: 6222


🌐 Web query:

Riverpod ref.refresh() return type synchronous provider

💡 Result:

The return type of ref.refresh in Riverpod is the state type StateT of the provider being refreshed (Refreshable). It synchronously returns the newly computed value of the provider after forcing a re-evaluation. This applies to synchronous providers like Provider<StateT>, where the computation happens immediately and returns StateT. For example, final newValue = ref.refresh(myProvider); where myProvider is Provider<String>, newValue is String. It is equivalent to ref.invalidate(provider); ref.read(provider); but combines them into one call that returns the value. The @useResult annotation enforces using the returned value, otherwise use invalidate instead. For asynchronous providers like FutureProvider, ref.refresh(provider) returns Future<StateT> synchronously (the future of the new computation), but the query specifies synchronous providers.

Citations:


🏁 Script executed:

# Search for actual onRefresh usage patterns in any codebase files
find . -type f \( -name "*.dart" -o -name "*.md" \) | xargs grep -l "onRefresh" 2>/dev/null | head -10

Repository: MostroP2P/app

Length of output: 95


🏁 Script executed:

# Check if there's actual Dart code implementation anywhere
find . -name "*.dart" -type f | head -20

Repository: MostroP2P/app

Length of output: 39


Remove the return statement or use an async provider.

The filteredOrdersProvider is defined as a synchronous Provider<List<Order>>, so ref.refresh() returns List<Order> directly—not a Future. This creates a type mismatch with RefreshIndicator.onRefresh, which expects Future<void>.

Either:

  • Remove the return statement: ref.refresh(filteredOrdersProvider);
  • Or convert the provider to FutureProvider<List<Order>> if the data fetching should be asynchronous.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.specify/v1-reference/HOME_SCREEN.md around lines 107 - 114, The onRefresh
callback for RefreshIndicator is returning the synchronous value from
ref.refresh(filteredOrdersProvider) which mismatches the expected Future<void>;
update the callback to call ref.refresh(filteredOrdersProvider) without
returning it (i.e., drop the `return`) so onRefresh completes as a Future<void>,
or if the orders load asynchronously, change filteredOrdersProvider from
Provider<List<Order>> to FutureProvider<List<Order>> and adapt usages so
ref.refresh(filteredOrdersProvider) returns a Future that can be awaited by
onRefresh. Ensure you update the RefreshIndicator.onRefresh and any dependent
code accordingly.

Comment thread .specify/v1-reference/NAVIGATION_ROUTES.md Outdated
Comment thread .specify/v1-reference/ORDER_BOOK.md Outdated
Comment thread .specify/v1-reference/ORDER_BOOK.md Outdated
DRAWER_MENU.md:
- Fix drawerProvider: StateProvider<bool> + extension → real StateNotifierProvider<DrawerNotifier, bool>
- Match actual code in lib/shared/providers/drawer_provider.dart

HOME_SCREEN.md:
- Fix RefreshIndicator.onRefresh: drop return (filteredOrdersProvider is synchronous Provider)
- Fix filteredOrdersProvider type: Provider<List<Order>> → Provider<List<NostrEvent>>
- Fix filter providers: orderBookFilterProvider → individual providers (currency, paymentMethod, rating, premium)

NAVIGATION_ROUTES.md:
- Add language identifiers to bare fenced code blocks (MD040)

ORDER_BOOK.md:
- Remove fictitious OrderBookFilter class (does not exist in codebase)
- Replace with real individual filter providers: currencyFilterProvider, paymentMethodFilterProvider, ratingFilterProvider, premiumRangeFilterProvider
- Fix filter table: remove 'Min-Max sats' (no amount range filter) — real filters are currency, payment method, rating, premium
- Add 'text' language tag to OrderListItem visual block (MD040)
- Fix order sorting: created_at desc → expirationDate asc (reversed)
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