Skip to content

feat(ui): cruscotto regionale /regione (#231, F4) - #247

Merged
gzileni merged 1 commit into
mainfrom
feat/region-ui-231
Jul 21, 2026
Merged

feat(ui): cruscotto regionale /regione (#231, F4)#247
gzileni merged 1 commit into
mainfrom
feat/region-ui-231

Conversation

@gzileni

@gzileni gzileni commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

F4: la UI del cruscotto per l'ente regionale, che consuma gli endpoint F2/F3.

/regione (dietro DashboardGate)

  • KPI: comuni totali/valutati, maturità mediana ODM, comuni maturi.
  • Distribuzione per stato (zero dati → maturo) come barra + legenda colorata.
  • «Dove intervenire»: comuni senza dati / deboli + dimensioni ODM deboli.
  • Classifica comuni (stato + punteggio ODM) e priorità regionali di pubblicazione (idee F3).
  • Drill-down: ogni comune → /copilota#<istat>; la pagina Copilota ora legge l'hash, precompila il codice ISTAT e avvia la diagnosi (nessun useSearchParams/Suspense — funziona in static export).
  • Voce «Regione» in APP_NAV.

Docs (R14)

README: nuova sezione «Cruscotto regionale» (Cos'è / Come funziona / A cosa serve) → rimanda a docs/cruscotto-regionale.md.

Verifica

tsc pulito · next build static export 29 pagine (incl. /regione) · next lint senza errori.

Parte di #227 · prossime F5 (#232 vista pubblica) e F6 (#233 trend).

🤖 Generated with Claude Code

Landing per l'ente regionale che consuma /regione/overview|comuni|idee:
- KPI (comuni valutati/totali, maturità mediana, comuni maturi);
- barra distribuzione per stato (zero→maturo) + legenda;
- 'dove intervenire' (comuni/dimensioni) con drill-down;
- classifica comuni (stato + ODM) e priorità regionali di pubblicazione (idee).
Drill-down comune → /copilota#<istat> (la pagina Copilota legge l'hash, precompila
e avvia la diagnosi). Voce 'Regione' in APP_NAV. README: sezione cruscotto (R14).
tsc + next build (29 pagine, incl. /regione) + lint OK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19b514df9f

ℹ️ 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".


export default function Page() {
return (
<DashboardGate>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict the regional dashboard by role

In auth-enabled deployments, wrapping this new regional dashboard only in DashboardGate makes it available to any signed-in account; I checked that DashboardGate only verifies SignedIn, while the RBAC model defines regione/comune roles for cruscotto views and the non-public /regione/* data includes detailed municipal rankings and intervention targets. Since this is the ente-regionale view rather than the planned public subset, a cittadino or comune user can open it directly (and it is also linked from the signed-in nav).

Useful? React with 👍 / 👎.

</tr>
</thead>
<tbody>
{comuni.slice(0, 30).map((c) => (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve access to all municipalities

For any region with more than 30 comuni, this truncates the backend's complete ranked list without pagination or search, so municipalities below the first page cannot be reached from the dashboard's drill-down links; because the API sorts by descending ODM, the hidden rows are often the weakest/unassessed municipalities that regional users need to inspect. Render the full list or add paging/filtering instead of dropping the remaining rows client-side.

Useful? React with 👍 / 👎.

@gzileni
gzileni merged commit dba4ca1 into main Jul 21, 2026
27 checks passed
@gzileni
gzileni deleted the feat/region-ui-231 branch July 21, 2026 17:11
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.

1 participant