Skip to content

feat(app): design system Arah + rebrand Ará → Arah#283

Merged
cursor[bot] merged 4 commits into
mainfrom
cursor/app-design-fidelity-f45b
Jun 17, 2026
Merged

feat(app): design system Arah + rebrand Ará → Arah#283
cursor[bot] merged 4 commits into
mainfrom
cursor/app-design-fidelity-f45b

Conversation

@sraphaz

@sraphaz sraphaz commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Resumo

Alinha o app Flutter à identidade visual Arah e conclui itens pendentes de fidelidade ao design system.

Mudanças

Design & marca

  • Tokens dark oficiais (#0A0E12, #141A21), Inter, gradiente sutil, cards com borda
  • Ará → Arah em l10n, web manifest e telas
  • Logo oficial (arah-icon.svg do devportal) no ArahBrandHeader
  • ArahScaffold em todas as telas de features

l10n

  • +50 strings (marketplace, chat, moderação, assets, membership, etc.)
  • Remoção de textos PT hardcoded nas telas principais

Storage

  • Chaves arah_* substituem araponga_*
  • StorageMigration migra tokens e território legado na inicialização
  • User-agent de mapa: com.arah.app

Validação

cd frontend/arah.app
flutter analyze --no-fatal-infos
flutter test  # 24 testes
Open in Web Open in Cursor 

Summary by CodeRabbit

Release Notes

  • New Features

    • Centralized brand configuration and refreshed brand visuals (Arah) across the app and web.
    • New custom scaffold wrapper and brand header component.
    • Expanded design tokens, including updated dark theme colors/typography.
    • Storage migration runs on startup to move legacy saved values to the new keys.
  • Bug Fixes

    • Theme color access now safely falls back when a theme extension isn’t available.
  • Refactoring

    • Widespread localization rollout using shared localized strings across screens (including dialogs, errors, and empty states).
  • Chores / Tests

    • Added/updated UI dependencies, branding metadata, and a storage migration test.

- Tokens dark alinhados a design-tokens.css (#0a0e12, #141a21, links, erro)
- Tipografia Inter (google_fonts) com escala 1.125 e peso visual reforçado
- ArahBrandHeader e ArahScaffold (gradiente sutil, cards com borda)
- Login, shell, onboarding e perfil com presença de marca Arah
- Web manifest/index.html com cores e nome da marca
- Mapa/onboarding sem cores hardcoded (territoryBoundary, locationPin)

Co-authored-by: Rapha <sraphaz@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3fd14bae-ddf8-4006-8f73-49ce116b4a36

📥 Commits

Reviewing files that changed from the base of the PR and between 314ee18 and e42c5a1.

📒 Files selected for processing (22)
  • frontend/arah.app/docs/ARCHITECTURE.md
  • frontend/arah.app/docs/MAPA_PINS.md
  • frontend/arah.app/docs/README.md
  • frontend/arah.app/lib/app_router.dart
  • frontend/arah.app/lib/features/alerts/presentation/screens/alerts_screen.dart
  • frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart
  • frontend/arah.app/lib/features/chat/presentation/screens/chat_conversation_screen.dart
  • frontend/arah.app/lib/features/chat/presentation/screens/chat_list_screen.dart
  • frontend/arah.app/lib/features/connections/presentation/screens/connections_screen.dart
  • frontend/arah.app/lib/features/feed/presentation/screens/create_post_screen.dart
  • frontend/arah.app/lib/features/feed/presentation/screens/feed_screen.dart
  • frontend/arah.app/lib/features/feed/presentation/widgets/feed_comments_sheet.dart
  • frontend/arah.app/lib/features/marketplace/presentation/screens/marketplace_screen.dart
  • frontend/arah.app/lib/features/membership/presentation/screens/membership_screen.dart
  • frontend/arah.app/lib/features/moderation/presentation/screens/moderation_screen.dart
  • frontend/arah.app/lib/features/subscriptions/presentation/screens/subscriptions_screen.dart
  • frontend/arah.app/lib/l10n/app_en.arb
  • frontend/arah.app/lib/l10n/app_localizations.dart
  • frontend/arah.app/lib/l10n/app_localizations_en.dart
  • frontend/arah.app/lib/l10n/app_localizations_pt.dart
  • frontend/arah.app/lib/l10n/app_pt.arb
  • frontend/arah.app/scripts/run-app-local.ps1

📝 Walkthrough

Walkthrough

The app is renamed from "Ará" to "Arah" with a new BrandConfig class, a one-time StorageMigration to rename storage keys from araponga_ to arah_ prefix, an expanded design-token and theme system using Inter typography via Google Fonts, two new shared widgets (ArahScaffold, ArahBrandHeader), and a large localization expansion covering ~50 new string keys across EN and PT, all rolled out across every feature screen.

Changes

Arah rebrand and design system overhaul

Layer / File(s) Summary
Brand identity and storage key rename
lib/core/config/brand_config.dart, lib/core/config/constants.dart, lib/app.dart, README.md, web/manifest.json, web/index.html, docs/*
BrandConfig class added with static brand metadata (name, tagline, description, siteUrl). AppConstants storage keys renamed from araponga_ to arah_ prefix; spacing2xl and mapUserAgentPackage constants added. MaterialApp title driven from BrandConfig.name. Web manifest, index.html, and documentation updated to Arah branding.
One-time storage key migration
lib/core/storage/storage_migration.dart, lib/main.dart, test/core/storage/storage_migration_test.dart
StorageMigration.migrateIfNeeded() copies legacy secure-storage and SharedPreferences keys to the new arah_ prefix, deletes legacy keys, and sets a one-time migration flag. Called from _runApp at startup after Firebase initialization. Migration of the territory ID key is covered by a test.
Design token and theme system expansion
lib/core/theme/app_design_tokens.dart, lib/core/theme/app_theme.dart, pubspec.yaml
AppDesignTokens drops the *Dark suffix convention and adds semantic tokens (surfaceElevated, onSurfaceMuted, outlineSubtle, error, accentSubtle, accentBorder, territoryBoundary, locationPin, scaffoldGradientColors). AppColors ThemeExtension constructor, copyWith, and lerp expanded to cover all new fields; appColors accessor falls back to AppColors.dark when missing. AppTheme integrates Inter via GoogleFonts and expands component theming (AppBar, NavigationBar, buttons, InputDecoration). google_fonts and flutter_svg added as deps; SVG asset registered.
ArahScaffold and ArahBrandHeader shared widgets
lib/core/widgets/arah_scaffold.dart, lib/core/widgets/arah_brand_header.dart
ArahScaffold wraps Scaffold with a radial gradient background from AppDesignTokens.scaffoldGradientColors and context.appColors.surface. ArahBrandHeader renders the SVG brand icon and BrandConfig.name wordmark with three size variants (large, medium, compact) and an optional subtitle.
Localization API and translation expansion
lib/l10n/app_en.arb, lib/l10n/app_pt.arb, lib/l10n/app_localizations.dart, lib/l10n/app_localizations_en.dart, lib/l10n/app_localizations_pt.dart
AppLocalizations abstract class gains 46+ new string getters and 6+ parameterized methods (e.g., statusLabel, checkoutWithCount, priceLabel, storeAndPrice, conversationMeta, verificationLabel). English and Portuguese implementations updated. appTitle changed from "Ará" to "Arah"; brandTagline added with Portuguese translation "Território primeiro. Comunidade primeiro."
Auth, events, explore screens
lib/features/auth/...login_screen.dart, lib/features/events/...events_screen.dart, lib/features/explore/...explore_screen.dart, test/features/auth/...
Login uses ArahBrandHeader for the title/subtitle and ArahScaffold. Events and explore use ArahScaffold and replace hardcoded strings with localized AppLocalizations lookups. Tests updated with AppTheme.dark and "Arah" title assertion.
Alerts and assets screens
lib/features/alerts/..., lib/features/assets/...
Both screens use ArahScaffold, initialize AppLocalizations, and replace hardcoded dialog titles/buttons/empty states/error text with localized strings. Asset actions (validate/archive/approve/reject) and asset creation flow localize all labels and success/error snackbars.
Chat conversation and list screens
lib/features/chat/...chat_conversation_screen.dart, lib/features/chat/...chat_list_screen.dart
Both use ArahScaffold and replace hardcoded strings with AppLocalizations. Dialog titles/labels/buttons/hints are localized. Chat list uses parameterized conversationMeta(kind, status) for dynamic subtitle formatting. Error fallbacks use localized equivalents.
Connections screen
lib/features/connections/...connections_screen.dart
Uses ArahScaffold and replaces all Portuguese strings across the main screen, search sheet, and connection tile with AppLocalizations. Parameterized statusLabel(status) formats connection status. Error fallbacks for all request/search/accept/reject flows are localized.
Feed and comments
lib/features/feed/...create_post_screen.dart, lib/features/feed/...feed_screen.dart, lib/features/feed/...feed_comments_sheet.dart
Create post and feed screens use ArahScaffold. All hardcoded strings—image labels, filter chips, empty states, delete confirmations—replaced with AppLocalizations. Comments sheet localizes error/empty/hint text and includes fallback l10n error for non-ApiException cases.
Marketplace screen
lib/features/marketplace/...marketplace_screen.dart
Uses ArahScaffold. Search, items list, store management, and checkout flows replace hardcoded strings with AppLocalizations. Parameterized priceLabel(currency, amount) and storeAndPrice(store, price) format dynamic price/store text. Validation/success/error snackbars localized.
Membership and moderation screens
lib/features/membership/..., lib/features/moderation/...
Both use ArahScaffold and replace hardcoded strings with AppLocalizations. Membership uses parameterized verificationLabel(value) for verification display. Moderation localizes tooltip/decision/evidence/error text throughout.
Subscriptions, notifications, home screens
lib/features/subscriptions/..., lib/features/notifications/..., lib/features/home/...main_shell_screen.dart
All three use ArahScaffold and replace hardcoded strings with localized lookups. Subscriptions additionally uses statusLabel(status) for subscription status display and localizes plan/button/message text.
Map, onboarding, profile screens
lib/features/map/..., lib/features/onboarding/..., lib/features/profile/...
All use ArahScaffold and AppLocalizations. Map and onboarding replace hardcoded color constants (_territoryBoundaryColor, Colors.orange) with context.appColors.territoryBoundary and context.appColors.locationPin, and hardcoded map user-agent string with AppConstants.mapUserAgentPackage. Profile uses ArahBrandHeader and ArahScaffold for the logged-out state.
App router and tests
lib/app_router.dart, test/features/auth/...login_screen_test.dart, test/features/profile/...profile_screen_test.dart
Router's splash/redirect widget uses ArahScaffold. Auth and profile tests apply AppTheme.dark and update the app title assertion to "Arah".

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • sraphaz/arah#280: Both PRs modify frontend/arah.app/lib/features/moderation/presentation/screens/moderation_screen.dart around the moderation UI/tab rendering (this PR mostly localizes and swaps in ArahScaffold, while the retrieved PR refactors the screen to be tab-aware with TabController and updated item/action UI).

Poem

🐇 From "Ará" I hop to "Arah" today,
New tokens and Inter to brighten the way,
One migration to sweep old keys from the store,
A scaffold with gradients, not hardcodes anymore!
The strings speak in Portuguese and English with care,
This bunny's design system is now everywhere! 🎨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/app-design-fidelity-f45b

cursoragent and others added 2 commits June 17, 2026 09:15
- Replace Scaffold with ArahScaffold across all feature screens
- Add AppLocalizations for mapped UI strings
- Use AppConstants.mapUserAgentPackage in map and onboarding screens
- Regenerate l10n bindings for new keys

Co-authored-by: Rapha <sraphaz@users.noreply.github.com>
- Logo SVG oficial em ArahBrandHeader (flutter_svg)
- StorageMigration: araponga_* → arah_* na inicialização
- Chaves arah_* e user-agent com.arah.app
- +50 strings l10n (features, ações comuns)
- Teste de migração de território legado

Co-authored-by: Rapha <sraphaz@users.noreply.github.com>
@cursor cursor Bot marked this pull request as ready for review June 17, 2026 09:17

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (15)
frontend/arah.app/pubspec.yaml (1)

7-7: ⚠️ Potential issue | 🟠 Major

Raise the minimum Dart SDK version to match APIs already in use.

The declared constraint sdk: '>=3.2.0 <4.0.0' allows toolchains that do not support APIs used throughout the codebase. Color.withValues() (used in 18+ locations) requires Flutter 3.27.0+ (Dart 3.4.0+), and WidgetStateProperty (used in frontend/arah.app/lib/core/theme/app_theme.dart) requires Flutter 3.22.0+ (Dart 3.1.0+). Update the minimum Dart SDK constraint to reflect the actual dependency, or replace these APIs with compatible alternatives.

🤖 Prompt for 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.

In `@frontend/arah.app/pubspec.yaml` at line 7, The minimum Dart SDK version
constraint in pubspec.yaml is set to 3.2.0, but the codebase uses APIs that
require higher versions: Color.withValues() (used in 18+ locations) requires
Dart 3.4.0+, and WidgetStateProperty (used in app_theme.dart) requires Dart
3.1.0+. Update the sdk constraint line to specify a minimum version of 3.4.0 or
higher to match the actual API requirements used throughout the codebase.
frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart (1)

77-84: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Complete l10n migration for all user-facing strings in this screen.

There are still hardcoded PT strings in success/error snackbars, load-failure fallback, and asset subtitle/action feedback, which causes mixed-language output outside PT locale. Please move these to AppLocalizations keys and replace inline literals.

Also applies to: 110-113, 135-137, 170-181, 187-188

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart`
around lines 77 - 84, The assets_screen.dart file contains hardcoded Portuguese
strings in multiple locations that should be migrated to AppLocalizations for
proper localization support. Replace all hardcoded PT strings in the
showSuccessSnackBar and showErrorSnackBar calls (such as 'Asset criado.' and
'Erro ao criar asset.'), as well as the load-failure fallback text, asset
subtitle, and action feedback messages (referenced at lines 110-113, 135-137,
170-181, and 187-188) with corresponding AppLocalizations keys. Ensure
consistency by defining new l10n keys where needed and accessing them through
the AppLocalizations instance available in the build context to maintain proper
localization across all user-facing strings in this screen.
frontend/arah.app/lib/features/alerts/presentation/screens/alerts_screen.dart (1)

65-98: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Localize remaining hardcoded Portuguese strings in dialog and error states.

This screen is only partially migrated: title/description field labels, success/error snackbars, and alert-permission helper text still bypass AppLocalizations, so non-PT locales will render mixed-language UI. Please move these literals into ARB keys and consume via l10n consistently in this file.

Also applies to: 119-139

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/alerts/presentation/screens/alerts_screen.dart`
around lines 65 - 98, The alert creation dialog and related error messages
contain multiple hardcoded Portuguese strings that bypass the localization
system, causing non-Portuguese locales to display mixed-language UI. Replace all
hardcoded Portuguese literals in the alerts_screen.dart file with their
localized equivalents accessed via l10n: this includes the 'Título' and
'Descrição' TextField labels, the 'Alerta criado.' success snackbar message, the
'Erro ao criar alerta.' error message, and any alert-permission helper text
referenced in lines 119-139. Add corresponding string keys to the ARB
localization files and consume them consistently through the l10n object,
following the same pattern already used for l10n.reportAlert and l10n.cancel.
frontend/arah.app/lib/features/feed/presentation/screens/create_post_screen.dart (1)

48-49: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the remaining hardcoded strings in create-post flow.

Line 48 and Line 210 still contain hardcoded Portuguese copy. This screen otherwise uses AppLocalizations, so these should be moved to localization keys to keep locale behavior consistent.

Also applies to: 207-211

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/feed/presentation/screens/create_post_screen.dart`
around lines 48 - 49, The create_post_screen.dart file contains hardcoded
Portuguese strings in the showErrorSnackBar call around line 48 and additional
hardcoded strings around lines 207-211, which are inconsistent with the rest of
the screen that uses AppLocalizations. Replace these hardcoded Portuguese
strings with localization key references using AppLocalizations in the same
manner as other localized strings in this screen. Specifically, the error
message about choosing a territory before publishing and any other hardcoded
Portuguese copy in that area should be extracted to localization keys and
referenced through AppLocalizations.of(context) calls to maintain consistent
locale behavior throughout the create post flow.
frontend/arah.app/lib/features/chat/presentation/screens/chat_list_screen.dart (1)

54-57: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localization migration is incomplete in ChatListScreen.

There are still hardcoded Portuguese strings in the create-group dialog, tab labels, error fallback, and empty states (e.g., Line 55, Line 69, Line 78, Line 110, Line 151, Line 167). These should be moved to AppLocalizations keys to avoid mixed-language UI.

Also applies to: 69-79, 109-112, 149-169

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/chat/presentation/screens/chat_list_screen.dart`
around lines 54 - 57, The ChatListScreen contains multiple hardcoded Portuguese
strings (such as 'Nome do grupo', 'Criar grupo', 'Cancelar', etc.) scattered
across the create-group dialog, tab labels, error fallback messages, and empty
states that need to be localized. Replace all hardcoded Portuguese strings in
ChatListScreen with corresponding AppLocalizations keys using the appropriate
localization getter calls (e.g., AppLocalizations.of(context).keyName). Ensure
each hardcoded string has a matching localization key defined in the
AppLocalizations configuration, covering the dialog labels (labelText,
hintText), button labels, error messages, and empty state text throughout the
file.
frontend/arah.app/lib/features/chat/presentation/screens/chat_conversation_screen.dart (1)

39-42: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Complete localization for remaining chat UI strings.

Line 41, Line 55, and Line 99 still use hardcoded Portuguese (Erro ao enviar mensagem., Conversa, Mensagem). This leaves the screen partially untranslated for non-PT locales.

Also applies to: 54-55, 98-100

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/chat/presentation/screens/chat_conversation_screen.dart`
around lines 39 - 42, Three hardcoded Portuguese strings remain untranslated in
the chat_conversation_screen.dart file: the error message 'Erro ao enviar
mensagem.' in the showErrorSnackBar call around line 41, and the strings
'Conversa' and 'Mensagem' in the other locations mentioned. Replace each of
these hardcoded Portuguese strings with the appropriate localization function
calls that are already being used elsewhere in your codebase, ensuring
consistent translation support across all UI strings in this screen for
non-Portuguese locales.
frontend/arah.app/lib/features/feed/presentation/screens/feed_screen.dart (1)

53-54: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Finish localization in FeedScreen (empty states + filter labels).

Hardcoded Portuguese strings remain in the no-territory prompt, feed-empty prompt, and _FeedTypeFilterBar options (Line 53, Line 320, Line 325, Line 420). These should use AppLocalizations to avoid language fallback inconsistencies.

Also applies to: 320-326, 419-423

🤖 Prompt for 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.

In `@frontend/arah.app/lib/features/feed/presentation/screens/feed_screen.dart`
around lines 53 - 54, Replace all hardcoded Portuguese strings in the FeedScreen
widget with localized strings using AppLocalizations to ensure consistent
language support. Specifically, update the no-territory prompt text (the string
starting with 'Escolha um território'), the feed-empty state prompts around line
320-326, and the filter options in the _FeedTypeFilterBar widget around line
419-423 to use AppLocalizations.of(context) instead of hardcoded Portuguese
strings. Ensure all user-facing text strings use the localization service to
avoid language fallback inconsistencies.
frontend/arah.app/lib/features/connections/presentation/screens/connections_screen.dart (1)

47-55: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Finish localizing remaining user-facing text in Connections flow.

Hardcoded Portuguese is still present in snackbars, fallback errors, empty-state copy, search hints, and connection-status titles (for example Line 47, Line 75, Line 114, Line 215, Line 294). Since this screen already uses AppLocalizations, these should be migrated too.

Also applies to: 73-76, 114-115, 165-166, 188-189, 215-215, 242-243, 294-294

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/connections/presentation/screens/connections_screen.dart`
around lines 47 - 55, Replace all hardcoded Portuguese text strings with
localized strings from AppLocalizations throughout connections_screen.dart.
Specifically, update the strings in showSuccessSnackBar and showErrorSnackBar
calls (such as 'Solicitação enviada.' and 'Erro ao enviar solicitação.'), as
well as empty-state copy, search hints, and connection-status titles referenced
in the diff locations. Use AppLocalizations.of(context) to fetch the localized
strings instead of hardcoding the Portuguese text. Ensure all new string keys
are added to the localization resource files and that the pattern remains
consistent with how AppLocalizations is already being used elsewhere in the
screen.
frontend/arah.app/lib/features/map/presentation/screens/map_screen.dart (1)

242-253: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the pin-title fallback text.

At Line 252, unnamed pins fall back to 'Pin', which bypasses localization in a localized screen. Use l10n.mapPin (or a dedicated localized key) for the fallback.

Proposed patch
-            Text(
-              pin.title.isNotEmpty ? pin.title : 'Pin',
+            Text(
+              pin.title.isNotEmpty ? pin.title : AppLocalizations.of(ctx)!.mapPin,
               style: Theme.of(ctx).textTheme.titleMedium,
             ),
🤖 Prompt for 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.

In `@frontend/arah.app/lib/features/map/presentation/screens/map_screen.dart`
around lines 242 - 253, In the _onPinTap method, the fallback text for unnamed
pins uses a hardcoded string 'Pin' which bypasses the localization system.
Replace this hardcoded string with a localized key from the l10n object (such as
l10n.mapPin) to ensure the fallback text respects the app's localization
settings. The ternary expression for pin.title should use the localized key
instead of the hardcoded 'Pin' string.
frontend/arah.app/lib/features/profile/presentation/screens/profile_screen.dart (1)

314-316: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use localization for the edit-profile save error fallback.

At Line 315, 'Erro ao salvar' is hardcoded. Replace it with an l10n key to keep error messaging locale-consistent.

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/profile/presentation/screens/profile_screen.dart`
around lines 314 - 316, The hardcoded Portuguese error message 'Erro ao salvar'
in the showErrorSnackBar call within the error handling block does not use
localization, which breaks locale-consistency. Replace the hardcoded string
'Erro ao salvar' with an appropriate l10n key from your localization system
(typically accessed through context or a localization provider) to ensure the
error message respects the user's locale settings.
frontend/arah.app/lib/features/onboarding/presentation/screens/onboarding_screen.dart (1)

505-509: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Distance subtitle is still hardcoded in Portuguese.

At Line 508, km de distância is emitted directly. This should be a localized formatter (e.g., l10n.distanceKm(...)) to avoid mixed-language onboarding output.

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/onboarding/presentation/screens/onboarding_screen.dart`
around lines 505 - 509, The subtitle assignment in the onboarding screen
contains a hardcoded Portuguese text string 'km de distância' which creates
inconsistent localization. Replace the hardcoded distance string in the subtitle
property (where t.distanceKm.toStringAsFixed(1) is used) with a localized
formatter call from the l10n object that handles distance formatting according
to the current locale. This ensures the distance display is properly translated
and consistent with the rest of the onboarding output.
frontend/arah.app/lib/features/subscriptions/presentation/screens/subscriptions_screen.dart (1)

41-51: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Subscription action/error messages are still hardcoded.

User-visible strings remain hardcoded in main paths (for example: Line 50, Line 78, Line 84, Line 109, Line 114), so locale behavior is still inconsistent despite the l10n rollout.

Also applies to: 74-85, 107-115

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/subscriptions/presentation/screens/subscriptions_screen.dart`
around lines 41 - 51, Remove hardcoded user-visible strings throughout the
subscriptions_screen.dart file and replace them with localized strings from the
l10n system. Specifically, replace the hardcoded error message 'Erro ao carregar
planos.' and any other user-facing text strings (found in the error handling
paths and other locations mentioned in the review) with appropriate localization
references using the application's localization framework to ensure consistent
locale behavior across the subscription screens.
frontend/arah.app/lib/features/moderation/presentation/screens/moderation_screen.dart (1)

63-218: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Moderation screen localization is still partial.

There are still hardcoded strings in active UI paths (for example: tab labels at Line 66–68, error fallback at Line 108, action tooltips at Line 149/154/159/171/176, and action snackbar/error texts at Line 194/199/212/217).

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/moderation/presentation/screens/moderation_screen.dart`
around lines 63 - 218, The ModerationScreen has hardcoded strings throughout
multiple methods that should be localized using AppLocalizations. Replace the
hardcoded tab labels ('Fila', 'Casos', 'Evidências') in the TabBar, the error
fallback message in _buildBody, all action tooltips in _buildActions ('Baixar
evidência', 'Aprovar', 'Rejeitar'), and the snackbar messages in _decide and
_downloadEvidence methods with localized strings from the l10n object that is
already available in the context. Ensure all user-facing text uses the
AppLocalizations instance consistently across the screen.
frontend/arah.app/lib/features/marketplace/presentation/screens/marketplace_screen.dart (1)

61-310: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Marketplace localization rollout is incomplete.

Several user-visible strings are still hardcoded (for example: Line 67, Line 68, Line 134, Line 160, Line 259, Line 266, Line 309, plus multiple snackbar/error texts around Line 76–83, Line 182–188, Line 284–305). This leaves the screen mixed-language despite the l10n migration.

Suggested direction
-            Tab(text: 'Buscar'),
-            Tab(text: 'Minha loja'),
+            Tab(text: l10n.search),
+            Tab(text: l10n.myStore),

-              hintText: 'Buscar itens',
+              hintText: l10n.searchItems,

-              : 'Erro ao buscar itens.',
+              : l10n.errorSearchingItems,

Apply the same pattern to remaining hardcoded labels/snackbars in this file and add missing ARB keys where needed.

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/marketplace/presentation/screens/marketplace_screen.dart`
around lines 61 - 310, The marketplace screen contains multiple hardcoded
user-visible strings that bypass the localization system, creating an
inconsistent mixed-language experience. Replace all hardcoded strings throughout
the MarketplaceScreen, _SearchTab, _MyStoreTab, and _MyStoreTabState classes
(such as the tab labels, search placeholders, error messages, snackbar
notifications, button labels, and field labels) with corresponding l10n method
calls. For each hardcoded string, either use an existing localization method
like you already do with l10n.marketplace and l10n.noItemsFound, or add new
message keys to the ARB localization file and create corresponding methods in
the AppLocalizations class. Ensure consistency by following the same pattern
already established in the file where localized strings are retrieved and used.
frontend/arah.app/lib/features/membership/presentation/screens/membership_screen.dart (1)

62-157: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Membership screen still has non-localized user text in key paths.

Hardcoded strings remain in runtime UI/feedback (for example: Line 65, Line 114, Line 119, Line 132, Line 137, Line 142, Line 152), so locale switching will still surface Portuguese literals.

🤖 Prompt for 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.

In
`@frontend/arah.app/lib/features/membership/presentation/screens/membership_screen.dart`
around lines 62 - 157, The membership_screen.dart file contains multiple
hardcoded Portuguese strings that are not using the localization system (l10n),
preventing them from being translated when locale switches. Replace all
hardcoded user-facing strings with appropriate localization calls: the default
error message in the initial ListView when state.error is not null, the message
passed to the becomeResident method, the success and error snackbar messages in
the becomeResident callback, the error message when geoLocationStateProvider is
null in the verifyByGeo callback, the success and error snackbar messages after
verifyByGeo, and the text displayed in the else branch when isResident is true.
Add the necessary localization keys to your l10n object and use them
consistently throughout the file following the existing pattern already used
with l10n.yourRole, l10n.tryAgain, and other localized strings.
🧹 Nitpick comments (1)
frontend/arah.app/test/core/storage/storage_migration_test.dart (1)

9-20: 💤 Low value

Optional: Consider testing edge cases to improve coverage.

The test validates the happy path effectively, but you may want to add supplementary cases:

  • When the new key already exists (migration should skip copying)
  • When the legacy key is absent (removal should still succeed)
  • Idempotency: calling migration twice should be safe

These are not blockers for this PR but would strengthen test resilience against future refactors.

🤖 Prompt for 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.

In `@frontend/arah.app/test/core/storage/storage_migration_test.dart` around lines
9 - 20, Add three additional test cases to the StorageMigration test suite to
improve edge case coverage. Create a test that verifies when the new key
(AppConstants.keySelectedTerritoryId) already exists, the migration skips
copying and doesn't overwrite the existing value. Create another test that
verifies when the legacy key ('araponga_selected_territory_id') is absent, the
migration still succeeds and sets the migrated flag without errors. Finally,
create a test that verifies idempotency by calling
StorageMigration.migrateIfNeeded() twice and confirming the second call is safe
and doesn't cause issues. These supplementary tests will strengthen resilience
against future refactors of the StorageMigration logic.
🤖 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 `@frontend/arah.app/lib/core/storage/storage_migration.dart`:
- Around line 26-38: The secure storage migration in the try-catch block (lines
26-38) silently catches all exceptions but the one-time completion flag at line
47 is still being set unconditionally, which prevents retry attempts on the next
launch if the migration fails. Move the flag-setting logic that marks the
migration as complete so it only executes when the migration succeeds in the try
block, not after the catch block. This ensures that if secure storage operations
fail, the flag remains unset and the migration will be retried on the next
application launch.

In `@frontend/arah.app/lib/core/theme/app_design_tokens.dart`:
- Around line 213-214: The appColors getter in the AppColorsExtension extension
always falls back to AppColors.dark when the extension is missing, which doesn't
respect the current brightness setting and can cause visual inconsistencies in
light-theme contexts. Modify the getter to check the current brightness using
Theme.of(this).brightness or MediaQuery.of(this).platformBrightness and return
AppColors.light for light brightness or AppColors.dark for dark brightness,
ensuring the fallback is brightness-aware.

In `@frontend/arah.app/README.md`:
- Line 3: The README intro sentence on line 3 uses the Portuguese term
`território-first` which violates the repository's glossary standard for
geographic terminology. Replace `território-first` with `territory-first` to
align with the coding guidelines that mandate using the English term `territory`
as the consistent keyword for geographic areas throughout all code and
documentation.

In `@frontend/arah.app/web/manifest.json`:
- Around line 6-7: The theme_color value in the manifest.json file is set to
"`#4DD4A8`" which conflicts with the dark theme color "`#0A0E12`" defined in
index.html and used for background_color in the same manifest file. This
inconsistency can cause browser and install UI tinting to be misaligned. Change
the theme_color property value from "`#4DD4A8`" to "`#0A0E12`" to align it with the
dark web theme token used consistently throughout the application.

---

Outside diff comments:
In
`@frontend/arah.app/lib/features/alerts/presentation/screens/alerts_screen.dart`:
- Around line 65-98: The alert creation dialog and related error messages
contain multiple hardcoded Portuguese strings that bypass the localization
system, causing non-Portuguese locales to display mixed-language UI. Replace all
hardcoded Portuguese literals in the alerts_screen.dart file with their
localized equivalents accessed via l10n: this includes the 'Título' and
'Descrição' TextField labels, the 'Alerta criado.' success snackbar message, the
'Erro ao criar alerta.' error message, and any alert-permission helper text
referenced in lines 119-139. Add corresponding string keys to the ARB
localization files and consume them consistently through the l10n object,
following the same pattern already used for l10n.reportAlert and l10n.cancel.

In
`@frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart`:
- Around line 77-84: The assets_screen.dart file contains hardcoded Portuguese
strings in multiple locations that should be migrated to AppLocalizations for
proper localization support. Replace all hardcoded PT strings in the
showSuccessSnackBar and showErrorSnackBar calls (such as 'Asset criado.' and
'Erro ao criar asset.'), as well as the load-failure fallback text, asset
subtitle, and action feedback messages (referenced at lines 110-113, 135-137,
170-181, and 187-188) with corresponding AppLocalizations keys. Ensure
consistency by defining new l10n keys where needed and accessing them through
the AppLocalizations instance available in the build context to maintain proper
localization across all user-facing strings in this screen.

In
`@frontend/arah.app/lib/features/chat/presentation/screens/chat_conversation_screen.dart`:
- Around line 39-42: Three hardcoded Portuguese strings remain untranslated in
the chat_conversation_screen.dart file: the error message 'Erro ao enviar
mensagem.' in the showErrorSnackBar call around line 41, and the strings
'Conversa' and 'Mensagem' in the other locations mentioned. Replace each of
these hardcoded Portuguese strings with the appropriate localization function
calls that are already being used elsewhere in your codebase, ensuring
consistent translation support across all UI strings in this screen for
non-Portuguese locales.

In
`@frontend/arah.app/lib/features/chat/presentation/screens/chat_list_screen.dart`:
- Around line 54-57: The ChatListScreen contains multiple hardcoded Portuguese
strings (such as 'Nome do grupo', 'Criar grupo', 'Cancelar', etc.) scattered
across the create-group dialog, tab labels, error fallback messages, and empty
states that need to be localized. Replace all hardcoded Portuguese strings in
ChatListScreen with corresponding AppLocalizations keys using the appropriate
localization getter calls (e.g., AppLocalizations.of(context).keyName). Ensure
each hardcoded string has a matching localization key defined in the
AppLocalizations configuration, covering the dialog labels (labelText,
hintText), button labels, error messages, and empty state text throughout the
file.

In
`@frontend/arah.app/lib/features/connections/presentation/screens/connections_screen.dart`:
- Around line 47-55: Replace all hardcoded Portuguese text strings with
localized strings from AppLocalizations throughout connections_screen.dart.
Specifically, update the strings in showSuccessSnackBar and showErrorSnackBar
calls (such as 'Solicitação enviada.' and 'Erro ao enviar solicitação.'), as
well as empty-state copy, search hints, and connection-status titles referenced
in the diff locations. Use AppLocalizations.of(context) to fetch the localized
strings instead of hardcoding the Portuguese text. Ensure all new string keys
are added to the localization resource files and that the pattern remains
consistent with how AppLocalizations is already being used elsewhere in the
screen.

In
`@frontend/arah.app/lib/features/feed/presentation/screens/create_post_screen.dart`:
- Around line 48-49: The create_post_screen.dart file contains hardcoded
Portuguese strings in the showErrorSnackBar call around line 48 and additional
hardcoded strings around lines 207-211, which are inconsistent with the rest of
the screen that uses AppLocalizations. Replace these hardcoded Portuguese
strings with localization key references using AppLocalizations in the same
manner as other localized strings in this screen. Specifically, the error
message about choosing a territory before publishing and any other hardcoded
Portuguese copy in that area should be extracted to localization keys and
referenced through AppLocalizations.of(context) calls to maintain consistent
locale behavior throughout the create post flow.

In `@frontend/arah.app/lib/features/feed/presentation/screens/feed_screen.dart`:
- Around line 53-54: Replace all hardcoded Portuguese strings in the FeedScreen
widget with localized strings using AppLocalizations to ensure consistent
language support. Specifically, update the no-territory prompt text (the string
starting with 'Escolha um território'), the feed-empty state prompts around line
320-326, and the filter options in the _FeedTypeFilterBar widget around line
419-423 to use AppLocalizations.of(context) instead of hardcoded Portuguese
strings. Ensure all user-facing text strings use the localization service to
avoid language fallback inconsistencies.

In `@frontend/arah.app/lib/features/map/presentation/screens/map_screen.dart`:
- Around line 242-253: In the _onPinTap method, the fallback text for unnamed
pins uses a hardcoded string 'Pin' which bypasses the localization system.
Replace this hardcoded string with a localized key from the l10n object (such as
l10n.mapPin) to ensure the fallback text respects the app's localization
settings. The ternary expression for pin.title should use the localized key
instead of the hardcoded 'Pin' string.

In
`@frontend/arah.app/lib/features/marketplace/presentation/screens/marketplace_screen.dart`:
- Around line 61-310: The marketplace screen contains multiple hardcoded
user-visible strings that bypass the localization system, creating an
inconsistent mixed-language experience. Replace all hardcoded strings throughout
the MarketplaceScreen, _SearchTab, _MyStoreTab, and _MyStoreTabState classes
(such as the tab labels, search placeholders, error messages, snackbar
notifications, button labels, and field labels) with corresponding l10n method
calls. For each hardcoded string, either use an existing localization method
like you already do with l10n.marketplace and l10n.noItemsFound, or add new
message keys to the ARB localization file and create corresponding methods in
the AppLocalizations class. Ensure consistency by following the same pattern
already established in the file where localized strings are retrieved and used.

In
`@frontend/arah.app/lib/features/membership/presentation/screens/membership_screen.dart`:
- Around line 62-157: The membership_screen.dart file contains multiple
hardcoded Portuguese strings that are not using the localization system (l10n),
preventing them from being translated when locale switches. Replace all
hardcoded user-facing strings with appropriate localization calls: the default
error message in the initial ListView when state.error is not null, the message
passed to the becomeResident method, the success and error snackbar messages in
the becomeResident callback, the error message when geoLocationStateProvider is
null in the verifyByGeo callback, the success and error snackbar messages after
verifyByGeo, and the text displayed in the else branch when isResident is true.
Add the necessary localization keys to your l10n object and use them
consistently throughout the file following the existing pattern already used
with l10n.yourRole, l10n.tryAgain, and other localized strings.

In
`@frontend/arah.app/lib/features/moderation/presentation/screens/moderation_screen.dart`:
- Around line 63-218: The ModerationScreen has hardcoded strings throughout
multiple methods that should be localized using AppLocalizations. Replace the
hardcoded tab labels ('Fila', 'Casos', 'Evidências') in the TabBar, the error
fallback message in _buildBody, all action tooltips in _buildActions ('Baixar
evidência', 'Aprovar', 'Rejeitar'), and the snackbar messages in _decide and
_downloadEvidence methods with localized strings from the l10n object that is
already available in the context. Ensure all user-facing text uses the
AppLocalizations instance consistently across the screen.

In
`@frontend/arah.app/lib/features/onboarding/presentation/screens/onboarding_screen.dart`:
- Around line 505-509: The subtitle assignment in the onboarding screen contains
a hardcoded Portuguese text string 'km de distância' which creates inconsistent
localization. Replace the hardcoded distance string in the subtitle property
(where t.distanceKm.toStringAsFixed(1) is used) with a localized formatter call
from the l10n object that handles distance formatting according to the current
locale. This ensures the distance display is properly translated and consistent
with the rest of the onboarding output.

In
`@frontend/arah.app/lib/features/profile/presentation/screens/profile_screen.dart`:
- Around line 314-316: The hardcoded Portuguese error message 'Erro ao salvar'
in the showErrorSnackBar call within the error handling block does not use
localization, which breaks locale-consistency. Replace the hardcoded string
'Erro ao salvar' with an appropriate l10n key from your localization system
(typically accessed through context or a localization provider) to ensure the
error message respects the user's locale settings.

In
`@frontend/arah.app/lib/features/subscriptions/presentation/screens/subscriptions_screen.dart`:
- Around line 41-51: Remove hardcoded user-visible strings throughout the
subscriptions_screen.dart file and replace them with localized strings from the
l10n system. Specifically, replace the hardcoded error message 'Erro ao carregar
planos.' and any other user-facing text strings (found in the error handling
paths and other locations mentioned in the review) with appropriate localization
references using the application's localization framework to ensure consistent
locale behavior across the subscription screens.

In `@frontend/arah.app/pubspec.yaml`:
- Line 7: The minimum Dart SDK version constraint in pubspec.yaml is set to
3.2.0, but the codebase uses APIs that require higher versions:
Color.withValues() (used in 18+ locations) requires Dart 3.4.0+, and
WidgetStateProperty (used in app_theme.dart) requires Dart 3.1.0+. Update the
sdk constraint line to specify a minimum version of 3.4.0 or higher to match the
actual API requirements used throughout the codebase.

---

Nitpick comments:
In `@frontend/arah.app/test/core/storage/storage_migration_test.dart`:
- Around line 9-20: Add three additional test cases to the StorageMigration test
suite to improve edge case coverage. Create a test that verifies when the new
key (AppConstants.keySelectedTerritoryId) already exists, the migration skips
copying and doesn't overwrite the existing value. Create another test that
verifies when the legacy key ('araponga_selected_territory_id') is absent, the
migration still succeeds and sets the migrated flag without errors. Finally,
create a test that verifies idempotency by calling
StorageMigration.migrateIfNeeded() twice and confirming the second call is safe
and doesn't cause issues. These supplementary tests will strengthen resilience
against future refactors of the StorageMigration logic.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8242241f-80ef-46ea-8e95-a9d3f49243c3

📥 Commits

Reviewing files that changed from the base of the PR and between 3c2debe and 314ee18.

⛔ Files ignored due to path filters (1)
  • frontend/arah.app/assets/images/arah-icon.svg is excluded by !**/*.svg
📒 Files selected for processing (41)
  • frontend/arah.app/README.md
  • frontend/arah.app/lib/app.dart
  • frontend/arah.app/lib/core/config/brand_config.dart
  • frontend/arah.app/lib/core/config/constants.dart
  • frontend/arah.app/lib/core/storage/storage_migration.dart
  • frontend/arah.app/lib/core/theme/app_design_tokens.dart
  • frontend/arah.app/lib/core/theme/app_theme.dart
  • frontend/arah.app/lib/core/widgets/arah_brand_header.dart
  • frontend/arah.app/lib/core/widgets/arah_scaffold.dart
  • frontend/arah.app/lib/features/alerts/presentation/screens/alerts_screen.dart
  • frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart
  • frontend/arah.app/lib/features/auth/presentation/screens/login_screen.dart
  • frontend/arah.app/lib/features/chat/presentation/screens/chat_conversation_screen.dart
  • frontend/arah.app/lib/features/chat/presentation/screens/chat_list_screen.dart
  • frontend/arah.app/lib/features/connections/presentation/screens/connections_screen.dart
  • frontend/arah.app/lib/features/events/presentation/screens/events_screen.dart
  • frontend/arah.app/lib/features/explore/presentation/screens/explore_screen.dart
  • frontend/arah.app/lib/features/feed/presentation/screens/create_post_screen.dart
  • frontend/arah.app/lib/features/feed/presentation/screens/feed_screen.dart
  • frontend/arah.app/lib/features/feed/presentation/widgets/feed_post_card.dart
  • frontend/arah.app/lib/features/home/presentation/screens/main_shell_screen.dart
  • frontend/arah.app/lib/features/map/presentation/screens/map_screen.dart
  • frontend/arah.app/lib/features/marketplace/presentation/screens/marketplace_screen.dart
  • frontend/arah.app/lib/features/membership/presentation/screens/membership_screen.dart
  • frontend/arah.app/lib/features/moderation/presentation/screens/moderation_screen.dart
  • frontend/arah.app/lib/features/notifications/presentation/screens/notifications_screen.dart
  • frontend/arah.app/lib/features/onboarding/presentation/screens/onboarding_screen.dart
  • frontend/arah.app/lib/features/profile/presentation/screens/profile_screen.dart
  • frontend/arah.app/lib/features/subscriptions/presentation/screens/subscriptions_screen.dart
  • frontend/arah.app/lib/l10n/app_en.arb
  • frontend/arah.app/lib/l10n/app_localizations.dart
  • frontend/arah.app/lib/l10n/app_localizations_en.dart
  • frontend/arah.app/lib/l10n/app_localizations_pt.dart
  • frontend/arah.app/lib/l10n/app_pt.arb
  • frontend/arah.app/lib/main.dart
  • frontend/arah.app/pubspec.yaml
  • frontend/arah.app/test/core/storage/storage_migration_test.dart
  • frontend/arah.app/test/features/auth/presentation/login_screen_test.dart
  • frontend/arah.app/test/features/profile/presentation/profile_screen_test.dart
  • frontend/arah.app/web/index.html
  • frontend/arah.app/web/manifest.json

Comment on lines +26 to +38
try {
for (final pair in _secureKeyPairs) {
final legacyValue = await secureStorage.read(key: pair.legacy);
if (legacyValue == null) continue;
final currentValue = await secureStorage.read(key: pair.current);
if (currentValue == null) {
await secureStorage.write(key: pair.current, value: legacyValue);
}
await secureStorage.delete(key: pair.legacy);
}
} catch (_) {
// Secure storage indisponível (ex.: testes unitários sem plugin).
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don’t finalize migration after a secure-storage failure.

Line 47 sets the one-time flag even when Lines 26-38 catch secure-storage errors. That prevents retry on next launch and can leave legacy auth keys unmigrated, causing avoidable session loss.

Suggested patch
-    try {
+    var secureMigrationSucceeded = true;
+    try {
       for (final pair in _secureKeyPairs) {
         final legacyValue = await secureStorage.read(key: pair.legacy);
         if (legacyValue == null) continue;
         final currentValue = await secureStorage.read(key: pair.current);
         if (currentValue == null) {
           await secureStorage.write(key: pair.current, value: legacyValue);
         }
         await secureStorage.delete(key: pair.legacy);
       }
     } catch (_) {
       // Secure storage indisponível (ex.: testes unitários sem plugin).
+      secureMigrationSucceeded = false;
     }
@@
-    await prefs.setBool(_migrationFlag, true);
+    if (secureMigrationSucceeded) {
+      await prefs.setBool(_migrationFlag, true);
+    }

Also applies to: 47-47

🤖 Prompt for 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.

In `@frontend/arah.app/lib/core/storage/storage_migration.dart` around lines 26 -
38, The secure storage migration in the try-catch block (lines 26-38) silently
catches all exceptions but the one-time completion flag at line 47 is still
being set unconditionally, which prevents retry attempts on the next launch if
the migration fails. Move the flag-setting logic that marks the migration as
complete so it only executes when the migration succeeds in the try block, not
after the catch block. This ensures that if secure storage operations fail, the
flag remains unset and the migration will be retried on the next application
launch.

Comment on lines 213 to +214
extension AppColorsExtension on BuildContext {
AppColors get appColors => Theme.of(this).extension<AppColors>()!;
AppColors get appColors => Theme.of(this).extension<AppColors>() ?? AppColors.dark;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make the appColors fallback respect current brightness.

Line 214 always returns AppColors.dark when the extension is missing, which can invert semantics in light-theme contexts. Prefer a brightness-aware fallback.

Proposed fix
 extension AppColorsExtension on BuildContext {
-  AppColors get appColors => Theme.of(this).extension<AppColors>() ?? AppColors.dark;
+  AppColors get appColors {
+    final theme = Theme.of(this);
+    return theme.extension<AppColors>() ??
+        (theme.brightness == Brightness.dark ? AppColors.dark : AppColors.light);
+  }
 }
📝 Committable suggestion

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

Suggested change
extension AppColorsExtension on BuildContext {
AppColors get appColors => Theme.of(this).extension<AppColors>()!;
AppColors get appColors => Theme.of(this).extension<AppColors>() ?? AppColors.dark;
extension AppColorsExtension on BuildContext {
AppColors get appColors {
final theme = Theme.of(this);
return theme.extension<AppColors>() ??
(theme.brightness == Brightness.dark ? AppColors.dark : AppColors.light);
}
}
🤖 Prompt for 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.

In `@frontend/arah.app/lib/core/theme/app_design_tokens.dart` around lines 213 -
214, The appColors getter in the AppColorsExtension extension always falls back
to AppColors.dark when the extension is missing, which doesn't respect the
current brightness setting and can cause visual inconsistencies in light-theme
contexts. Modify the getter to check the current brightness using
Theme.of(this).brightness or MediaQuery.of(this).platformBrightness and return
AppColors.light for light brightness or AppColors.dark for dark brightness,
ensuring the fallback is brightness-aware.

# Arah (App Flutter)

App mobile **território-first** e **comunidade-first**. Nome: **Ará**. Interface clean, fundo escuro padrão. Conecta ao **BFF** do repositório.
App mobile **território-first** e **comunidade-first**. Marca: **Arah**. Interface alinhada ao design system (fundo escuro, tipografia Inter, tokens compartilhados). Conecta ao **BFF** do repositório.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use territory terminology in the intro sentence.

Line 3 uses território-first, which breaks the repository glossary standard for geographic terminology in documentation.

Suggested patch
-App mobile **território-first** e **comunidade-first**. Marca: **Arah**. Interface alinhada ao design system (fundo escuro, tipografia Inter, tokens compartilhados). Conecta ao **BFF** do repositório.
+App mobile **territory-first** e **comunidade-first**. Marca: **Arah**. Interface alinhada ao design system (fundo escuro, tipografia Inter, tokens compartilhados). Conecta ao **BFF** do repositório.

As per coding guidelines, use 'territory' (not 'place', 'location', or other variations) as the consistent term for geographic areas in all code and documentation.

📝 Committable suggestion

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

Suggested change
App mobile **território-first** e **comunidade-first**. Marca: **Arah**. Interface alinhada ao design system (fundo escuro, tipografia Inter, tokens compartilhados). Conecta ao **BFF** do repositório.
App mobile **territory-first** e **comunidade-first**. Marca: **Arah**. Interface alinhada ao design system (fundo escuro, tipografia Inter, tokens compartilhados). Conecta ao **BFF** do repositório.
🤖 Prompt for 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.

In `@frontend/arah.app/README.md` at line 3, The README intro sentence on line 3
uses the Portuguese term `território-first` which violates the repository's
glossary standard for geographic terminology. Replace `território-first` with
`territory-first` to align with the coding guidelines that mandate using the
English term `territory` as the consistent keyword for geographic areas
throughout all code and documentation.

Source: Coding guidelines

Comment on lines +6 to +7
"background_color": "#0A0E12",
"theme_color": "#4DD4A8",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align theme_color with the dark web theme token.

Line 7 (#4DD4A8) conflicts with the dark theme-color used in web/index.html (Line 27, #0A0E12), which can produce inconsistent browser/install UI tinting.

Suggested patch
-    "theme_color": "`#4DD4A8`",
+    "theme_color": "`#0A0E12`",
📝 Committable suggestion

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

Suggested change
"background_color": "#0A0E12",
"theme_color": "#4DD4A8",
"background_color": "`#0A0E12`",
"theme_color": "`#0A0E12`",
🤖 Prompt for 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.

In `@frontend/arah.app/web/manifest.json` around lines 6 - 7, The theme_color
value in the manifest.json file is set to "`#4DD4A8`" which conflicts with the
dark theme color "`#0A0E12`" defined in index.html and used for background_color
in the same manifest file. This inconsistency can cause browser and install UI
tinting to be misaligned. Change the theme_color property value from "`#4DD4A8`"
to "`#0A0E12`" to align it with the dark web theme token used consistently
throughout the application.

- Localize remaining hardcoded strings across all feature screens
- Add 90+ l10n keys (comments, chat, marketplace, connections, etc.)
- Use ArahScaffold on splash redirect screen
- Rebrand Ará → Arah in app docs and run-app-local script

Co-authored-by: Rapha <sraphaz@users.noreply.github.com>
@cursor cursor Bot merged commit 4704a61 into main Jun 17, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants