feat(blocked-users): complete block/unblock UX#676
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds 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. ChangesBlocked Users Management Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (10)
lib/l10n/generated/app_localizations.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_de.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_en.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_es.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_fr.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_it.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_pt.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_ru.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_tr.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_zh.dartis excluded by!**/generated/**,!lib/l10n/generated/**
📒 Files selected for processing (20)
CHANGELOG.mdlib/l10n/app_de.arblib/l10n/app_en.arblib/l10n/app_es.arblib/l10n/app_fr.arblib/l10n/app_it.arblib/l10n/app_pt.arblib/l10n/app_ru.arblib/l10n/app_tr.arblib/l10n/app_zh.arblib/l10n/app_zh_Hant.arblib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/blocked_users_screen.dartlib/screens/chat_screen.dartlib/screens/privacy_security_screen.darttest/screens/blocked_user_screen_test.darttest/screens/blocked_users_screen_test.darttest/screens/chat_screen_test.darttest/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 respectprefer_const_constructorslint rule in Dart/Flutter code
Enable and respectprefer_final_localslint 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-endto bypass coverage requirements; write tests instead (only exception: truly unreachable code)
Files:
lib/screens/privacy_security_screen.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/screens/blocked_users_screen_test.dart
lib/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
lib/**/*.dart: Useflutter_screenutilfor all size values (padding, margins, gaps, icon sizes, font sizes, border radius, container dimensions) to ensure responsive layouts. Use.wfor width,.hfor height,.spfor font size/letter spacing, and.rfor radius
Avoid StatefulWidget; prefer providers (for shared app-wide state) or hooks (for widget-local state) instead
Files:
lib/screens/privacy_security_screen.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/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.dartlib/screens/blocked_users_screen.dartlib/screens/blocked_user_screen.dartlib/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.arblib/l10n/app_fr.arblib/l10n/app_es.arblib/l10n/app_zh_Hant.arblib/l10n/app_en.arblib/l10n/app_de.arblib/l10n/app_it.arblib/l10n/app_ru.arblib/l10n/app_tr.arblib/l10n/app_pt.arb
test/**/*_test.dart
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.dart: Test files should mirror source structure with_test.dartsuffix
Use helpers fromtest/test_helpers.dartin tests:setUpTestView(),mountTestApp(),mountHook(),mountWidget(),mountStackedWidget()
Mock Rust API by extendingMockWnApifromtest/mocks/mock_wn_api.dartinstead of implementingRustLibApidirectly
Preferfind.byKey()overfind.byIcon()in tests; add keys to icons in widgets and usefind.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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/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.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/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.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/chat_screen_test.darttest/screens/privacy_security_screen_test.dartlib/screens/blocked_users_screen.dartlib/routes.dartlib/screens/blocked_user_screen.dartlib/screens/chat_screen.darttest/screens/blocked_user_screen_test.darttest/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.dartlib/screens/blocked_users_screen.dartlib/screens/blocked_user_screen.dartlib/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.dartlib/screens/blocked_users_screen.dartlib/screens/blocked_user_screen.dartlib/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.dartlib/screens/blocked_users_screen.dartlib/screens/blocked_user_screen.dartlib/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.dartlib/screens/blocked_users_screen.dartlib/screens/blocked_user_screen.dartlib/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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.darttest/screens/privacy_security_screen_test.darttest/screens/blocked_user_screen_test.darttest/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!
✅ Coverage: 99.02% → 99.03% (+0.01%)History
|
aed35fd to
0ec6744
Compare
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (10)
lib/l10n/generated/app_localizations.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_de.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_en.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_es.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_fr.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_it.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_pt.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_ru.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_tr.dartis excluded by!**/generated/**,!lib/l10n/generated/**lib/l10n/generated/app_localizations_zh.dartis excluded by!**/generated/**,!lib/l10n/generated/**
📒 Files selected for processing (11)
lib/l10n/app_de.arblib/l10n/app_en.arblib/l10n/app_es.arblib/l10n/app_fr.arblib/l10n/app_it.arblib/l10n/app_pt.arblib/l10n/app_ru.arblib/l10n/app_tr.arblib/l10n/app_zh.arblib/l10n/app_zh_Hant.arblib/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.arblib/l10n/app_tr.arblib/l10n/app_es.arblib/l10n/app_it.arblib/l10n/app_zh.arblib/l10n/app_fr.arblib/l10n/app_ru.arblib/l10n/app_de.arblib/l10n/app_en.arblib/l10n/app_zh_Hant.arb
**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
**/*.dart: Use single quotes for strings in Dart/Flutter code
Enable and respectprefer_const_constructorslint rule in Dart/Flutter code
Enable and respectprefer_final_localslint 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-endto 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: Useflutter_screenutilfor all size values (padding, margins, gaps, icon sizes, font sizes, border radius, container dimensions) to ensure responsive layouts. Use.wfor width,.hfor height,.spfor font size/letter spacing, and.rfor 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!
b008b72 to
9956e6e
Compare
pepina-dev
left a comment
There was a problem hiding this comment.
Please use design system component WnSystemNotice for this warning so that we don't end up with duplicated widgets that do the same.
…pletion # Conflicts: # CHANGELOG.md
…pletion # Conflicts: # lib/routes.dart # test/routes_test.dart
|
Ready to review this PR? Stage has broken it down into 7 individual chapters for you: Chapters generated by Stage for commit 53fec18 on May 21, 2026 2:56pm UTC. |
…een.show in tests
…pletion # Conflicts: # CHANGELOG.md
pepina-dev
left a comment
There was a problem hiding this comment.
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.
…rop stale start-chat route stub
… the blocked user notice
…pletion # Conflicts: # lib/screens/start_chat_screen.dart # lib/widgets/chat_message_bubble.dart # test/widgets/chat_message_bubble_test.dart
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 |
@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... |
…p-aligned from start-chat entries


Description
Completes the block/unblock feature with the two missing pieces:
chat_info_screenpattern (opaque: false+WnOverlay(light)).Reuses existing hooks (
useBlockActions,useBlockedPubkeys,useUserMetadata,useRouteRefresh) and shared widgets (WnSlate,WnOverlay,WnChatInfoProfileCard,WnUserItem). No Rust changes.Architectural note:
BlockedUsersScreen'sWnSlateuses a unique Hero tag ('blocked-users-list-slate').chat_info_screenkeeps 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
How I Tested This
useRouteRefreshon pop.Test suite: 4489/4489 pass. Coverage 99.40% global, 100% on the two new screens.
just precommitgreen across all 9 gates.Screenshots
UI changes
Checklist
just precommitpassesCHANGELOG.mdupdatedSummary by CodeRabbit
Documentation
New Features
Localization
Tests