-
Notifications
You must be signed in to change notification settings - Fork 1
feat(app): design system Arah + rebrand Ará → Arah #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
efa61de
3a27dcc
314ee18
e42c5a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Mapa e pins – App Ará | ||
| # Mapa e pins – App Arah | ||
|
|
||
| Implementação e opções de tiles (OpenStreetMap, Mapbox). | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Documentação do app Ará | ||
| # Documentação do app Arah | ||
|
|
||
| Documentação interna do app Flutter (frontend/Arah.app). | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /// Marca e metadados do ecossistema Arah (espelho de frontend/shared/config/brand.ts). | ||
| class BrandConfig { | ||
| BrandConfig._(); | ||
|
|
||
| static const String name = 'Arah'; | ||
| static const String tagline = 'Território primeiro. Comunidade primeiro.'; | ||
| static const String description = | ||
| 'Plataforma digital comunitária orientada ao território.'; | ||
| static const String siteUrl = 'https://arah.app'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import 'package:flutter_secure_storage/flutter_secure_storage.dart'; | ||
| import 'package:shared_preferences/shared_preferences.dart'; | ||
|
|
||
| import '../config/constants.dart'; | ||
|
|
||
| /// Migra chaves legadas `araponga_*` para `arah_*` (uma vez por instalação). | ||
| class StorageMigration { | ||
| StorageMigration._(); | ||
|
|
||
| static const _migrationFlag = 'arah_storage_migrated_v1'; | ||
|
|
||
| static const _secureKeyPairs = <({String legacy, String current})>[ | ||
| (legacy: 'araponga_access_token', current: AppConstants.keyAccessToken), | ||
| (legacy: 'araponga_refresh_token', current: AppConstants.keyRefreshToken), | ||
| (legacy: 'araponga_token_expiry', current: AppConstants.keyTokenExpiry), | ||
| ]; | ||
|
|
||
| static Future<void> migrateIfNeeded() async { | ||
| final prefs = await SharedPreferences.getInstance(); | ||
| if (prefs.getBool(_migrationFlag) == true) return; | ||
|
|
||
| const secureStorage = FlutterSecureStorage( | ||
| aOptions: AndroidOptions(encryptedSharedPreferences: 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). | ||
| } | ||
|
Comment on lines
+26
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
|
|
||
| const legacyTerritoryKey = 'araponga_selected_territory_id'; | ||
| final legacyTerritory = prefs.getString(legacyTerritoryKey); | ||
| if (legacyTerritory != null && prefs.getString(AppConstants.keySelectedTerritoryId) == null) { | ||
| await prefs.setString(AppConstants.keySelectedTerritoryId, legacyTerritory); | ||
| } | ||
| await prefs.remove(legacyTerritoryKey); | ||
|
|
||
| await prefs.setBool(_migrationFlag, true); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
territoryterminology in the intro sentence.Line 3 uses
território-first, which breaks the repository glossary standard for geographic terminology in documentation.Suggested patch
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
🤖 Prompt for AI Agents
Source: Coding guidelines