feat(desktop): 7.16 CLS client UX — level badges, folder-create picker, share-dialog eligibility (cross-stack) #207

Closed
opened 2026-11-16 12:59:33 +01:00 by amiryahaya · 2 comments
Owner

Scope (CLS-08 / F-CLS1–3 desktop rendering)

The server contract is fully in place (PRs #203–#205 + the 7.16 server-contract PR): file/folder DTOs carry level {id,name,rank}, GET /api/tenants/{id}/classification returns enabled + ladder + caller's clearance, GET /api/tenants/{id}/members carries per-member clearance, and POST /api/shares/group takes per-member encrypted keys.

What remains is desktop rendering — and it is cross-stack:

  1. Level badges on rows — the desktop file list flows through Rust commands (list_files etc.) into a local SQLite cache (storage/database.rs), then to the UI. Carrying level through = Rust FileItem struct + cache-schema migration (ALTER/add column + sync mapping) + types/index.ts + FileGridView/list badge. The cache migration touches EXISTING installs — needs the #203-class discipline (migration tests on the local-DB path).
  2. Folder-create picker — create_folder Rust command + frontend dialog gains a level select (ladder + own clearance from the new classification GET; cap at own clearance per F-CLS1).
  3. Share-dialog eligibility pre-filter (F-CLS2) — recipient search is a Rust command (search_recipients); extend its result shape with clearance so ineligible rows render disabled-with-reason. Server denial rendering (F-CLS6, inline classification_insufficient reason) is already achievable frontend-only — do it first.
  4. Upload raise-only override (F-CLS1) — upload_file Rust command + multipart form field; inherited-level display via badges.

Suggested order

Frontend-first quick win: (3)'s inline-denial rendering — no Rust. Then the Rust/cache work as one focused session (badges + picker + override together — they share the cache migration).

Server contract PRs: #203/#204/#205 + the 7.16 server-contract PR. Related: #202 (test-infra seam), epic #158.

## Scope (CLS-08 / F-CLS1–3 desktop rendering) The **server contract is fully in place** (PRs #203–#205 + the 7.16 server-contract PR): file/folder DTOs carry `level {id,name,rank}`, `GET /api/tenants/{id}/classification` returns enabled + ladder + caller's clearance, `GET /api/tenants/{id}/members` carries per-member clearance, and `POST /api/shares/group` takes per-member encrypted keys. What remains is desktop rendering — and it is **cross-stack**: 1. **Level badges on rows** — the desktop file list flows through Rust commands (`list_files` etc.) into a **local SQLite cache** (`storage/database.rs`), then to the UI. Carrying `level` through = Rust `FileItem` struct + cache-schema migration (ALTER/add column + sync mapping) + `types/index.ts` + `FileGridView`/list badge. The cache migration touches EXISTING installs — needs the #203-class discipline (migration tests on the local-DB path). 2. **Folder-create picker** — `create_folder` Rust command + frontend dialog gains a level select (ladder + own clearance from the new classification GET; cap at own clearance per F-CLS1). 3. **Share-dialog eligibility pre-filter** (F-CLS2) — recipient search is a Rust command (`search_recipients`); extend its result shape with clearance so ineligible rows render disabled-with-reason. Server denial rendering (F-CLS6, inline `classification_insufficient` reason) is already achievable frontend-only — do it first. 4. **Upload raise-only override** (F-CLS1) — `upload_file` Rust command + multipart form field; inherited-level display via badges. ## Suggested order Frontend-first quick win: (3)'s inline-denial rendering — no Rust. Then the Rust/cache work as one focused session (badges + picker + override together — they share the cache migration). Server contract PRs: #203/#204/#205 + the 7.16 server-contract PR. Related: #202 (test-infra seam), epic #158.
Author
Owner

Session decisions + tracked follow-ups from the align-then-adorn campaign (2026-11-16):

Decisions

  • SQLite cache slice skipped (user decision): file_cache/folder_cache have no writer in the live flow — migrating a dead schema is busywork. Badges flow from the live FileItem instead. Cache wiring deferred to the offline-mode effort.
  • Planned public-keys endpoint NOT needed: GET /api/users/{id}/public-key + GET /api/users/{id}/kem-public-key already existed (Identity/Users, deliberately cross-tenant, tested in UserTests/AuthzMatrixTests) — the original exploration missed them. D1b consumes them as-is.
  • Contract drift found and fixed in this campaign: the desktop file/share stack was built against speculative March-era routes (list/upload/download/share create all called endpoints that never existed or mismatched shapes). Fixed in #210 (server DTO exposure + level) → #211 (desktop file stack) → #212 (desktop share flow).

Tracked follow-ups

  • Pre-existing dead/wrong desktop calls NOT in the file/share path: move_item (PUT /files/{id}/move — no route; dev-plan 7.4), get_storage_info (GET /storage/info — no route; 7.6), get_preview (GET /files/{id}/preview — no route; 7.8), delete_item routes folders through DELETE /files/{id} (folders need DELETE /folders/{id}).
  • invitationStore doubles /api in its fetch URL (same pattern memberStore had) — pre-existing, fix with the invitation work.
  • Server ListMembers projection has no email — share picking matches on name/role only; consider adding Email to the projection for share UX.
  • PublicKeys bundle schema is free-form (UpdateKeys) — pin the schema (doc + serde defaults done client-side in #212) so clients converge; lands with dev-plan 2.5.
  • TenantRootFolderResolver can auto-create a keyless/level-less root AFTER classification enable (S1 review finding #2) — new-tenant ordering gap, needs a tracked slice.
  • Share dialog niceties for D2: self-filter (current user appears as candidate), roster freshness (loads once per session).
  • E2EE chunked-flow rows (wrapped_dek/kem_ciphertext) have no DEK triple — desktop download of such rows fails with an explicit message until the chunked upload flow (7.1 remainder) lands.
  • Roster/in-repo hygiene: stale vitest-scanned worktree under .claude/worktrees/jolly-vaughan fails transforms in full runs.

Remainder of 7.1 (unchanged scope): iOS + File Provider migration, golden contract fixtures beyond the pinned surfaces, chunked-upload flow for desktop.

Session decisions + tracked follow-ups from the align-then-adorn campaign (2026-11-16): **Decisions** - **SQLite cache slice skipped** (user decision): file_cache/folder_cache have no writer in the live flow — migrating a dead schema is busywork. Badges flow from the live FileItem instead. Cache wiring deferred to the offline-mode effort. - **Planned public-keys endpoint NOT needed**: GET /api/users/{id}/public-key + GET /api/users/{id}/kem-public-key already existed (Identity/Users, deliberately cross-tenant, tested in UserTests/AuthzMatrixTests) — the original exploration missed them. D1b consumes them as-is. - **Contract drift found and fixed in this campaign**: the desktop file/share stack was built against speculative March-era routes (list/upload/download/share create all called endpoints that never existed or mismatched shapes). Fixed in #210 (server DTO exposure + level) → #211 (desktop file stack) → #212 (desktop share flow). **Tracked follow-ups** - Pre-existing dead/wrong desktop calls NOT in the file/share path: move_item (PUT /files/{id}/move — no route; dev-plan 7.4), get_storage_info (GET /storage/info — no route; 7.6), get_preview (GET /files/{id}/preview — no route; 7.8), delete_item routes folders through DELETE /files/{id} (folders need DELETE /folders/{id}). - invitationStore doubles /api in its fetch URL (same pattern memberStore had) — pre-existing, fix with the invitation work. - Server ListMembers projection has no email — share picking matches on name/role only; consider adding Email to the projection for share UX. - PublicKeys bundle schema is free-form (UpdateKeys) — pin the schema (doc + serde defaults done client-side in #212) so clients converge; lands with dev-plan 2.5. - TenantRootFolderResolver can auto-create a keyless/level-less root AFTER classification enable (S1 review finding #2) — new-tenant ordering gap, needs a tracked slice. - Share dialog niceties for D2: self-filter (current user appears as candidate), roster freshness (loads once per session). - E2EE chunked-flow rows (wrapped_dek/kem_ciphertext) have no DEK triple — desktop download of such rows fails with an explicit message until the chunked upload flow (7.1 remainder) lands. - Roster/in-repo hygiene: stale vitest-scanned worktree under .claude/worktrees/jolly-vaughan fails transforms in full runs. **Remainder of 7.1** (unchanged scope): iOS + File Provider migration, golden contract fixtures beyond the pinned surfaces, chunked-upload flow for desktop.
Author
Owner

All slices landed — closing.

  • #210 — server contract exposure (DTO names/mime/DEK-wrap triple, level everywhere) + CLS-06 per-row listing filter + ContractPinningTests
  • #211 — desktop file stack on the live API (listing, multipart upload, raw-stream download, folder keys, PATCH rename)
  • #212 — desktop share flow (id-based recipients, server request shape, real public-key lookups, dead-call sweep)
  • #213 — CLS-08 client UX: LevelBadge (F-CLS3), classificationStore, folder-create picker + upload override sheet (F-CLS1), share eligibility with reasons (F-CLS2), F-CLS6 inline denials everywhere

CLS-08 acceptance: "All four surfaces render per policy; ineligible targets show the reason inline" — met, with the classification-off zero-delta preserved on every surface.

Now tracked elsewhere (see the 2026-11-16 decisions comment + dev plan):

  • Task 7.1 remainder: iOS/File Provider migration, chunked-upload flow for desktop (E2EE-chunked rows not downloadable yet), golden fixtures beyond the pinned surfaces
  • Dev-plan 2.5: folder-key distribution (desktop's derive_folder_kek fallback) + PublicKeys schema pin
  • Dead routes: move_item (7.4), storage-info (7.6), preview (7.8); folders delete via the wrong route
  • invitationStore /api doubling; ListMembers email projection; resolver ordering gap
  • #202 test-infra seam

Next per the codified cadence: M8/#158 milestone-close ponytail audit (7.14–7.16 are now code-complete).

**All slices landed — closing.** - #210 — server contract exposure (DTO names/mime/DEK-wrap triple, `level` everywhere) + CLS-06 per-row listing filter + ContractPinningTests - #211 — desktop file stack on the live API (listing, multipart upload, raw-stream download, folder keys, PATCH rename) - #212 — desktop share flow (id-based recipients, server request shape, real public-key lookups, dead-call sweep) - #213 — CLS-08 client UX: LevelBadge (F-CLS3), classificationStore, folder-create picker + upload override sheet (F-CLS1), share eligibility with reasons (F-CLS2), F-CLS6 inline denials everywhere CLS-08 acceptance: "All four surfaces render per policy; ineligible targets show the reason inline" — met, with the classification-off zero-delta preserved on every surface. **Now tracked elsewhere** (see the 2026-11-16 decisions comment + dev plan): - Task 7.1 remainder: iOS/File Provider migration, chunked-upload flow for desktop (E2EE-chunked rows not downloadable yet), golden fixtures beyond the pinned surfaces - Dev-plan 2.5: folder-key distribution (desktop's `derive_folder_kek` fallback) + PublicKeys schema pin - Dead routes: move_item (7.4), storage-info (7.6), preview (7.8); folders delete via the wrong route - invitationStore /api doubling; ListMembers email projection; resolver ordering gap - #202 test-infra seam Next per the codified cadence: **M8/#158 milestone-close ponytail audit** (7.14–7.16 are now code-complete).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
primatekuntech/failsulit#207
No description provided.