JeffGandGitHub f363483d88 feat(widgets): add WnCallout component replacing WnWarningBox (#113)
* feat(widgets): add WnCallout component replacing WnWarningBox

Implement new Callout component based on Figma design with support for
multiple types (neutral, info, warning, success, error) and dismissible
variant. Migrate existing WnWarningBox usages to the new component.

- Add WnCallout widget with CalloutType enum
- Add comprehensive tests for all callout types
- Migrate sign_out_screen, profile_keys_screen, edit_profile_screen
- Remove deprecated WnWarningBox widget and tests

Closes #71

* refactor(tests): consolidate redundant tests and fix mutable state

- Remove redundant 'displays help icon for neutral type' test (covered by
  'defaults to neutral type' test)
- Use mutable container for dismissed state in onDismiss test

* fix(widgets): use responsive .sp values for letterSpacing in WnCallout

* fix(widgets): add left border to WnCallout matching Figma design

- Add borderColor field to _CalloutColorScheme
- Add 4px left border to callout container using type-specific colors
- Fix edit_profile_screen to use neutral type (default) instead of info
- Add test to verify left border is present

* fix(callout): remove left border and use warning type for key screens

- Remove left border from WnCallout to match designs
- Change callout type from error to warning on profile keys and sign out screens
- Remove unused borderColor from _CalloutColorScheme
- Update tests to reflect border removal

* refactor(callout): add stable key to icon for cleaner test assertions

- Add Key('callout_icon') to WnIcon in WnCallout widget
- Update icon tests to use find.byKey instead of iterating find.byType

* fix(callout): add 1px border to match design

Add Border.all with iconColor and fixed 1px width to BoxDecoration.

* fix(callout): use consistent borderTertiary color for border

Border should always use colors.borderTertiary per Figma design,
not change color based on callout type.
2026-01-29 14:23:34 +01:00
2026-01-29 09:56:19 -03:00
2026-01-29 09:56:19 -03:00
2026-01-26 16:41:34 -03:00
2026-01-26 16:41:34 -03:00
2026-01-26 16:41:34 -03:00
2026-01-26 16:41:34 -03:00
2026-01-27 17:06:20 -03:00
2025-12-01 10:23:00 -03:00
2025-12-01 11:20:36 -03:00
2026-01-26 16:41:34 -03:00
2025-11-24 15:02:01 -03:00
2026-01-29 09:56:19 -03:00
2025-12-01 10:23:00 -03:00
2026-01-29 09:56:19 -03:00

Sloth 🦥

A playground messaging app for experimenting with the whitenoise rust crate 🦀, which uses the marmot protocol 🦫 to build secure messaging with MLS and Nostr

Why sloth? Cause sloths are slow but efficient, and you can find them in Costa Rica 🤙

Structure

lib/
├── providers/     # Shared state
├── hooks/         # Ephemeral widget state
├── services/      # Stateless operations (API calls)
├── screens/       # Full-page components
├── widgets/       # Reusable components

🏗️ Stack

Prerequisites

  • Flutter SDK (3.24.x or later)
  • Rust (latest stable)
  • Just - cargo install just
  • flutter_rust_bridge_codegen - cargo install flutter_rust_bridge_codegen

🛠️ Commands

# Install dependencies
just deps              # Install both Flutter and Rust deps
just deps-flutter      # Flutter dependencies only
just deps-rust         # Rust dependencies only

# Format code
just format            # Format both Rust and Dart
just format-rust       # Format Rust only
just format-dart       # Format Dart only

# Coverage
just coverage          # Checks tests coverage

Coverage Report

You need to install lcov to generate report

# Mac OS
brew install lcov

# Linux
apt-get install lcov
# First run tests with coverage option
flutter test --coverage
# Generate coverage html report
genhtml coverage/lcov.info -o coverage/html 
# Open coverage/html/index.html in your browser

Sloth mode 🦥

  • Sloths know complexity is bad, very bad.
  • Sloths work hard to keep this app thin.
  • Sloths test their code.
  • Sloths delete dead code. Commented code is dead code.
  • Sloths use the White Noise Rust crate 🦀 as the source of truth.
  • Sloths avoid caching in flutter side. Sloths remember that White Noise crate already persists data in a local DB.
  • Sloths put shared app state in providers.
  • Sloths put ephemeral widget state in hooks.
  • Sloths pass data to hooks, not widget refs.
  • Sloths let screens watch providers and pass data to hooks.
  • Sloths don't add code comments unless strictly necessary. Instead, they make big effort on writing code that is self-explanatory.

📚 Resources

S
Description
Mirror of White Noise
Readme
223 MiB