Skip to content

Conversation

@BraCR10
Copy link
Member

@BraCR10 BraCR10 commented Jan 24, 2026

Phase 6: Recording Indicator Widget

This PR adds a floating recording indicator that shows when logging is active.

What's Included

Recording Indicator:

  • Pulsing red dot in bottom-left corner when logging enabled
  • Tap to navigate to logs screen
  • Auto-hides on logs screen and when drawer is open
  • Adaptive positioning: 90px on screens with bottom nav, 16px on others
  • Smooth transitions between positions

Note: This implementation is fully open to feedback. If you think the position, color, size, or animation should be different, please let me know and I'll adjust it accordingly.

Testing

Navigate to: Settings → Dev Tools → Logs Report

  1. Enable logging - verify red dot appears
  2. Navigate between screens - verify smooth position changes
  3. Tap indicator - verify navigation to logs
  4. Open drawer - verify indicator lowers

See docs/LOGGING_IMPLEMENTATION.md for details.

Summary by CodeRabbit

  • New Features

    • Recording indicator appears when logging is enabled
    • Pulsing circular indicator shown in bottom-left area
    • Tap indicator to navigate to the logs screen
    • Indicator auto-adjusts position for drawer and navigation layouts
    • Hidden when logging is disabled or when viewing the logs screen
  • Documentation

    • Implementation docs updated; Version 7 — Phase 6 (Completed), updated 2026-01-21

✏️ Tip: You can customize this high-level summary in your review settings.

Implements a floating widget that indicates when logging is enabled.
This widget navigates the user to the logs screen on tap.
The indicator is only visible when logging is enabled and not on the logs screen.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

Walkthrough

Adds a global LogsRecordingIndicator widget rendered across routes (except /logs) that shows a pulsing recording dot when logging is enabled, navigates to /logs on tap, and updates documentation to mark Phase 6 completed (version bump and feature bullets).

Changes

Cohort / File(s) Summary
Documentation Update
docs/LOGGING_IMPLEMENTATION.md
Updated Phase 6 header to "(Completed)"; added bullets for recording indicator, tap-to-navigate, visibility only when logging enabled, lifecycle management; bumped Version 6→7 and updated timestamp.
Route Integration
lib/core/app_routes.dart
Imported and injected LogsRecordingIndicator into the ShellRoute builder by wrapping route child in a Stack to overlay the indicator on all routes.
New Recording Indicator Widget
lib/features/logs/widgets/logs_recording_indicator.dart
Added LogsRecordingIndicator (ConsumerStatefulWidget) with pulsing animation; consults settings provider for logging state; skips rendering on /logs; computes position based on drawer and bottom-nav state; navigates to /logs on tap.

Sequence Diagram(s)

sequenceDiagram
    participant App as App Routing
    participant Indicator as LogsRecordingIndicator
    participant Settings as Settings Provider
    participant Drawer as Drawer Provider
    participant Logs as Logs Screen

    App->>Indicator: instantiate on route render
    Indicator->>Settings: query isLoggingEnabled
    alt logging disabled
        Indicator->>App: render nothing
    else logging enabled
        Indicator->>Drawer: query drawer/bottom-nav state
        Drawer-->>Indicator: state
        Indicator->>Indicator: compute position & start animation
        Indicator->>App: render pulsing indicator (overlay)
        App->>Indicator: user taps indicator
        Indicator->>Logs: navigate to /logs
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Catrya
  • grunch
  • AndreaDiazCorreia

Poem

🐰 A tiny red dot begins to glow,
It hums, it pulses, soft and low.
Tap my paw, I'll lead the logs,
Through stacks and drawers and tiny frogs—
Hop on over, watch it go!

🚥 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 'Feat: Logs recording indicator' clearly summarizes the main change - adding a new floating recording indicator widget for when logging is active.
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.


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@lib/features/logs/widgets/logs_recording_indicator.dart`:
- Around line 60-66: The indicator is only being moved when the drawer opens
instead of being hidden and the non-bottom-nav base offset is 10px instead of
16px; update the widget that uses isDrawerOpen (from drawerProvider) and
currentRoute/hasBottomNavBar so that if isDrawerOpen is true the
LogsRecordingIndicator does not render at all (e.g., return an empty widget)
rather than just changing bottomOffset, and change the fallback base offset from
10.0 to 16.0 so bottomOffset is computed as isDrawerOpen ? (hide) :
(hasBottomNavBar ? 90.0 : 16.0); apply this change around the bottomOffset
calculation and the parent build method that renders the indicator (refer to
isDrawerOpen, drawerProvider, currentRoute, hasBottomNavBar, bottomOffset, and
the LogsRecordingIndicator build logic).
🧹 Nitpick comments (1)
lib/features/logs/widgets/logs_recording_indicator.dart (1)

25-35: Pause the pulse animation when the indicator is hidden.
The controller repeats even when the widget returns SizedBox.shrink(), so the ticker keeps running while logging is disabled or on /logs. Consider starting/stopping the animation based on logging state to avoid unnecessary ticks.

Comment on lines 60 to 66
final isDrawerOpen = ref.watch(drawerProvider);
final hasBottomNavBar = currentRoute == '/' ||
currentRoute == '/order_book' ||
currentRoute == '/chat_list';

final bottomOffset = isDrawerOpen ? 10.0 : (hasBottomNavBar ? 90.0 : 10.0);

Copy link
Contributor

@coderabbitai coderabbitai bot Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, check if the file exists and read the relevant section
if [ -f "lib/features/logs/widgets/logs_recording_indicator.dart" ]; then
  echo "=== File exists ===" 
  wc -l "lib/features/logs/widgets/logs_recording_indicator.dart"
  echo -e "\n=== Lines 50-75 ===" 
  sed -n '50,75p' "lib/features/logs/widgets/logs_recording_indicator.dart"
else
  echo "File not found"
fi

Repository: MostroP2P/mobile

Length of output: 988


🏁 Script executed:

# Search for drawerProvider and other offset references in the codebase
echo "=== Searching for drawerProvider ===" 
rg "drawerProvider" -A 2 -B 2

echo -e "\n=== Searching for offset patterns in logs_recording_indicator ===" 
rg "bottomOffset" lib/features/logs/widgets/logs_recording_indicator.dart -B 3 -A 3

echo -e "\n=== Searching for spec or PR objectives in comments ===" 
rg "spec|objective|16px|drawer.*hide" lib/features/logs/widgets/logs_recording_indicator.dart -i

Repository: MostroP2P/mobile

Length of output: 3786


🏁 Script executed:

# Check the full implementation of the widget to understand the context
if [ -f "lib/features/logs/widgets/logs_recording_indicator.dart" ]; then
  echo "=== Full file content ===" 
  cat -n "lib/features/logs/widgets/logs_recording_indicator.dart"
fi

Repository: MostroP2P/mobile

Length of output: 4667


Hide the indicator when the drawer is open and adjust the base offset to 16px.

The indicator should be hidden (not just offset) when the drawer opens. Additionally, the base offset for non-bottom-nav screens should be 16px instead of 10px to match the specification.

🔧 Suggested adjustment
    final isDrawerOpen = ref.watch(drawerProvider);
+   if (isDrawerOpen) {
+     return const SizedBox.shrink();
+   }
    final hasBottomNavBar = currentRoute == '/' ||
        currentRoute == '/order_book' ||
        currentRoute == '/chat_list';

-   final bottomOffset = isDrawerOpen ? 10.0 : (hasBottomNavBar ? 90.0 : 10.0);
+   final bottomOffset = hasBottomNavBar ? 90.0 : 16.0;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
final isDrawerOpen = ref.watch(drawerProvider);
final hasBottomNavBar = currentRoute == '/' ||
currentRoute == '/order_book' ||
currentRoute == '/chat_list';
final bottomOffset = isDrawerOpen ? 10.0 : (hasBottomNavBar ? 90.0 : 10.0);
final isDrawerOpen = ref.watch(drawerProvider);
if (isDrawerOpen) {
return const SizedBox.shrink();
}
final hasBottomNavBar = currentRoute == '/' ||
currentRoute == '/order_book' ||
currentRoute == '/chat_list';
final bottomOffset = hasBottomNavBar ? 90.0 : 16.0;
🤖 Prompt for AI Agents
In `@lib/features/logs/widgets/logs_recording_indicator.dart` around lines 60 -
66, The indicator is only being moved when the drawer opens instead of being
hidden and the non-bottom-nav base offset is 10px instead of 16px; update the
widget that uses isDrawerOpen (from drawerProvider) and
currentRoute/hasBottomNavBar so that if isDrawerOpen is true the
LogsRecordingIndicator does not render at all (e.g., return an empty widget)
rather than just changing bottomOffset, and change the fallback base offset from
10.0 to 16.0 so bottomOffset is computed as isDrawerOpen ? (hide) :
(hasBottomNavBar ? 90.0 : 16.0); apply this change around the bottomOffset
calculation and the parent build method that renders the indicator (refer to
isDrawerOpen, drawerProvider, currentRoute, hasBottomNavBar, bottomOffset, and
the LogsRecordingIndicator build logic).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep logs indicator when drawer is open. However, I going to change the fallback offset to 16

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BraCR10, sounds good! I understand you prefer to keep the indicator visible when the drawer is open. Changing the fallback offset to 16px will align it with the spec for non-bottom-nav screens. 👍


🧠 Learnings used
Learnt from: CR
Repo: MostroP2P/mobile PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T12:10:12.082Z
Learning: Applies to **/*.dart : Use Riverpod for all state management - encapsulate business logic in Notifiers and access data only through repository classes

Learnt from: Catrya
Repo: MostroP2P/mobile PR: 272
File: lib/features/relays/widgets/relay_selector.dart:13-15
Timestamp: 2025-08-21T14:45:43.974Z
Learning: In the Mostro mobile app's RelaySelector widget (lib/features/relays/widgets/relay_selector.dart), watching relaysProvider.notifier correctly triggers rebuilds because the relaysProvider itself depends on settingsProvider (line 8 in relays_provider.dart). When blacklist changes via toggleMostroRelayBlacklist(), the settingsProvider updates, causing relaysProvider to rebuild, which then notifies widgets watching the notifier. The UI correctly reflects active/inactive states in real-time through this dependency chain.

Updates the bottom offset of the logs recording indicator to ensure consistent spacing across different UI elements.
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.

2 participants