Skip to content

feat(blocked-users): complete block/unblock UX#676

Merged
erskingardner merged 19 commits into
masterfrom
feat/block-user-completion
May 21, 2026
Merged

feat(blocked-users): complete block/unblock UX#676
erskingardner merged 19 commits into
masterfrom
feat/block-user-completion

Conversation

@mubarakcoded

@mubarakcoded mubarakcoded commented May 18, 2026

Copy link
Copy Markdown
Contributor

Description

Completes the block/unblock feature with the two missing pieces:

  1. Hide the chat composer when the peer is blocked. The "You blocked this user" banner already rendered in chats; only the input gate was missing.
  2. Settings → Privacy & Security → Blocked users. A list of all blocked accounts, tap a row to open a profile-detail modal with an Unblock action. The detail opens over a blurred list following the existing chat_info_screen pattern (opaque: false + WnOverlay(light)).

Reuses existing hooks (useBlockActions, useBlockedPubkeys, useUserMetadata, useRouteRefresh) and shared widgets (WnSlate, WnOverlay, WnChatInfoProfileCard, WnUserItem). No Rust changes.

Architectural note: BlockedUsersScreen's WnSlate uses a unique Hero tag ('blocked-users-list-slate'). chat_info_screen keeps the chat content visible behind by placing the message list outside its slate; the mock for this feature requires the list inside the slate, so the source-only tag asymmetry is the minimum-deviation way to keep the list visible behind the detail modal.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix
  • ❌ Breaking change
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Tests

How I Tested This

  • Pixel 9 Pro XL (Android, physical device, arm64-v8a): full walkthrough — block a peer in chat → composer hides → Settings → Privacy → View blocked users → tap a row → modal-over-blurred-list renders → tap Unblock → list refreshes via useRouteRefresh on pop.
  • Pixel_9_Pro AVD (Android emulator, x86_64, Android 16): clean install + boot to login splash on a fresh AVD, same process as above.

Test suite: 4489/4489 pass. Coverage 99.40% global, 100% on the two new screens. just precommit green across all 9 gates.

Screenshots

Screenshot_1779140812 Screenshot_1779140819 Screenshot_1779140847

UI changes

  • Settings → Privacy & Security with the new "Blocked users" section
  • Blocked users list
  • Blocked user profile detail (modal over blurred list)
  • Chat with a blocked peer (composer hidden, banner visible)

Checklist

  • just precommit passes
  • CHANGELOG.md updated
  • Screenshots added

Summary by CodeRabbit

  • Documentation

    • Updated changelog noting the blocked-users feature.
  • New Features

    • Added Blocked Users management under Settings → Privacy & Security.
    • View blocked-users list, open blocked-user profiles, and unblock users.
    • Chat composer/input is hidden when a peer is blocked.
  • Localization

    • Added translations for the blocked-users UI across multiple languages.
  • Tests

    • Added widget tests covering blocked-users screens, unblock flows, and related UI states.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a blocked-users management flow: localized strings and changelog entry, routes and navigation helpers, a blocked-users list screen and per-user detail screen with unblock action, Privacy & Security entry, chat input hiding when a peer is blocked, and widget tests covering the new screens and integrations.

Changes

Blocked Users Management Feature

Layer / File(s) Summary
Localization and changelog
CHANGELOG.md, lib/l10n/app_*.arb (11 files)
Added changelog entry and localization keys for blocked-user UI (list title, view action, description, empty state, fetch error, profile detail) across languages.
Routes and navigation setup
lib/routes.dart
Imported blocked-user screens, added route path constants (/blocked-users, /blocked-users/:userPubkey), registered GoRoutes, and added pushToBlockedUsers() / pushToBlockedUser() helpers.
Blocked users list screen
lib/screens/blocked_users_screen.dart, test/screens/blocked_users_screen_test.dart
BlockedUsersScreen fetches/sorts blocked pubkeys, handles loading/error/empty states, and renders _BlockedUserTile with metadata and navigation to detail; tests cover states, list rendering, navigation, and refresh.
Blocked user detail screen
lib/screens/blocked_user_screen.dart, test/screens/blocked_user_screen_test.dart
BlockedUserScreen shows profile with a collapsible blocked notice and an Unblock button that calls block-state toggle (unblock API); on success navigates back, on failure shows error notice; tests cover UI, unblock flows, copy actions, and navigation.
Privacy & Security settings entry point
lib/screens/privacy_security_screen.dart, test/screens/privacy_security_screen_test.dart
Added "Blocked users" subsection with title, description, and a "view blocked users" button that navigates to the list screen; tests added for UI and navigation.
Chat screen blocked-user integration
lib/screens/chat_screen.dart, test/screens/chat_screen_test.dart
Hides _ChatInput and resets input-area height when the peer is blocked; tests assert input hiding and reappearance after unblock.
Routing tests
test/routes_test.dart
Adds route tests for pushToBlockedUsers and pushToBlockedUser, covering authenticated navigation and unauthenticated redirects.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • erskingardner
  • jgmontoya
  • dannym-arx
  • cypherpinkdev
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main objective of the pull request: completing the block/unblock user experience feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 feat/block-user-completion

Comment @coderabbitai help to get the list of available commands and usage tips.

mubarakcoded added a commit that referenced this pull request May 18, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/l10n/app_tr.arb`:
- Line 303: The string "blockedUserProfileTitle" duplicates the existing
"profile" translation; remove the duplicate key from lib/l10n/app_tr.arb (delete
"blockedUserProfileTitle") and update any code/UI references that currently read
blockedUserProfileTitle to use the existing "profile" key (or a shared lookup
function) so the app reuses the single translation entry instead of duplicating
it.

In `@lib/l10n/app_zh_Hant.arb`:
- Line 307: The translation key blockedUserProfileTitle duplicates the existing
profile value ("個人資料"); to avoid duplication, either reuse the existing profile
key where blockedUserProfileTitle is used or remove blockedUserProfileTitle and
update callers to reference profile instead; locate the entries for
blockedUserProfileTitle and profile in the ARB and replace usages of
blockedUserProfileTitle (or change its value to reference profile) so only one
canonical translation is maintained.

In `@lib/l10n/app_zh.arb`:
- Line 307: blockedUserProfileTitle duplicates the existing profile translation;
remove the duplication and update call sites to reuse the existing "profile" key
instead of introducing "blockedUserProfileTitle" so translations are
centralized; locate uses of blockedUserProfileTitle and replace them with
"profile" (or reference "profile" in message lookup) and delete the
blockedUserProfileTitle entry from the ARB to avoid redundant translations.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 065e6eab-db42-4e6e-a2ca-65af2af11570

📥 Commits

Reviewing files that changed from the base of the PR and between 418fca8 and aed35fd.

⛔ Files ignored due to path filters (10)
  • lib/l10n/generated/app_localizations.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_de.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_en.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_es.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_fr.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_it.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_pt.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_ru.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_tr.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_zh.dart is excluded by !**/generated/**, !lib/l10n/generated/**
📒 Files selected for processing (20)
  • CHANGELOG.md
  • 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_pt.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_tr.arb
  • lib/l10n/app_zh.arb
  • lib/l10n/app_zh_Hant.arb
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/screens/chat_screen.dart
  • lib/screens/privacy_security_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test (2/4)
  • GitHub Check: Test (1/4)
  • GitHub Check: Test (3/4)
  • GitHub Check: Test (4/4)
  • GitHub Check: Check
🧰 Additional context used
📓 Path-based instructions (7)
**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

**/*.dart: Use single quotes for strings in Dart/Flutter code
Enable and respect prefer_const_constructors lint rule in Dart/Flutter code
Enable and respect prefer_final_locals lint rule in Dart/Flutter code
Set line width to 100 characters in Dart/Flutter code
Preserve trailing commas in Dart/Flutter code
Maintain minimum test coverage of 99%; never submit a PR that reduces test coverage
Avoid using // coverage:ignore, // coverage:ignore-line, // coverage:ignore-start, or // coverage:ignore-end to bypass coverage requirements; write tests instead (only exception: truly unreachable code)

Files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
**/*.{dart,rs}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add comments except for code that is really complex or hard to understand

Files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
lib/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

lib/**/*.dart: Use flutter_screenutil for all size values (padding, margins, gaps, icon sizes, font sizes, border radius, container dimensions) to ensure responsive layouts. Use .w for width, .h for height, .sp for font size/letter spacing, and .r for radius
Avoid StatefulWidget; prefer providers (for shared app-wide state) or hooks (for widget-local state) instead

Files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
lib/screens/**

⚙️ CodeRabbit configuration file

lib/screens/**: This is a Flutter screen (full-page widget).
Architecture rules:

  • Screens should WATCH Riverpod providers for shared state
  • Use flutter_hooks for ephemeral/local state (NOT StatefulWidget)
  • Pass data to hooks, not refs
  • Use flutter_screenutil (.w, .h, .sp, .r) for all size values
  • Widgets should use const constructors where possible
  • No comments except for truly complex logic
  • When a widget is extracted from a screen and only used in that one
    screen, it should be prefixed with the screen name (e.g.
    ChatListTile for a widget only used in the chat list screen).
    These are screen-scoped widgets and do NOT use the Wn prefix.

Files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
**/*.arb

⚙️ CodeRabbit configuration file

**/*.arb: These are localization files. Check for:

  • Consistent key naming across all locale files
  • Proper ICU message format for plurals/gender
  • No hardcoded strings that should be localized

Files:

  • lib/l10n/app_zh.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_zh_Hant.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_de.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_tr.arb
  • lib/l10n/app_pt.arb
test/**/*_test.dart

📄 CodeRabbit inference engine (AGENTS.md)

test/**/*_test.dart: Test files should mirror source structure with _test.dart suffix
Use helpers from test/test_helpers.dart in tests: setUpTestView(), mountTestApp(), mountHook(), mountWidget(), mountStackedWidget()
Mock Rust API by extending MockWnApi from test/mocks/mock_wn_api.dart instead of implementing RustLibApi directly
Prefer find.byKey() over find.byIcon() in tests; add keys to icons in widgets and use find.byKey(const Key('icon_name')) in tests
Use valid 64-character hex strings for pubkeys in tests, not dummy values like 'abc' or 'test-pubkey'

Files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
test/**

⚙️ CodeRabbit configuration file

test/**: IMPORTANT: CI enforces coverage regression (coverage must never decrease). It does not enforce a fixed 95% minimum threshold.
Rules:

  • Test files mirror source structure with _test.dart suffix
  • Use helpers from test/test_helpers.dart (setUpTestView, mountTestApp, etc.)
  • Mock Rust API using RustLib.initMock(api: mockApi)
  • Always extend MockWnApi from test/mocks/mock_wn_api.dart
  • Prefer find.byKey() over find.byIcon() for widget testing
  • Use valid 64-char hex strings for pubkeys, not dummy values like 'abc'
  • Tests must be deterministic — no external service dependencies

Files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
🧠 Learnings (28)
📚 Learning: 2026-01-05T20:05:32.918Z
Learnt from: untreu2
Repo: marmot-protocol/sloth PR: 22
File: lib/screens/settings_screen.dart:76-88
Timestamp: 2026-01-05T20:05:32.918Z
Learning: In the Sloth project, tooltips should not be used for UI elements. During code reviews, verify that UI components do not include Tooltip widgets and replace them with accessible alternatives (e.g., long-press hints, labels, or interactive guidance). Apply this guidance across Dart UI files under lib (not just settings_screen.dart) to maintain a consistent design approach.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
📚 Learning: 2026-01-09T13:25:18.531Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 33
File: lib/services/message_service.dart:14-26
Timestamp: 2026-01-09T13:25:18.531Z
Learning: When errors are presented to users in the Sloth codebase (UI layers such as snackbars, dialogs, toasts), show friendly, user-facing messages instead of raw Rust error messages. Implement a mapping from internal error types or codes to clear, non-technical messages, and surface actionable guidance for end users where appropriate. Avoid exposing internal stack traces or language runtime details; centralize common user-facing error wording in a dedicated utility or service and translate backend errors into concise, helpful UI messages.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
📚 Learning: 2026-04-06T09:40:41.044Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 552
File: lib/screens/profile_keys_screen.dart:71-71
Timestamp: 2026-04-06T09:40:41.044Z
Learning: In this Flutter/Dart codebase, when using flutter_screenutil (e.g., ScreenUtil or ScreenUtil-based sizing like `w`, `h`), do not require scaled units for literal zero values. Specifically, in EdgeInsets (and similar sizing/padding/margin/gap APIs), bare numeric `0` should be allowed (e.g., `EdgeInsets.all(0)`, `EdgeInsets.symmetric(vertical: 0)`, `SizedBox(width: 0)`), because scaling `0` remains `0`. Only flag ScreenUtil violations when a non-zero literal needs to be expressed via `0.w`/`0.h` equivalents; do not flag bare `0`.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
📚 Learning: 2026-01-06T01:08:41.552Z
Learnt from: untreu2
Repo: marmot-protocol/sloth PR: 22
File: lib/widgets/wn_warning_box.dart:28-79
Timestamp: 2026-01-06T01:08:41.552Z
Learning: In reviews for the marmot-protocol/sloth repository, avoid suggesting accessibility, design, or general improvements unless they are strictly relevant to the PR description and its stated goals. Focus feedback on the specific PR objectives and requirements; ignore unrelated stylistic or broad improvement suggestions.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-15T14:42:54.111Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 39
File: lib/hooks/use_user_search.dart:47-53
Timestamp: 2026-01-15T14:42:54.111Z
Learning: When using npubFromHex(String hexPubkey) from lib/utils/formatting.dart, it already handles errors internally and returns null on failure. Do not wrap calls to this function in try/catch blocks. Instead, check for a null return and handle accordingly (e.g., treat as invalid hex). This guideline applies to all Dart files in the repository that may call this function.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-16T17:35:32.431Z
Learnt from: untreu2
Repo: marmot-protocol/sloth PR: 43
File: lib/hooks/use_network_relays.dart:155-184
Timestamp: 2026-01-16T17:35:32.431Z
Learning: In Dart/Flutter code, prefer void as the return type for fire-and-forget async functions that are intended to run in the background without blocking the caller. Using Future or Future<void> would allow callers to accidentally await, which could block for long periods. This pattern makes the call fire-and-forget by design. Apply to functions that intentionally should not be awaited; document the intent where appropriate. (Example context: pollRelayStatus in lib/hooks/use_network_relays.dart uses void to prevent callers from awaiting a potentially long-running background task.)

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-19T15:50:56.684Z
Learnt from: erskingardner
Repo: marmot-protocol/sloth PR: 52
File: lib/screens/app_settings_screen.dart:30-40
Timestamp: 2026-01-19T15:50:56.684Z
Learning: Target the Flutter SDK version >= 3.27 across the repo. Since features like Column.spacing and Row.spacing were added in Flutter 3.27, you can safely use them in Dart files (e.g., lib/screens/app_settings_screen.dart) as long as the pubspec.yaml environment specifies Flutter >= 3.27. If needed, enforce this by validating the environment constraint (e.g., flutter, sdk: flutter) in pubspec.yaml.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-29T03:02:34.290Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 100
File: lib/widgets/wn_dropdown_selector.dart:126-139
Timestamp: 2026-01-29T03:02:34.290Z
Learning: Global font-family usage guideline: Since Manrope is configured in lib/theme.dart for both light and dark themes, individual TextStyle declarations should not specify fontFamily: 'Manrope'. During reviews, verify that no TextStyle instances override fontFamily unnecessarily; rely on theme inheritance instead. If a TextStyle must specify a font for a specific case, ensure it is clearly justified and localized, and document why the override is needed. This guideline applies across Dart files in the project (e.g., lib/widgets/wn_dropdown_selector.dart and related components).

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-29T16:02:52.588Z
Learnt from: erskingardner
Repo: marmot-protocol/sloth PR: 129
File: test/widgets/wn_overlay_test.dart:84-91
Timestamp: 2026-01-29T16:02:52.588Z
Learning: In Dart/Flutter code, when constructing widgets inside an already-const context (for example, within a const Scaffold with a child that is a collection of widgets), avoid adding explicit const keywords to the children. The Dart analyzer treats these as implicitly const, and adding explicit const can trigger the unnecessary_const lint. Review test files and general Dart files to ensure you do not redundantly prefix children with const in const contexts; rely on the implicit const behavior instead.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-02-07T03:58:22.587Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 193
File: lib/services/android_signer_service.dart:13-13
Timestamp: 2026-02-07T03:58:22.587Z
Learning: In Dart files across the repository, retain NIP (Nostr Implementation Possibilities) and MIP (Marmot Implementation Possibilities) protocol reference comments that link code to their specifications. While general guidance discourages extraneous comments, these references improve traceability and maintainability by documenting the protocol context for related implementation details. Keep them in Dart sources (e.g., lib/services/android_signer_service.dart) and ensure they are kept up-to-date.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-02-11T17:29:43.985Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 225
File: lib/screens/app_settings_screen.dart:64-69
Timestamp: 2026-02-11T17:29:43.985Z
Learning: In the whitenoise Flutter app, after deleting all data and resetting auth, use Routes.goToHome(context) instead of Routes.goToLogin(context) because the home screen is the app entry point and will manage authentication routing. Apply this change to navigation calls that should land on the home screen after a data reset or auth reset. Update lib/screens/app_settings_screen.dart and any similar navigation points accordingly.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-02-18T18:36:13.394Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 315
File: lib/screens/edit_group_screen.dart:45-47
Timestamp: 2026-02-18T18:36:13.394Z
Learning: Whitenoise uses automated code formatting through the precommit workflow (just precommit). Do not tweak line wrapping or formatting manually; follow the formatter's output. Run the precommit formatter locally and ensure the code matches its styling decisions, and only deviate if the formatter cannot express the intended style (in which case adjust the code to satisfy the formatter).

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-04-06T09:36:06.726Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 553
File: lib/widgets/wn_copyable_field.dart:38-40
Timestamp: 2026-04-06T09:36:06.726Z
Learning: In Dart, `String.operator*` is a valid built-in operator for repeating strings (e.g., `'⬤' * 16`). In code reviews of Dart (`.dart`) files, do not treat expressions like `'text' * n` as invalid syntax and do not recommend replacing them with alternatives such as `List.filled(...).join()`; the operator is supported by `dart:core`.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-05-13T13:46:32.612Z
Learnt from: dannym-arx
Repo: marmot-protocol/whitenoise PR: 656
File: lib/hooks/use_block_actions.dart:3-3
Timestamp: 2026-05-13T13:46:32.612Z
Learning: In marmot-protocol/whitenoise code reviews, do not flag imports that reference FRB-generated bindings under `package:rust_lib_whitenoise/src/rust/...` as private-internals violations. In `rust_lib_whitenoise`, Dart bindings are intentionally generated into `lib/src/rust/`, and `analysis_options.yaml` sets `implementation_imports: false` to suppress the related Dart lint—so `package:rust_lib_whitenoise/src/rust/...` imports are the correct/only way to consume that FRB-generated API.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-05-13T13:46:39.250Z
Learnt from: dannym-arx
Repo: marmot-protocol/whitenoise PR: 656
File: lib/services/foreground_service.dart:13-16
Timestamp: 2026-05-13T13:46:39.250Z
Learning: In this repo (marmot-protocol/whitenoise), `rust_lib_whitenoise` is an FRB-generated Flutter package where the generated Dart bindings are intentionally exposed under `lib/src/rust/` as the public API surface. Do not treat imports like `package:rust_lib_whitenoise/src/rust/...` as breaking package API boundaries in code reviews (the project also sets `implementation_imports: false` in `analysis_options.yaml` to opt into this). Never raise concerns about `src/` imports from `rust_lib_whitenoise`.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • lib/screens/blocked_users_screen.dart
  • lib/routes.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-15T15:00:17.356Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 39
File: lib/screens/user_search_screen.dart:50-75
Timestamp: 2026-01-15T15:00:17.356Z
Learning: In lib/screens/user_search_screen.dart and similar screen widgets in the sloth repository, prefer using inline ternary expressions for conditional rendering (e.g., isLoading → empty state → list) over extracting into separate widget classes when the conditional UI is simple. This improves readability by keeping the render logic in a single place. Reserve extracting to a separate widget only when the conditional UI becomes sufficiently complex or is reused across multiple screens.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
📚 Learning: 2026-02-10T04:57:31.475Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 208
File: lib/screens/signup_screen.dart:66-70
Timestamp: 2026-02-10T04:57:31.475Z
Learning: In Dart/Flutter using flutter_hooks, a ValueNotifier (from useState) is disposed when the widget unmounts. Async callbacks (e.g., .then() on animations) may still run after disposal and throw 'A ValueNotifier was used after being disposed'. Reviewers should ensure that state updates in async callbacks are guarded by a mounted check (e.g., if (mounted) { notifier.value = ... } or cancel/avoid updating after disposal). This guideline applies to screen widgets under lib/screens and similar Dart files using hooks that manage widget lifecycle. Update code patterns to prevent post-disposal state updates, and document the rationale in comments where necessary.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
📚 Learning: 2026-02-19T10:33:16.889Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 315
File: lib/screens/group_info_screen.dart:146-149
Timestamp: 2026-02-19T10:33:16.889Z
Learning: Pubkey validation (length/format) is performed by the Rust crate before data reaches Dart. Do not add defensive substring guards in Dart for pubkeys in lib/screens/**/*.dart or other Flutter code consuming group member pubkeys, as this would duplicate validation and be unnecessary. If any validation is needed in Dart, keep it to lightweight sanity checks only after data enters Dart and ensure it aligns with the Rust validation rules.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
📚 Learning: 2026-04-06T09:40:51.965Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 552
File: lib/screens/sign_out_screen.dart:86-86
Timestamp: 2026-04-06T09:40:51.965Z
Learning: When reviewing Flutter/Dart code that uses ScreenUtil (e.g., ScreenUtil `.h`/`.w`/`.sp`), do not require converting a literal `0` used for padding/margin/sizing to a ScreenUtil expression. In sizing contexts like `EdgeInsets` (or other `EdgeInsets`/layout parameters), raw `0` is mathematically invariant (`0 * scale = 0`) and should not be flagged as a ScreenUtil violation. Only non-zero literal size values should be checked for ScreenUtil usage.

Applied to files:

  • lib/screens/privacy_security_screen.dart
  • lib/screens/blocked_users_screen.dart
  • lib/screens/blocked_user_screen.dart
  • lib/screens/chat_screen.dart
📚 Learning: 2025-12-23T14:37:11.241Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 9
File: test/screens/error_screen_test.dart:60-71
Timestamp: 2025-12-23T14:37:11.241Z
Learning: In tests for screen widgets that are not wired through the app's Routes.build (e.g., ErrorScreen under lib/screens/error_screen.dart), avoid mounting the full app with mountTestApp. instead, configure a minimal test harness with a custom router or navigator setup (e.g., a MaterialApp with a mock router) to render the screen in isolation. This ensures the test focuses on the screen's behavior without depending on the app's global routing configuration.

Applied to files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-05T21:28:05.652Z
Learnt from: untreu2
Repo: marmot-protocol/sloth PR: 22
File: test/screens/profile_keys_screen_test.dart:14-23
Timestamp: 2026-01-05T21:28:05.652Z
Learning: In test mocks for the marmot-protocol/sloth project, allow skipping bounds checking for substring operations when test inputs are controlled and have proven sufficient length (e.g., 'test_pubkey' is always 12 characters). Favor simpler, deterministic mock implementations in such controlled test contexts, but avoid relaxing bounds checks in production code or tests with variable inputs. Apply this guideline primarily to test files under the test/ directory.

Applied to files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-07T16:49:18.694Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 33
File: test/screens/chat_screen_test.dart:245-282
Timestamp: 2026-01-07T16:49:18.694Z
Learning: In the marmot-protocol/sloth repository, it is acceptable to use force-unwrapping (!) in Dart test files as an implicit assertion: if a value is unexpectedly null, the test will fail. This guideline applies only to test code under the test/ directory and should not be used in production code.

Applied to files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-01-11T22:43:09.610Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 36
File: test/screens/chat_list_screen_test.dart:74-76
Timestamp: 2026-01-11T22:43:09.610Z
Learning: In Dart tests (e.g., test/screens/chat_list_screen_test.dart and related files), use setUp() to call _api.reset() to clean up StreamController resources. Do not suggest or rely on tearDownAll for this cleanup.

Applied to files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-04-14T03:52:37.716Z
Learnt from: josefinalliende
Repo: marmot-protocol/whitenoise PR: 565
File: test/providers/offline_provider_test.dart:63-177
Timestamp: 2026-04-14T03:52:37.716Z
Learning: In this repository, it’s acceptable to use fixed-time waits for test timing using `Future.delayed` (e.g., `await Future.delayed(const Duration(milliseconds: 10))`) inside test files. During code reviews, don’t recommend replacing these fixed sleeps with event-based or poll-based synchronization when the change is localized to Dart test files under the `test/` directory.

Applied to files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-02-05T11:59:09.400Z
Learnt from: erskingardner
Repo: marmot-protocol/sloth PR: 189
File: test/widgets/wn_filter_chip_test.dart:1-3
Timestamp: 2026-02-05T11:59:09.400Z
Learning: In Dart/Flutter test files, Offset is exported by package:flutter_test/flutter_test.dart. If you already import flutter_test, you do not need to import dart:ui for Offset. Ensure there are no conflicting Offset symbols when both imports occur.

Applied to files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-04-28T17:39:39.941Z
Learnt from: pepina-dev
Repo: marmot-protocol/whitenoise PR: 600
File: test/hooks/use_leave_group_test.dart:67-78
Timestamp: 2026-04-28T17:39:39.941Z
Learning: In this repo’s Dart test files under `test/` (e.g., `test/hooks/use_leave_group_test.dart`), it’s acceptable to avoid calling `mockApi.reset()` at the start of `setUp()` when the test suite already manually resets all relevant individual mock fields in `setUp()`. Reviewers should not flag the absence of a `reset()` call as long as every field that could leak state between tests is explicitly reinitialized and the tests are passing.

Applied to files:

  • test/screens/chat_screen_test.dart
  • test/screens/privacy_security_screen_test.dart
  • test/screens/blocked_user_screen_test.dart
  • test/screens/blocked_users_screen_test.dart
📚 Learning: 2026-02-02T10:05:10.264Z
Learnt from: erskingardner
Repo: marmot-protocol/sloth PR: 128
File: lib/l10n/app_it.arb:53-53
Timestamp: 2026-02-02T10:05:10.264Z
Learning: For the Sloth app localization (lib/l10n/app_it.arb), ensure the Italian translations for the keys 'cancel' and 'discard' are both set to 'Annulla'. This should be consistently used across UI labels, dialogs, and tooltips. If there are multiple occurrences of these keys, verify all use the same translation to avoid inconsistencies.

Applied to files:

  • lib/l10n/app_it.arb
📚 Learning: 2026-03-04T16:40:26.588Z
Learnt from: josefinalliende
Repo: marmot-protocol/whitenoise PR: 408
File: lib/l10n/app_ru.arb:107-107
Timestamp: 2026-03-04T16:40:26.588Z
Learning: In the whitenoise Flutter project lib/l10n/app_ru.arb, the invitedYouToChatSuffix uses masculine past-tense (пригласил) as the default form. Since Nostr identities have no gender metadata, ICU gender-select is not feasible. Do not flag masculine default as a missing gender-agreement issue for Russian or other locales in this project.

Applied to files:

  • lib/l10n/app_ru.arb
🔇 Additional comments (22)
lib/screens/chat_screen.dart (2)

163-165: LGTM!


705-705: LGTM!

test/screens/chat_screen_test.dart (2)

2835-2839: LGTM!


2841-2852: LGTM!

lib/routes.dart (1)

17-18: LGTM!

Also applies to: 84-85, 216-232, 590-598

lib/screens/privacy_security_screen.dart (1)

102-127: LGTM!

test/screens/privacy_security_screen_test.dart (1)

5-5: LGTM!

Also applies to: 146-162

lib/screens/blocked_users_screen.dart (1)

1-123: LGTM!

test/screens/blocked_users_screen_test.dart (1)

1-185: LGTM!

lib/screens/blocked_user_screen.dart (1)

1-171: LGTM!

test/screens/blocked_user_screen_test.dart (1)

1-242: LGTM!

CHANGELOG.md (1)

26-26: LGTM!

lib/l10n/app_de.arb (1)

298-304: LGTM!

lib/l10n/app_en.arb (1)

1311-1338: LGTM!

lib/l10n/app_es.arb (1)

298-304: LGTM!

lib/l10n/app_fr.arb (1)

298-304: LGTM!

lib/l10n/app_it.arb (1)

298-304: LGTM!

lib/l10n/app_pt.arb (1)

298-304: LGTM!

lib/l10n/app_ru.arb (1)

298-304: LGTM!

lib/l10n/app_tr.arb (1)

298-304: LGTM!

lib/l10n/app_zh.arb (1)

302-308: LGTM!

lib/l10n/app_zh_Hant.arb (1)

302-308: LGTM!

Comment thread lib/l10n/app_tr.arb Outdated
Comment thread lib/l10n/app_zh_Hant.arb Outdated
Comment thread lib/l10n/app_zh.arb Outdated
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown

✅ Coverage: 99.02% → 99.03% (+0.01%)

History
  • 9b66785 2026-05-18 21:23:39 UTC — 99.36% (+0.01% vs base)
  • 1ff1a5b 2026-05-18 21:23:44 UTC — 99.36% (+0.01% vs base)
  • 0ec592e 2026-05-18 21:45:00 UTC — 99.36% (+0.01% vs base)
  • eb649f7 2026-05-18 22:00:25 UTC — 99.36% (+0.01% vs base)
  • 5f7ed73 2026-05-18 22:10:21 UTC — 99.36% (+0.01% vs base)
  • 3497b40 2026-05-19 19:27:44 UTC — 99.04% (+0.01% vs base)
  • a19a0a1 2026-05-20 13:16:12 UTC — 98.98% (-0.08% vs base)
  • 5940348 2026-05-20 13:19:11 UTC — 98.98% (-0.08% vs base)
  • 32cee1d 2026-05-20 13:26:26 UTC — 98.99% (-0.07% vs base)
  • 88c4b51 2026-05-20 13:42:22 UTC — 99.08% (+0.02% vs base)
  • 483e9eb 2026-05-20 19:03:02 UTC — 98.89% (-0.17% vs base)
  • 0ee69ff 2026-05-20 21:49:29 UTC — 99% (-0.02% vs base)
  • 5ad48ef 2026-05-20 22:11:21 UTC — 99.03% (+0.01% vs base)
  • a126bfa 2026-05-21 08:05:44 UTC — 99.03% (+0.01% vs base)
  • 397606e 2026-05-21 11:39:16 UTC — 99.03% (+0.01% vs base)
  • 4fdf6ed 2026-05-21 15:03:28 UTC — 99.03% (+0.01% vs base)

@mubarakcoded mubarakcoded marked this pull request as draft May 18, 2026 21:37
@mubarakcoded mubarakcoded force-pushed the feat/block-user-completion branch from aed35fd to 0ec6744 Compare May 18, 2026 21:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/screens/blocked_user_screen.dart`:
- Around line 150-153: The unblock button uses blockState.isActionLoading for
its loading indicator but blockState.isLoading for its disabled state, allowing
duplicate taps; update the button's disabled property to use the action-loading
flag (or the combined condition blockState.isLoading ||
blockState.isActionLoading) so the button is disabled while handleUnblock is
in-flight, ensuring the same flag(s) are used for both loading and disabled
behavior.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3c6e9240-1052-462a-91ef-14a1dccace14

📥 Commits

Reviewing files that changed from the base of the PR and between 0ec6744 and b008b72.

⛔ Files ignored due to path filters (10)
  • lib/l10n/generated/app_localizations.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_de.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_en.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_es.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_fr.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_it.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_pt.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_ru.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_tr.dart is excluded by !**/generated/**, !lib/l10n/generated/**
  • lib/l10n/generated/app_localizations_zh.dart is excluded by !**/generated/**, !lib/l10n/generated/**
📒 Files selected for processing (11)
  • 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_pt.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_tr.arb
  • lib/l10n/app_zh.arb
  • lib/l10n/app_zh_Hant.arb
  • lib/screens/blocked_user_screen.dart
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test (1/4)
  • GitHub Check: Test (2/4)
  • GitHub Check: Test (4/4)
  • GitHub Check: Test (3/4)
  • GitHub Check: Check
🧰 Additional context used
📓 Path-based instructions (5)
**/*.arb

⚙️ CodeRabbit configuration file

**/*.arb: These are localization files. Check for:

  • Consistent key naming across all locale files
  • Proper ICU message format for plurals/gender
  • No hardcoded strings that should be localized

Files:

  • lib/l10n/app_pt.arb
  • lib/l10n/app_tr.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_it.arb
  • lib/l10n/app_zh.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_zh_Hant.arb
**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

**/*.dart: Use single quotes for strings in Dart/Flutter code
Enable and respect prefer_const_constructors lint rule in Dart/Flutter code
Enable and respect prefer_final_locals lint rule in Dart/Flutter code
Set line width to 100 characters in Dart/Flutter code
Preserve trailing commas in Dart/Flutter code
Maintain minimum test coverage of 99%; never submit a PR that reduces test coverage
Avoid using // coverage:ignore, // coverage:ignore-line, // coverage:ignore-start, or // coverage:ignore-end to bypass coverage requirements; write tests instead (only exception: truly unreachable code)

Files:

  • lib/screens/blocked_user_screen.dart
**/*.{dart,rs}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add comments except for code that is really complex or hard to understand

Files:

  • lib/screens/blocked_user_screen.dart
lib/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

lib/**/*.dart: Use flutter_screenutil for all size values (padding, margins, gaps, icon sizes, font sizes, border radius, container dimensions) to ensure responsive layouts. Use .w for width, .h for height, .sp for font size/letter spacing, and .r for radius
Avoid StatefulWidget; prefer providers (for shared app-wide state) or hooks (for widget-local state) instead

Files:

  • lib/screens/blocked_user_screen.dart
lib/screens/**

⚙️ CodeRabbit configuration file

lib/screens/**: This is a Flutter screen (full-page widget).
Architecture rules:

  • Screens should WATCH Riverpod providers for shared state
  • Use flutter_hooks for ephemeral/local state (NOT StatefulWidget)
  • Pass data to hooks, not refs
  • Use flutter_screenutil (.w, .h, .sp, .r) for all size values
  • Widgets should use const constructors where possible
  • No comments except for truly complex logic
  • When a widget is extracted from a screen and only used in that one
    screen, it should be prefixed with the screen name (e.g.
    ChatListTile for a widget only used in the chat list screen).
    These are screen-scoped widgets and do NOT use the Wn prefix.

Files:

  • lib/screens/blocked_user_screen.dart
🧠 Learnings (21)
📚 Learning: 2026-02-02T10:05:10.264Z
Learnt from: erskingardner
Repo: marmot-protocol/sloth PR: 128
File: lib/l10n/app_it.arb:53-53
Timestamp: 2026-02-02T10:05:10.264Z
Learning: For the Sloth app localization (lib/l10n/app_it.arb), ensure the Italian translations for the keys 'cancel' and 'discard' are both set to 'Annulla'. This should be consistently used across UI labels, dialogs, and tooltips. If there are multiple occurrences of these keys, verify all use the same translation to avoid inconsistencies.

Applied to files:

  • lib/l10n/app_it.arb
📚 Learning: 2026-03-04T16:40:26.588Z
Learnt from: josefinalliende
Repo: marmot-protocol/whitenoise PR: 408
File: lib/l10n/app_ru.arb:107-107
Timestamp: 2026-03-04T16:40:26.588Z
Learning: In the whitenoise Flutter project lib/l10n/app_ru.arb, the invitedYouToChatSuffix uses masculine past-tense (пригласил) as the default form. Since Nostr identities have no gender metadata, ICU gender-select is not feasible. Do not flag masculine default as a missing gender-agreement issue for Russian or other locales in this project.

Applied to files:

  • lib/l10n/app_ru.arb
📚 Learning: 2026-01-05T20:05:32.918Z
Learnt from: untreu2
Repo: marmot-protocol/sloth PR: 22
File: lib/screens/settings_screen.dart:76-88
Timestamp: 2026-01-05T20:05:32.918Z
Learning: In the Sloth project, tooltips should not be used for UI elements. During code reviews, verify that UI components do not include Tooltip widgets and replace them with accessible alternatives (e.g., long-press hints, labels, or interactive guidance). Apply this guidance across Dart UI files under lib (not just settings_screen.dart) to maintain a consistent design approach.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-09T13:25:18.531Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 33
File: lib/services/message_service.dart:14-26
Timestamp: 2026-01-09T13:25:18.531Z
Learning: When errors are presented to users in the Sloth codebase (UI layers such as snackbars, dialogs, toasts), show friendly, user-facing messages instead of raw Rust error messages. Implement a mapping from internal error types or codes to clear, non-technical messages, and surface actionable guidance for end users where appropriate. Avoid exposing internal stack traces or language runtime details; centralize common user-facing error wording in a dedicated utility or service and translate backend errors into concise, helpful UI messages.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-04-06T09:40:41.044Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 552
File: lib/screens/profile_keys_screen.dart:71-71
Timestamp: 2026-04-06T09:40:41.044Z
Learning: In this Flutter/Dart codebase, when using flutter_screenutil (e.g., ScreenUtil or ScreenUtil-based sizing like `w`, `h`), do not require scaled units for literal zero values. Specifically, in EdgeInsets (and similar sizing/padding/margin/gap APIs), bare numeric `0` should be allowed (e.g., `EdgeInsets.all(0)`, `EdgeInsets.symmetric(vertical: 0)`, `SizedBox(width: 0)`), because scaling `0` remains `0`. Only flag ScreenUtil violations when a non-zero literal needs to be expressed via `0.w`/`0.h` equivalents; do not flag bare `0`.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-06T01:08:41.552Z
Learnt from: untreu2
Repo: marmot-protocol/sloth PR: 22
File: lib/widgets/wn_warning_box.dart:28-79
Timestamp: 2026-01-06T01:08:41.552Z
Learning: In reviews for the marmot-protocol/sloth repository, avoid suggesting accessibility, design, or general improvements unless they are strictly relevant to the PR description and its stated goals. Focus feedback on the specific PR objectives and requirements; ignore unrelated stylistic or broad improvement suggestions.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-15T14:42:54.111Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 39
File: lib/hooks/use_user_search.dart:47-53
Timestamp: 2026-01-15T14:42:54.111Z
Learning: When using npubFromHex(String hexPubkey) from lib/utils/formatting.dart, it already handles errors internally and returns null on failure. Do not wrap calls to this function in try/catch blocks. Instead, check for a null return and handle accordingly (e.g., treat as invalid hex). This guideline applies to all Dart files in the repository that may call this function.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-16T17:35:32.431Z
Learnt from: untreu2
Repo: marmot-protocol/sloth PR: 43
File: lib/hooks/use_network_relays.dart:155-184
Timestamp: 2026-01-16T17:35:32.431Z
Learning: In Dart/Flutter code, prefer void as the return type for fire-and-forget async functions that are intended to run in the background without blocking the caller. Using Future or Future<void> would allow callers to accidentally await, which could block for long periods. This pattern makes the call fire-and-forget by design. Apply to functions that intentionally should not be awaited; document the intent where appropriate. (Example context: pollRelayStatus in lib/hooks/use_network_relays.dart uses void to prevent callers from awaiting a potentially long-running background task.)

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-19T15:50:56.684Z
Learnt from: erskingardner
Repo: marmot-protocol/sloth PR: 52
File: lib/screens/app_settings_screen.dart:30-40
Timestamp: 2026-01-19T15:50:56.684Z
Learning: Target the Flutter SDK version >= 3.27 across the repo. Since features like Column.spacing and Row.spacing were added in Flutter 3.27, you can safely use them in Dart files (e.g., lib/screens/app_settings_screen.dart) as long as the pubspec.yaml environment specifies Flutter >= 3.27. If needed, enforce this by validating the environment constraint (e.g., flutter, sdk: flutter) in pubspec.yaml.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-29T03:02:34.290Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 100
File: lib/widgets/wn_dropdown_selector.dart:126-139
Timestamp: 2026-01-29T03:02:34.290Z
Learning: Global font-family usage guideline: Since Manrope is configured in lib/theme.dart for both light and dark themes, individual TextStyle declarations should not specify fontFamily: 'Manrope'. During reviews, verify that no TextStyle instances override fontFamily unnecessarily; rely on theme inheritance instead. If a TextStyle must specify a font for a specific case, ensure it is clearly justified and localized, and document why the override is needed. This guideline applies across Dart files in the project (e.g., lib/widgets/wn_dropdown_selector.dart and related components).

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-29T16:02:52.588Z
Learnt from: erskingardner
Repo: marmot-protocol/sloth PR: 129
File: test/widgets/wn_overlay_test.dart:84-91
Timestamp: 2026-01-29T16:02:52.588Z
Learning: In Dart/Flutter code, when constructing widgets inside an already-const context (for example, within a const Scaffold with a child that is a collection of widgets), avoid adding explicit const keywords to the children. The Dart analyzer treats these as implicitly const, and adding explicit const can trigger the unnecessary_const lint. Review test files and general Dart files to ensure you do not redundantly prefix children with const in const contexts; rely on the implicit const behavior instead.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-02-07T03:58:22.587Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 193
File: lib/services/android_signer_service.dart:13-13
Timestamp: 2026-02-07T03:58:22.587Z
Learning: In Dart files across the repository, retain NIP (Nostr Implementation Possibilities) and MIP (Marmot Implementation Possibilities) protocol reference comments that link code to their specifications. While general guidance discourages extraneous comments, these references improve traceability and maintainability by documenting the protocol context for related implementation details. Keep them in Dart sources (e.g., lib/services/android_signer_service.dart) and ensure they are kept up-to-date.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-02-11T17:29:43.985Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 225
File: lib/screens/app_settings_screen.dart:64-69
Timestamp: 2026-02-11T17:29:43.985Z
Learning: In the whitenoise Flutter app, after deleting all data and resetting auth, use Routes.goToHome(context) instead of Routes.goToLogin(context) because the home screen is the app entry point and will manage authentication routing. Apply this change to navigation calls that should land on the home screen after a data reset or auth reset. Update lib/screens/app_settings_screen.dart and any similar navigation points accordingly.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-02-18T18:36:13.394Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 315
File: lib/screens/edit_group_screen.dart:45-47
Timestamp: 2026-02-18T18:36:13.394Z
Learning: Whitenoise uses automated code formatting through the precommit workflow (just precommit). Do not tweak line wrapping or formatting manually; follow the formatter's output. Run the precommit formatter locally and ensure the code matches its styling decisions, and only deviate if the formatter cannot express the intended style (in which case adjust the code to satisfy the formatter).

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-04-06T09:36:06.726Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 553
File: lib/widgets/wn_copyable_field.dart:38-40
Timestamp: 2026-04-06T09:36:06.726Z
Learning: In Dart, `String.operator*` is a valid built-in operator for repeating strings (e.g., `'⬤' * 16`). In code reviews of Dart (`.dart`) files, do not treat expressions like `'text' * n` as invalid syntax and do not recommend replacing them with alternatives such as `List.filled(...).join()`; the operator is supported by `dart:core`.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-05-13T13:46:32.612Z
Learnt from: dannym-arx
Repo: marmot-protocol/whitenoise PR: 656
File: lib/hooks/use_block_actions.dart:3-3
Timestamp: 2026-05-13T13:46:32.612Z
Learning: In marmot-protocol/whitenoise code reviews, do not flag imports that reference FRB-generated bindings under `package:rust_lib_whitenoise/src/rust/...` as private-internals violations. In `rust_lib_whitenoise`, Dart bindings are intentionally generated into `lib/src/rust/`, and `analysis_options.yaml` sets `implementation_imports: false` to suppress the related Dart lint—so `package:rust_lib_whitenoise/src/rust/...` imports are the correct/only way to consume that FRB-generated API.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-05-13T13:46:39.250Z
Learnt from: dannym-arx
Repo: marmot-protocol/whitenoise PR: 656
File: lib/services/foreground_service.dart:13-16
Timestamp: 2026-05-13T13:46:39.250Z
Learning: In this repo (marmot-protocol/whitenoise), `rust_lib_whitenoise` is an FRB-generated Flutter package where the generated Dart bindings are intentionally exposed under `lib/src/rust/` as the public API surface. Do not treat imports like `package:rust_lib_whitenoise/src/rust/...` as breaking package API boundaries in code reviews (the project also sets `implementation_imports: false` in `analysis_options.yaml` to opt into this). Never raise concerns about `src/` imports from `rust_lib_whitenoise`.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-01-15T15:00:17.356Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 39
File: lib/screens/user_search_screen.dart:50-75
Timestamp: 2026-01-15T15:00:17.356Z
Learning: In lib/screens/user_search_screen.dart and similar screen widgets in the sloth repository, prefer using inline ternary expressions for conditional rendering (e.g., isLoading → empty state → list) over extracting into separate widget classes when the conditional UI is simple. This improves readability by keeping the render logic in a single place. Reserve extracting to a separate widget only when the conditional UI becomes sufficiently complex or is reused across multiple screens.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-02-10T04:57:31.475Z
Learnt from: josefinalliende
Repo: marmot-protocol/sloth PR: 208
File: lib/screens/signup_screen.dart:66-70
Timestamp: 2026-02-10T04:57:31.475Z
Learning: In Dart/Flutter using flutter_hooks, a ValueNotifier (from useState) is disposed when the widget unmounts. Async callbacks (e.g., .then() on animations) may still run after disposal and throw 'A ValueNotifier was used after being disposed'. Reviewers should ensure that state updates in async callbacks are guarded by a mounted check (e.g., if (mounted) { notifier.value = ... } or cancel/avoid updating after disposal). This guideline applies to screen widgets under lib/screens and similar Dart files using hooks that manage widget lifecycle. Update code patterns to prevent post-disposal state updates, and document the rationale in comments where necessary.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-02-19T10:33:16.889Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 315
File: lib/screens/group_info_screen.dart:146-149
Timestamp: 2026-02-19T10:33:16.889Z
Learning: Pubkey validation (length/format) is performed by the Rust crate before data reaches Dart. Do not add defensive substring guards in Dart for pubkeys in lib/screens/**/*.dart or other Flutter code consuming group member pubkeys, as this would duplicate validation and be unnecessary. If any validation is needed in Dart, keep it to lightweight sanity checks only after data enters Dart and ensure it aligns with the Rust validation rules.

Applied to files:

  • lib/screens/blocked_user_screen.dart
📚 Learning: 2026-04-06T09:40:51.965Z
Learnt from: untreu2
Repo: marmot-protocol/whitenoise PR: 552
File: lib/screens/sign_out_screen.dart:86-86
Timestamp: 2026-04-06T09:40:51.965Z
Learning: When reviewing Flutter/Dart code that uses ScreenUtil (e.g., ScreenUtil `.h`/`.w`/`.sp`), do not require converting a literal `0` used for padding/margin/sizing to a ScreenUtil expression. In sizing contexts like `EdgeInsets` (or other `EdgeInsets`/layout parameters), raw `0` is mathematically invariant (`0 * scale = 0`) and should not be flagged as a ScreenUtil violation. Only non-zero literal size values should be checked for ScreenUtil usage.

Applied to files:

  • lib/screens/blocked_user_screen.dart
🔇 Additional comments (10)
lib/l10n/app_de.arb (1)

298-303: LGTM!

lib/l10n/app_en.arb (1)

1311-1334: LGTM!

lib/l10n/app_es.arb (1)

298-303: LGTM!

lib/l10n/app_fr.arb (1)

298-303: LGTM!

lib/l10n/app_it.arb (1)

298-303: LGTM!

lib/l10n/app_pt.arb (1)

298-303: LGTM!

lib/l10n/app_ru.arb (1)

298-303: LGTM!

lib/l10n/app_tr.arb (1)

298-303: LGTM!

lib/l10n/app_zh.arb (1)

302-307: LGTM!

lib/l10n/app_zh_Hant.arb (1)

302-307: LGTM!

Comment thread lib/screens/blocked_user_screen.dart Outdated
@mubarakcoded mubarakcoded force-pushed the feat/block-user-completion branch from b008b72 to 9956e6e Compare May 18, 2026 22:02
@mubarakcoded mubarakcoded marked this pull request as ready for review May 18, 2026 22:10

@pepina-dev pepina-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please use design system component WnSystemNotice for this warning so that we don't end up with duplicated widgets that do the same.

Comment thread lib/screens/blocked_users_screen.dart Outdated
Comment thread lib/routes.dart
Comment thread lib/screens/blocked_user_screen.dart Outdated
Comment thread lib/screens/blocked_user_screen.dart Outdated
@mubarakcoded mubarakcoded requested a review from pepina-dev May 19, 2026 19:36
Comment thread lib/screens/blocked_user_screen.dart Outdated
Comment thread lib/screens/blocked_users_screen.dart Outdated
Comment thread lib/screens/blocked_users_screen.dart Outdated
Comment thread lib/screens/blocked_user_screen.dart Outdated
@stage-review

stage-review Bot commented May 20, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 7 individual chapters for you:

Title
1 Add localization for blocked users UI
2 Refactor StartChatScreen into UserProfileScreen
3 Implement Blocked Users management screen
4 Hide chat composer for blocked peers
5 Update routing and deep links
6 Wire UI components to UserProfileScreen
7 Update changelog
Open in Stage

Chapters generated by Stage for commit 53fec18 on May 21, 2026 2:56pm UTC.

@mubarakcoded mubarakcoded requested a review from pepina-dev May 20, 2026 22:13
Comment thread lib/widgets/wn_system_notice.dart Outdated
Comment thread lib/routes.dart
Comment thread lib/screens/blocked_users_screen.dart Outdated

@pepina-dev pepina-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Another comment I noticed while testing and that it is an issue that is also in master but probably direct to address here as it is related to this touched screens: from what I see in the Figma, the user profile screen slate (for blocked and unblocked users) should start from the top instead of being positioned at the bottom of the screen.

…pletion

# Conflicts:
#	lib/screens/start_chat_screen.dart
#	lib/widgets/chat_message_bubble.dart
#	test/widgets/chat_message_bubble_test.dart
@mubarakcoded

Copy link
Copy Markdown
Contributor Author

Another comment I noticed while testing and that it is an issue that is also in master but probably direct to address here as it is related to this touched screens: from what I see in the Figma, the user profile screen slate (for blocked and unblocked users) should start from the top instead of being positioned at the bottom of the screen.

Yes, that's the current behaviour, for blocked and unblocked users. It starts from the top of the screen

@pepina-dev

Copy link
Copy Markdown
Collaborator

Yes, that's the current behaviour, for blocked and unblocked users. It starts from the top of the screen

No, it is not. Tested in commit 85275b4

start.chat.issue.MP4

@mubarakcoded

mubarakcoded commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

No, it is not. Tested in commit 85275b4

@pepina-dev Okay. I get your point, I thought you were referring to the view page from the block list, so our chat screen should be on top to align with the Figma design. fixing...

@pepina-dev pepina-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As I mentioned before, it's in the bottom in the flow of start chat. Also, the blocked users notice has a padding that shouldn't be there

Figma this PR
Image Image

Comment thread lib/screens/user_profile_screen.dart Outdated
Comment thread lib/widgets/wn_system_notice.dart Outdated
erskingardner
erskingardner previously approved these changes May 21, 2026
@erskingardner erskingardner merged commit 1ce17a2 into master May 21, 2026
9 checks passed
@erskingardner erskingardner deleted the feat/block-user-completion branch May 21, 2026 16:42
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.

4 participants