feat(desktop): 7.16 CLS client UX — badges, pickers, eligibility (#207) #213

Merged
amiryahaya merged 1 commit from feat/desk-cls-client-ux into main 2026-11-17 07:20:20 +01:00
Owner

D2 — the final slice of #207 (CLS-08): the four classification surfaces on the aligned stack from #210–#212.

LevelBadge (F-CLS3): rank→color chip (gray/blue/orange/red) with dark variants, text label always rendered (never color alone, a11y), null-safe — zero-delta when classification is off. On FilesPage table rows, FileGridView cards, FavoritesPage rows.

classificationStore (new): direct-fetch GET /api/tenants/{id}/classification (memberStore pattern), per-tenant cache; helpers expose the ladder + caller clearance (null reads Internal, CLS-02). FilesPage loads it imperatively — no reactive-dep retry loops, tenant switches reload. Cleared on logout (my_clearance is caller-specific).

Folder-create picker (F-CLS1): level Select (default Internal, capped at the creator's clearance, hidden entirely when classification is off); classification_insufficient denials render inline with the #208 audit-footnote treatment.

Upload override sheet (F-CLS1): new UploadLevelSheet — picked files park until it commits; shows the inherited folder level + raise-only override capped at clearance. Classification OFF → no sheet, immediate inherit (CLS-01 zero-delta). Tray quick-upload stays dialog-free and inherits (server-gated). Folder level rides a FolderInfo.level envelope addition (additive Rust change). Upload denials render INLINE on the sheet with the audit footnote and the sheet stays open for retry (F-CLS6).

Share eligibility (F-CLS2): recipients render eligible / ineligible (disabled, struck-through, "requires {level} clearance — {name} is {their level | unclassified}"); null clearance reads Internal; the current user is excluded; the hard slice cap removed; the server re-check stays the authority (races → existing F-CLS6 inline).

Correctness fix riding along: shareDialogItem on FilesPage/FavoritesPage now carries level + encrypted_file_key — D1b shares were silently receiving neither.

Also untracks the stray session-plan file #211 accidentally shipped.

Tests: classificationStore (5), LevelBadge (7), UploadLevelSheet (7 — raise-only window, inherit-null, inline denial, uploading-disabled), ShareDialog eligibility (5 new, 23 total), CreateFolderDialog picker cap + F-CLS6 footnote (3 new, 13 total), memberStore clearance expectations. Gates: tsc clean, vitest 1333 green (84 files), cargo 68 green, gitleaks clean on production paths.

Review: dual-pass done. Pass 2 caught: the sheet shipping unconditionally (zero-delta violation — fixed: classification-off commits immediately), upload denials toast-only (F-CLS6 violation — fixed: inline on the sheet), the caller-specific cache surviving logout (fixed: cleared), and the untested fourth surface (fixed: suite added).

Closes the last slice of #207. With this, 7.14–7.16 (M8/#158) are code-complete pending the milestone-close audit.

Related: #207, #158, #210, #211, #212.

D2 — the final slice of #207 (CLS-08): the four classification surfaces on the aligned stack from #210–#212. **LevelBadge (F-CLS3)**: rank→color chip (gray/blue/orange/red) with dark variants, text label always rendered (never color alone, a11y), null-safe — zero-delta when classification is off. On FilesPage table rows, FileGridView cards, FavoritesPage rows. **classificationStore** (new): direct-fetch GET /api/tenants/{id}/classification (memberStore pattern), per-tenant cache; helpers expose the ladder + caller clearance (null reads Internal, CLS-02). FilesPage loads it imperatively — no reactive-dep retry loops, tenant switches reload. Cleared on logout (my_clearance is caller-specific). **Folder-create picker (F-CLS1)**: level Select (default Internal, capped at the creator's clearance, hidden entirely when classification is off); classification_insufficient denials render inline with the #208 audit-footnote treatment. **Upload override sheet (F-CLS1)**: new UploadLevelSheet — picked files park until it commits; shows the inherited folder level + raise-only override capped at clearance. Classification OFF → no sheet, immediate inherit (CLS-01 zero-delta). Tray quick-upload stays dialog-free and inherits (server-gated). Folder level rides a FolderInfo.level envelope addition (additive Rust change). Upload denials render INLINE on the sheet with the audit footnote and the sheet stays open for retry (F-CLS6). **Share eligibility (F-CLS2)**: recipients render eligible / ineligible (disabled, struck-through, "requires {level} clearance — {name} is {their level | unclassified}"); null clearance reads Internal; the current user is excluded; the hard slice cap removed; the server re-check stays the authority (races → existing F-CLS6 inline). **Correctness fix riding along**: shareDialogItem on FilesPage/FavoritesPage now carries level + encrypted_file_key — D1b shares were silently receiving neither. Also untracks the stray session-plan file #211 accidentally shipped. **Tests**: classificationStore (5), LevelBadge (7), UploadLevelSheet (7 — raise-only window, inherit-null, inline denial, uploading-disabled), ShareDialog eligibility (5 new, 23 total), CreateFolderDialog picker cap + F-CLS6 footnote (3 new, 13 total), memberStore clearance expectations. Gates: tsc clean, vitest 1333 green (84 files), cargo 68 green, gitleaks clean on production paths. **Review**: dual-pass done. Pass 2 caught: the sheet shipping unconditionally (zero-delta violation — fixed: classification-off commits immediately), upload denials toast-only (F-CLS6 violation — fixed: inline on the sheet), the caller-specific cache surviving logout (fixed: cleared), and the untested fourth surface (fixed: suite added). Closes the last slice of #207. With this, 7.14–7.16 (M8/#158) are code-complete pending the milestone-close audit. Related: #207, #158, #210, #211, #212.
feat(desktop): 7.16 CLS client UX — badges, pickers, eligibility (#207)
All checks were successful
Desktop CI / lint-and-test (pull_request) Successful in 2m36s
Security CI / security-scan (pull_request) Successful in 2m46s
d13dfddd98
D2, the final slice of #207 (CLS-08): the four classification surfaces
land on the aligned stack from #210–#212.

- LevelBadge (F-CLS3): rank→color chip (gray/blue/orange/red) with dark
  variants, text label always rendered (never color alone), null-safe —
  rendered zero-delta when classification is off. On FilesPage table
  rows, FileGridView cards, and FavoritesPage rows.
- classificationStore (new): direct-fetch GET /api/tenants/{id}/
  classification (memberStore pattern), cached per tenant; exposes the
  ladder + caller clearance (null clearance reads Internal, CLS-02).
- Folder-create picker (F-CLS1): CreateFolderDialog gains a level Select
  (default Internal, capped at the creator's clearance, hidden entirely
  when classification is off); classification_insufficient denials
  render inline with the #208 audit-footnote treatment.
- Upload override sheet (F-CLS1): new UploadLevelSheet — picked files
  park until the sheet commits; shows the inherited folder level with a
  raise-only override capped at clearance (folder rank delivered via a
  FolderInfo.level envelope addition). Tray quick-upload stays
  dialog-free and inherits (server-gated).
- Share eligibility (F-CLS2): recipients render eligible / ineligible
  (disabled, struck-through, reason "requires {level} clearance — {name}
  is {their level | unclassified}"); null clearance reads Internal; the
  current user is excluded from candidates; the server re-check stays
  the authority (races surface the existing F-CLS6 inline rendering).
- shareDialogItem on FilesPage/FavoritesPage now carries level +
  encrypted_file_key — D1b shares were receiving neither (correctness
  fix riding along).

Tests: classificationStore (5), LevelBadge (7), ShareDialog eligibility
(5 new, 23 total), CreateFolderDialog picker cap + F-CLS6 footnote (3
new, 13 total), memberStore adapted expectations gain clearance. Full
gates: tsc clean, vitest 1326 green, cargo 68 green, local gitleaks
clean on production paths.
Sign in to join this conversation.
No description provided.