Skip to content

feat(regulations): secret drafts in the dashboard - #175

Merged
lorenzocorallo merged 1 commit into
mainfrom
feat/regulations-secret-drafts
Nov 23, 2026
Merged

lorenzocorallo merged 1 commit into
mainfrom
feat/regulations-secret-drafts

Conversation

@lorenzocorallo

Copy link
Copy Markdown
Member

What

The dashboard side of secret drafts (PoliNetworkOrg/backend#155): drafts only their creator and the members they add can see, until the creator makes them visible to regulations:read (the Direttivo).

  • Nuova bozza asks "Chi la vede": Visibile or Segreta. From a secret draft the new one is secret too, and the dialog says so.
  • Procedura: an info alert explains who sees it; the steps stay disabled (the reason is the alert, the buttons keep it as hint); the creator gets Rendi visibile (confirmation, irreversible) → drafts.reveal via revealDraft (regulationsAssigneeMiddleware, the backend decides).
  • Segreta mark (DraftSecretMark) in Bozze, document page, editor and procedure headers.
  • Membri: the dialog's description reflects the secret draft, and the creator's row is fixed ("Editor, l'ha creata").
  • Contract copy updated from backend#155; agent-mode fake applies the same rules, with two secret samples (the agent's, shared with one Socio, and the Presidente's, never visible to the agent).

Docs: docs/regulations/README.md (Access › Secret drafts, agent mode), AGENTS.md.

Checks

pnpm check, pnpm typecheck, pnpm test, pnpm build. Verified in agent mode (server-rendered pages): the agent's secret draft is listed with "Segreta" and the procedure page shows the alert and "Rendi visibile"; the Presidente's secret draft isn't listed.

Merge after backend#155 is deployed: the contract requires secret and can.reveal in responses.

"Nuova bozza" asks who sees the draft: visible (regulations:read and the
members) or secret, seen only by its creator and the members they add,
whatever their permissions. The procedure page explains it, keeps the steps
disabled and offers "Rendi visibile" to the creator (drafts.reveal, for
good); lists and headers mark it "Segreta", and the members dialog keeps the
creator as editor. Agent mode serves the same rules and two secret samples.

Needs PoliNetworkOrg/backend#155 (contract copy).
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d1a171ab-4443-40a5-bf7f-0222c1ec22d1
Commits

Reviewing files that changed from the base of the PR and between 605c503 and d30f86a.

Files selected for processing: 14

  • AGENTS.md
  • docs/regulations/README.md
  • src/features/regulations/document-page.tsx
  • src/features/regulations/drafts-page.tsx
  • src/features/regulations/editor/editor-page.tsx
  • src/features/regulations/members-dialog.tsx
  • src/features/regulations/new-draft-dialog.tsx
  • src/features/regulations/procedure-page.tsx
  • src/features/regulations/regulations-draft.functions.ts
  • src/features/regulations/regulations-ui.tsx
  • src/features/regulations/regulations.api.server.ts
  • src/features/regulations/regulations.contract.ts
  • src/features/regulations/regulations.fake.server.ts
  • tests/server-security.test.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@lorenzocorallo
lorenzocorallo merged commit ad4c99a into main Nov 23, 2026
2 checks passed
@lorenzocorallo
lorenzocorallo deleted the feat/regulations-secret-drafts branch November 23, 2026 19:53
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