feat(admin/contagens): nova-contagem form with topology + flow diagram - #161
Open
iacapuca wants to merge 2 commits into
Open
feat(admin/contagens): nova-contagem form with topology + flow diagram#161iacapuca wants to merge 2 commits into
iacapuca wants to merge 2 commits into
Conversation
…trix A counts page is rarely a single number — at a junction, every from→to movement matters. This page captures that, plus all the existing per-count fields. UI-only for now; the data layer is a follow-up (the would-be payload is logged on submit). Local section - Tabs to either pick an existing point or describe a new one. - Topology picker: Ponto (2 sentidos) / Junção em T (3) / Cruzamento (4), rendered as visual options with thumbnail SVGs. - Approach inputs: 2/3/4 unlabelled fields the user names freely. - Live static SVG diagram showing the topology with the user's labels and per-leg approach volume (sum of movements leaving that leg). Resultados section - Square movement matrix (NxN with the diagonal greyed out): inputs for every from→to pair excluding U-turns. 2/6/12 entries depending on topology. - Total de ciclistas is derived from the matrix (read-only badge). - Pico em 1h stays a manual input. Other sections - Sessão (date, start_time, end_time), Características (14 fields grouped into perfil/comportamento/modal/ambiente), Observações. - Inline validation surfaces only after first submit attempt; toast on validation error; success toast logs the structured payload. shadcn primitives added - label, textarea, select, popover, command, sonner, dialog (transitive). - Toaster mounted in the admin layout (light theme; site is light-only). - next-themes pulled in by sonner was removed; Toaster hardcoded. Misc - "Nova contagem" button on /admin/contagens now links to the new page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous arrow rendering looked busy — heavy strokes, oversized arrowheads, and the per-leg sigma duplicated the matrix. - Cubic bezier per movement with tangents along source/destination leg axes, so straights render straight, right-turns curve gently, and left-turns swing wide. - Thin strokes (1.0-2.6 px) with subtle log-based magnitude scaling. - Tiny arrowheads (5x5 marker), brand-teal at 70% opacity. - Count labels at curve midpoint, 9 px with background halo. - Dropped redundant per-leg outgoing total (matrix is the truth). - Softer roads (lighter opacity, slightly wider so curves don't hide). - Skip rendering count=0 movements to keep the diagram quiet until data is entered. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
/admin/contagens/nova— a form to register a new contagem. UI-only for this PR (the would-be payload is logged on submit; data layer is a follow-up).Local section
Resultados section
total_cyclistsderived from the matrix (read-only badge)max_hour_cyclistsstays a manual inputOther sections
shadcn primitives added
label,textarea,select,popover,command,sonner,dialog(transitive). Toaster mounted in admin layout (light theme —next-themeswas pulled and removed; site is light-only).Misc
/admin/contagensnow links to the new page.Test plan
pnpm buildsucceedspnpm install --frozen-lockfilesucceeds🤖 Generated with Claude Code