docs: HOME & NAVIGATION specs - #20
Conversation
…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.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 @.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
📒 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
| ```dart | ||
| RefreshIndicator( | ||
| onRefresh: () async { | ||
| return await ref.refresh(filteredOrdersProvider); | ||
| }, | ||
| child: /* list or empty state */, | ||
| ) | ||
| ``` |
There was a problem hiding this comment.
🧩 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 -20Repository: 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 -30Repository: MostroP2P/app
Length of output: 205
🏁 Script executed:
# Search for RefreshIndicator usage in the codebase
rg "RefreshIndicator" --type dart -B3 -A8 | head -50Repository: 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 -20Repository: MostroP2P/app
Length of output: 39
🏁 Script executed:
# Check if there are any Dart files at all
find . -name "*.dart" -type f | head -10Repository: MostroP2P/app
Length of output: 39
🏁 Script executed:
# Check HOME_SCREEN.md file size and content
wc -l ./.specify/v1-reference/HOME_SCREEN.mdRepository: 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.mdRepository: 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.mdRepository: 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 -80Repository: 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:
- 1: https://pub.dev/documentation/riverpod/latest/riverpod/Ref/refresh.html
- 2: https://stackoverflow.com/questions/75550188/riverpod-ref-refresh-the-value-of-refresh-should-be-used
- 3: https://riverpod.dev/docs/how_to/pull_to_refresh
- 4: https://riverpod.dev/docs/concepts2/refs
- 5: https://riverpod.dev/docs/essentials/faq
- 6: https://pub.dev/documentation/riverpod/latest/riverpod/Ref-class.html
🏁 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 -10Repository: MostroP2P/app
Length of output: 95
🏁 Script executed:
# Check if there's actual Dart code implementation anywhere
find . -name "*.dart" -type f | head -20Repository: 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
returnstatement: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.
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)
Specs for Home Screen, Navigation, Order Book, and Drawer Menu
4 nuevos specs basados en análisis profundo del código v1:
Nuevos archivos
mostro:, guards de firstRun, navegación programática (NavigationNotifier), BottomNav, transiciones fade de 150ms.Actualizaciones
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