feat(sharing): settings toggle + global shared-sessions list #203

Merged
dries merged 3 commits from feat/share-settings-toggle into main 2026-07-03 10:22:15 +02:00
Owner

Summary

  • Add a Sharing settings section with a master toggle (on by default) that gates public share-link creation. When off, POST /api/session/{id}/share returns 403; existing links keep working until revoked.
  • Add a global shared-sessions list (GET /api/shares) so every active share link can be found, inspected (jump to the session), copied, and revoked from one place.

Implementation

  • Reuses the existing native share-link system; new sharing_enabled key in the setting table (absent = on).
  • Backend: ListAllActiveShareLinks, handleSharingSetting, handleAllShares, create-handler guard.
  • Frontend: SharingSettings component + api methods; revoke reuses the per-session endpoint.

Testing

  • Go: toggle+guard and global-list handler tests.
  • Frontend: SharingSettings.test.tsx (toggle persist/revert, list + revoke).
  • go test, go vet, pnpm lint, tsc, platform-branching check all pass.
## Summary - Add a **Sharing** settings section with a master toggle (on by default) that gates public share-link creation. When off, `POST /api/session/{id}/share` returns 403; existing links keep working until revoked. - Add a global shared-sessions list (`GET /api/shares`) so every active share link can be found, inspected (jump to the session), copied, and revoked from one place. ## Implementation - Reuses the existing native share-link system; new `sharing_enabled` key in the `setting` table (absent = on). - Backend: `ListAllActiveShareLinks`, `handleSharingSetting`, `handleAllShares`, create-handler guard. - Frontend: `SharingSettings` component + api methods; revoke reuses the per-session endpoint. ## Testing - Go: toggle+guard and global-list handler tests. - Frontend: `SharingSettings.test.tsx` (toggle persist/revert, list + revoke). - `go test`, `go vet`, `pnpm lint`, `tsc`, platform-branching check all pass.
feat(sharing): settings toggle + global shared-sessions list
All checks were successful
CI / Frontend (pull_request) Successful in 4m15s
CI / Backend (pull_request) Successful in 4m55s
CI / Playwright E2E (pull_request) Successful in 7m3s
CI / Build (pull_request) Successful in 3m33s
CI / Coverage Ratchet (pull_request) Successful in 5m26s
CI / Build Desktop (macOS arm64) (pull_request) Successful in 58s
CI / Semantic Tag (pull_request) Has been skipped
eb1b601d58
Add a "Sharing" settings section with a master toggle (on by default)
that gates share-link creation, plus a list of every active public
share link so they can be found, inspected, copied, and revoked in one
place.

Coverage ratchet: pass

Suite Baseline This PR Δ
go 69.50% 69.50% +0.00
frontend 58.56% 58.55% -0.01

Tolerance: -0.1%. Baseline stored on gh-pages.

<!-- coverage-ratchet --> ### Coverage ratchet: ✅ pass | Suite | Baseline | This PR | Δ | | |---|---|---|---|---| | go | 69.50% | 69.50% | +0.00 | ✅ | | frontend | 58.56% | 58.55% | -0.01 | ✅ | _Tolerance: -0.1%. Baseline stored on `gh-pages`._
feat(ui): show save status on every settings field
Some checks failed
CI / Frontend (pull_request) Successful in 4m31s
CI / Backend (pull_request) Successful in 4m33s
CI / Build Desktop (macOS arm64) (pull_request) Successful in 1m1s
CI / Playwright E2E (pull_request) Failing after 8m20s
CI / Build (pull_request) Successful in 4m30s
CI / Semantic Tag (pull_request) Has been skipped
CI / Coverage Ratchet (pull_request) Successful in 6m21s
37dc20fdc3
Extend the spinner/checkmark save indicator to all settings rows, not
just the two server-persisted ones. New <SettingRow> + <SettingToggle> /
<SettingNumber> components own the save-and-show-status flow so a field
cannot be added without its feedback; a check-settings-rows guard (wired
into make lint + CI) fails on hand-rolled settings-row markup.
test(e2e): stub sharing + remote settings endpoints
All checks were successful
CI / Frontend (pull_request) Successful in 4m24s
CI / Backend (pull_request) Successful in 5m3s
CI / Build Desktop (macOS arm64) (pull_request) Successful in 1m1s
CI / Playwright E2E (pull_request) Successful in 7m6s
CI / Build (pull_request) Successful in 3m39s
CI / Semantic Tag (pull_request) Has been skipped
CI / Coverage Ratchet (pull_request) Successful in 5m29s
8b0750ac88
SharingSettings (new in this PR) and the existing RemoteSettings both
fetch on mount from the Settings tab. Those routes were unmocked in the
e2e fixtures, so under an auth-required run they proxied to the absent
backend, returned 401, and flipped the auth store to unauthenticated —
unmounting the Settings page mid-test and breaking the Account/Sign-out
auth specs (the Playwright E2E CI failure on this PR).

Stub /api/settings/sharing, /api/shares, /api/settings/remote-access,
and /api/remotes so the Settings tab stays mounted.
dries merged commit 69724b50e6 into main 2026-07-03 10:22:15 +02:00
Sign in to join this conversation.
No description provided.