User-created checklists: authoring, sharing, admin-promotion to global #61

Open
opened 2026-05-20 12:15:13 +00:00 by mAi · 3 comments
Collaborator

Trigger

m 2026-05-20 14:14:

Another bigger feature: we should allow users to create their own checklists, share them and admins should be able to make them global.

Current state (verify in design)

  • paliad.checklists (the template catalog) + paliad.checklist_instances (per-Akte instances) exist; see internal/db/migrations/014_checklist_instances.up.sql for instance shape. Checklists today are pre-defined / global; users instantiate them on Akten / projects.
  • Sharing model: visibility today follows the parent project's can_see predicate; no peer-to-peer template sharing.
  • Admin role: global_admin can edit any checklist; no project-scoped Admin yet (separate issue #48 covers project-Admin role).

What m wants

1. User-authored checklists

  • A user (any non-global_admin) can create a checklist template they own — title, sections, items, completion semantics. Lives in the same table or a parallel personal-scoped one.
  • Author has full edit / delete authority on their templates.

2. Sharing

  • The author can share a personal checklist with: specific colleagues (by user picker), a project team, an Office, the whole firm.
  • Recipients see the shared template in their checklist catalog with attribution to the author.
  • Sharing is read-only by default; the author retains edit authority.

3. Admin promotion to global

  • global_admin (or a future paliad admin) can mark a personal checklist as global — promotes it into the firm-wide catalog where everyone sees it.
  • Original author retains attribution + edit authority by default; admin can transfer ownership if needed.
  • Once promoted, removing the global flag downgrades but doesn't delete (preserves continuity for existing instances using it).

Design considerations

  • Storage model:
    • Add owner_id uuid NULL to paliad.checklists (NULL = legacy/global; non-NULL = user-authored).
    • Add visibility text enum: private (author only) / shared (explicit recipients) / firm (entire firm) / global (firm catalog promoted by admin).
    • Sharing recipients: new join table paliad.checklist_shares(checklist_id, user_id|office_key|partner_unit_id|project_id, granted_by, granted_at).
  • RLS: extend checklists_select policy: row visible iff author=caller OR visibility='global'/'firm' OR row is in checklist_shares with caller's user/office/unit/project ancestry.
  • Instance lifecycle: when a shared/promoted checklist instance exists on an Akte and the template's visibility narrows (e.g. author unshares from a colleague who instantiated it earlier), the instance is NOT retroactively hidden — it's user data on that Akte, decoupled from template visibility.
  • UI:
    • 'My Checklists' section on a user's profile or in /tools/checklists
    • 'Create checklist' wizard (sections, items, optional reorder, completion-marks-as-complete-rule)
    • 'Share' modal on a checklist's detail page
    • 'Make global' button visible only to global_admin on a shared checklist's detail page
  • Audit: emit events: checklist_authored, checklist_shared, checklist_promoted_global, checklist_demoted.
  • Versioning: edits to a personal template propagate to existing instances? Or instances snapshot the template at creation time? Design call — snapshot is safer for instance integrity, propagation is more 'live'. Inventor recommends snapshot.
  • Discoverability: a 'browse' / 'gallery' surface where users can find shared firm-wide templates. Could ship in Slice B.

Slice plan (inventor sketch)

  • Slice A: schema + owner/visibility on existing table + 'My Checklists' authoring + private/visible-to-firm options. No share-to-individual yet.
  • Slice B: explicit sharing to user / office / partner-unit / project. Promotion to global.
  • Slice C: discoverability gallery + versioning controls.

Out of scope

  • Importing checklists from external sources (Notion, Trello, etc.).
  • Approval-policy gating on checklist edits.
  • Cross-firm template marketplace.

Role recommendation

inventor → coder — significant schema additions + RLS + multi-axis sharing + UI surfaces. Design pass before code. Branch: mai/<inventor>/user-checklists.

## Trigger m 2026-05-20 14:14: > Another bigger feature: we should allow users to create their own checklists, share them and admins should be able to make them global. ## Current state (verify in design) - `paliad.checklists` (the template catalog) + `paliad.checklist_instances` (per-Akte instances) exist; see `internal/db/migrations/014_checklist_instances.up.sql` for instance shape. Checklists today are pre-defined / global; users instantiate them on Akten / projects. - Sharing model: visibility today follows the parent project's `can_see` predicate; no peer-to-peer template sharing. - Admin role: `global_admin` can edit any checklist; no project-scoped Admin yet (separate issue #48 covers project-Admin role). ## What m wants ### 1. User-authored checklists - A user (any non-`global_admin`) can create a checklist template they own — title, sections, items, completion semantics. Lives in the same table or a parallel personal-scoped one. - Author has full edit / delete authority on their templates. ### 2. Sharing - The author can share a personal checklist with: specific colleagues (by user picker), a project team, an Office, the whole firm. - Recipients see the shared template in their checklist catalog with attribution to the author. - Sharing is read-only by default; the author retains edit authority. ### 3. Admin promotion to global - `global_admin` (or a future paliad admin) can mark a personal checklist as **global** — promotes it into the firm-wide catalog where everyone sees it. - Original author retains attribution + edit authority by default; admin can transfer ownership if needed. - Once promoted, removing the global flag downgrades but doesn't delete (preserves continuity for existing instances using it). ## Design considerations - **Storage model**: - Add `owner_id uuid NULL` to `paliad.checklists` (NULL = legacy/global; non-NULL = user-authored). - Add `visibility text` enum: `private` (author only) / `shared` (explicit recipients) / `firm` (entire firm) / `global` (firm catalog promoted by admin). - Sharing recipients: new join table `paliad.checklist_shares(checklist_id, user_id|office_key|partner_unit_id|project_id, granted_by, granted_at)`. - **RLS**: extend `checklists_select` policy: row visible iff author=caller OR visibility='global'/'firm' OR row is in checklist_shares with caller's user/office/unit/project ancestry. - **Instance lifecycle**: when a shared/promoted checklist instance exists on an Akte and the template's visibility narrows (e.g. author unshares from a colleague who instantiated it earlier), the instance is NOT retroactively hidden — it's user data on that Akte, decoupled from template visibility. - **UI**: - 'My Checklists' section on a user's profile or in /tools/checklists - 'Create checklist' wizard (sections, items, optional reorder, completion-marks-as-complete-rule) - 'Share' modal on a checklist's detail page - 'Make global' button visible only to `global_admin` on a shared checklist's detail page - **Audit**: emit events: `checklist_authored`, `checklist_shared`, `checklist_promoted_global`, `checklist_demoted`. - **Versioning**: edits to a personal template propagate to existing instances? Or instances snapshot the template at creation time? **Design call** — snapshot is safer for instance integrity, propagation is more 'live'. Inventor recommends snapshot. - **Discoverability**: a 'browse' / 'gallery' surface where users can find shared firm-wide templates. Could ship in Slice B. ## Slice plan (inventor sketch) - Slice A: schema + owner/visibility on existing table + 'My Checklists' authoring + private/visible-to-firm options. No share-to-individual yet. - Slice B: explicit sharing to user / office / partner-unit / project. Promotion to global. - Slice C: discoverability gallery + versioning controls. ## Out of scope - Importing checklists from external sources (Notion, Trello, etc.). - Approval-policy gating on checklist edits. - Cross-firm template marketplace. ## Role recommendation **inventor → coder** — significant schema additions + RLS + multi-axis sharing + UI surfaces. Design pass before code. Branch: `mai/<inventor>/user-checklists`.
mAi self-assigned this 2026-05-20 12:15:13 +00:00
Author
Collaborator

Slice A shipped via dirac; merged at https://mgit.msbls.de/m/paliad/commit/b418705. Personal authoring + private/firm visibility live after Dokploy deploy. Slices B (sharing) + C (gallery/versioning) follow.

Slice A shipped via dirac; merged at https://mgit.msbls.de/m/paliad/commit/b418705. Personal authoring + private/firm visibility live after Dokploy deploy. Slices B (sharing) + C (gallery/versioning) follow.
Author
Collaborator

Slice B shipped via dirac; merged at https://mgit.msbls.de/m/paliad/commit/b850eb7. Sharing + admin promotion live after Dokploy deploys. Slice C (gallery + versioning) remaining.

Slice B shipped via dirac; merged at https://mgit.msbls.de/m/paliad/commit/b850eb7. Sharing + admin promotion live after Dokploy deploys. Slice C (gallery + versioning) remaining.
Author
Collaborator

Slice C shipped via dirac; merged at https://mgit.msbls.de/m/paliad/commit/15ce176. m/paliad#61 complete (Slices A + B + C). Live after Dokploy deploys.

Slice C shipped via dirac; merged at https://mgit.msbls.de/m/paliad/commit/15ce176. m/paliad#61 complete (Slices A + B + C). Live after Dokploy deploys.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#61
No description provided.