feat(flutter): WA-E4 UX curadoria de corpos d'água - #465
Conversation
Permite sugerir type=natural+subtype no app com copy de cuidado, lista/curadoria contextual e subtítulo hídrico no mapa. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Steward — Apontamentos de botsRegra obrigatóriaTodo apontamento de bot deve ser resolvido ou respondido antes de merge. Não deixar threads abertas em arquivos alterados neste PR. Checklist
Como resolver./scripts/agents/arah-agents.ps1 bot-review -PrNumber <N>
./scripts/agents/arah-agents.ps1 pr-ready -PrNumber <N>Merge
Automático via Status: CI OK — revisar checklist |
|
Warning Review limit reached
Next review available in: 35 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThe Flutter asset flow now supports water-body creation, subtype classification, localized curation actions, and map-pin subtitles. Asset models, creation APIs, localization resources, map presentation, and WA-E4 documentation were updated. ChangesWater-body curation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant AssetsScreen
participant AssetsNotifier
participant AssetsRepository
participant MapScreen
participant AppLocalizations
AssetsScreen->>AssetsNotifier: Create water-body with subtype
AssetsNotifier->>AssetsRepository: Send optional subtype
AssetsRepository-->>AssetsNotifier: Return asset result
AssetsNotifier-->>AssetsScreen: Refresh asset list
MapScreen->>AppLocalizations: Resolve localized water-body pin label
AppLocalizations-->>MapScreen: Return pin subtitle
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
QA Agent — ChecklistRevise este PR conforme docs/21_CODE_REVIEW.md e docs/22_COHESION_AND_TESTS.md. Arquitetura
Testes
UI (se aplicável)
PR
Automático via Status gates: ✅ Gates automáticos passaram |
Security Agent — RelatórioDependências
Secrets
LGPD / dados sensíveis
Bloqueio recomendado
Automático via |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54331e46fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await ref.read(assetsProvider.notifier).createAsset( | ||
| name: name, | ||
| type: 'natural', | ||
| subtype: waterSubtype, | ||
| ); |
There was a problem hiding this comment.
Bypass the cached list after creating a water body
With the default BFF configuration, opening this screen caches the GET assets?territoryId=... response for 60 seconds, while the subsequent POST does not invalidate that cache. AssetsNotifier.createAsset then calls refresh(), which receives the cached pre-creation list, so a successfully created water body disappears from the UI until the cache expires and another refresh occurs. Preserve the returned item in state, invalidate the assets cache after mutations, or otherwise force an uncached refresh.
Useful? React with 👍 / 👎.
| if (ctx.mounted) { | ||
| Navigator.pop(ctx); | ||
| showSuccessSnackBar( | ||
| ctx, | ||
| asWaterBody ? l10n.waterBodySuggested : l10n.assetCreated, | ||
| ); |
There was a problem hiding this comment.
Report missing geolocation instead of claiming creation
When location permission is denied or the position has not loaded, AssetsNotifier.createAsset returns early because geo == null; it does not throw or create anything. This branch nevertheless closes the dialog and shows waterBodySuggested, causing the user to lose their input and believe the water body was registered. Gate submission on an available location or make the notifier report failure before showing success.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart (1)
52-159: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winDispose the dialog controllers.
Lines 54 and 55 create
TextEditingControllerinstances that are never disposed. Repeated dialog use keeps their listeners and state alive after the dialog closes.Wrap
showDialogintry/finallyand dispose bothnameControllerandtypeControllerinfinally.🤖 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 52 - 159, Update _showCreateDialog to wrap the await showDialog call in a try/finally block, and dispose nameController and typeController in the finally block so both controllers are released after the dialog closes or fails.
🧹 Nitpick comments (1)
frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart (1)
190-202: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the raw fixed height.
Line 191 uses
height: 240. Use a semantic layout token or token-based padding instead of an arbitrary pixel value.As per coding guidelines, “Use design tokens for spacing and typography, following the 8px spacing scale; do not use arbitrary pixel values.”
🤖 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 190 - 202, Replace the raw height value in the no-assets empty-state layout around the Text widget with a semantic design token or token-based spacing that follows the established 8px scale. Preserve the centered, padded message layout and reuse an existing AppConstants token rather than introducing an arbitrary pixel value.Source: Coding guidelines
🤖 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 `@docs/backlog-api/CORPOS_DAGUA_TERRITORIO.md`:
- Line 85: Update the WA-E4 entry to replace “pin mapa” with “subtítulo do pin
mapa” or explicitly reference WA-E2 for map-pin ownership, while preserving the
existing Flutter create/list/curate and NaturalAsset details.
In `@docs/CHANGELOG.md`:
- Around line 12-16: Update the `Última Atualização` changelog footer date from
2026-08-05 to 2026-08-10, leaving the surrounding changelog entries unchanged.
In `@frontend/arah.app/lib/features/assets/data/models/asset_item.dart`:
- Around line 50-54: The water-body kind resolution must accept only allowlisted
values. In
frontend/arah.app/lib/features/assets/data/models/asset_item.dart#L50-L54,
update AssetItem.waterBodyKind to return the normalized subtype only when it
appears in kWaterBodySubtypeValues, otherwise fall back to the normalized legacy
type only when that type is allowlisted. In
frontend/arah.app/lib/features/map/presentation/screens/map_screen.dart#L398-L405,
resolve an allowlisted normalized MapPin.assetSubtype first, then an allowlisted
normalized assetType so blank or invalid subtypes do not block the fallback.
In
`@frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart`:
- Around line 256-262: Update _assetSubtitle to localize asset.status before
constructing base, mapping every supported backend status to its corresponding
AppLocalizations key while preserving a fallback for unknown values. Keep the
existing kind and validation metadata formatting unchanged.
- Around line 121-153: Update the create dialog’s FilledButton handler to track
an in-flight submission state, disable the button while createAsset is awaiting,
and restore the enabled state only when the request fails. Keep the existing
success flow, including closing the dialog, unchanged; apply this behavior to
both water-body and regular asset creation paths.
---
Outside diff comments:
In
`@frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart`:
- Around line 52-159: Update _showCreateDialog to wrap the await showDialog call
in a try/finally block, and dispose nameController and typeController in the
finally block so both controllers are released after the dialog closes or fails.
---
Nitpick comments:
In
`@frontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dart`:
- Around line 190-202: Replace the raw height value in the no-assets empty-state
layout around the Text widget with a semantic design token or token-based
spacing that follows the established 8px scale. Preserve the centered, padded
message layout and reuse an existing AppConstants token rather than introducing
an arbitrary pixel value.
🪄 Autofix
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 Plus
Run ID: e16596ed-10f5-407d-ab50-9a8b815abe2b
📒 Files selected for processing (15)
docs/CHANGELOG.mddocs/STATUS_FASES.mddocs/_meta/PHASE_QUEUE.yamldocs/backlog-api/CORPOS_DAGUA_TERRITORIO.mddocs/specs/features/water-bodies-curation.spec.yamlfrontend/arah.app/lib/features/assets/data/models/asset_item.dartfrontend/arah.app/lib/features/assets/data/repositories/assets_repository.dartfrontend/arah.app/lib/features/assets/presentation/providers/assets_provider.dartfrontend/arah.app/lib/features/assets/presentation/screens/assets_screen.dartfrontend/arah.app/lib/features/map/presentation/screens/map_screen.dartfrontend/arah.app/lib/l10n/app_en.arbfrontend/arah.app/lib/l10n/app_localizations.dartfrontend/arah.app/lib/l10n/app_localizations_en.dartfrontend/arah.app/lib/l10n/app_localizations_pt.dartfrontend/arah.app/lib/l10n/app_pt.arb
Agente acionado: Spec Steward (SDD)ID: Verificações automáticas de conduta✅ Guardrail no_merge Conduta compartilhadaConduta comum (todos os agentes)
Checklist do agenteSpec Steward (SDD) — Checklist de condutaEscopo permitido
Antes do PR (spec-before-code)
Skills (ordem sugerida)
Aderência
Proibido
Skills sugeridas (ordem)
Manifest
Visível via |
Agente acionado: Flutter AgentID: Verificações automáticas de conduta✅ Guardrail no_merge Conduta compartilhadaConduta comum (todos os agentes)
Checklist do agenteFlutter Agent — Checklist de condutaEscopo permitido
Antes do PR
Skills (ordem sugerida)
Proibido
Skills sugeridas (ordem)
Manifest
Visível via |
Agente acionado: Review / QA AgentID: Verificações automáticas de conduta✅ Guardrail no_merge Conduta compartilhadaConduta comum (todos os agentes)
Checklist do agenteQA Agent — Checklist de condutaPapel
Checklist de review
Skills
ReferênciaSkills sugeridas (ordem)
Manifest
Visível via |
Agente acionado: PR Steward (Review & Merge)ID: Verificações automáticas de conduta✅ Guardrail no_merge Conduta compartilhadaConduta comum (todos os agentes)
Checklist do agentePR Steward — Checklist de condutaObrigatório antes de merge
Skills
ReferênciaSkills sugeridas (ordem)
Manifest
Visível via |
Parecer de domínio: Domain — Mapa, Lugares & Assets TerritoriaisID: Enriquecimento (negócio)O mapa é a leitura do território real: entidades de mapa e assets curados Validar no PR
Arquivos relacionados
Referências
Autonomia via coreografia ( |
Parecer de domínio: Domain — Design & Experiência (UX/UI)ID: Enriquecimento (negócio)Design de baixa excitação, silêncio funcional e ação consciente — território Validar no PR
Arquivos relacionados
Referências
Autonomia via coreografia ( |
Orquestrador Arah — PRAgente principal: Agentes por paths alterados:
Pareceres de domínio: QA agent revisará este PR (checklist em Use .agents/templates/pr-body.md no corpo do PR. Automático via |
Dispose dos controllers, submit guard, status localizado, allowlist de kind e docs. Co-authored-by: Cursor <cursoragent@cursor.com>
initialValue não existe no SDK do job CI / Flutter app. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
natural+ subtype) com linguagem de cuidado; lista/curadoria contextualSpec-Id:
water-bodies-curationTest plan
dart analyzeassets + map_screenflutter gen-l10nMade with Cursor
Summary by CodeRabbit
New Features
Documentation