Skip to content

feat: per-user approval settings and content item deletion#8

Merged
iabouhashish merged 8 commits intomainfrom
feat/ui-improvements
Apr 2, 2026
Merged

feat: per-user approval settings and content item deletion#8
iabouhashish merged 8 commits intomainfrom
feat/ui-improvements

Conversation

@iabouhashish
Copy link
Copy Markdown
Collaborator

Summary

Per-user Settings (My Settings tab)

  • New "My Settings" tab in the Settings page — users can override the global approval gate for their own jobs
  • Toggle between on/off/default with a "Reset to global default" button when an override is active
  • Shows a loading skeleton during fetch, disables controls while saving, shows error/success toasts

Content Item Deletion

  • Uploaded content items in the Content Library now show a delete icon button
  • Clicking opens a confirmation dialog before permanently removing the item via the API
  • Only visible for items with extractable UUID file IDs; scraped/synced content is unaffected

Under the hood

  • New TypeScript types: UserSettings, UserSettingsResponse
  • New API methods: getUserSettings, updateUserSettings, deleteContentItem
  • New hooks: useUserSettings, useUpdateUserSettings, useDeleteContentItem

Test Coverage

CODE PATH COVERAGE
═══════════════════════════════
API methods (3/3):
  [★★★ TESTED] getUserSettings — api.test.ts
  [★★★ TESTED] updateUserSettings — api.test.ts
  [★★★ TESTED] deleteContentItem — api.test.ts

Hooks (6/6):
  [★★★ TESTED] useUserSettings (calls API, retry:false) — useUserSettingsAndContent.test.ts
  [★★★ TESTED] useUpdateUserSettings (calls API, invalidates query, error path) — useUserSettingsAndContent.test.ts
  [★★★ TESTED] useDeleteContentItem (calls API, invalidates content-sources, error path) — useUserSettingsAndContent.test.ts

Coverage gate: PASS (~77%)

Tests: 54 → 68 (+14 new across 2 files)

Pre-Landing Review

4 issues found, all auto-fixed:

  • content-list.tsx:50 — typo /release_notess//release_notes/ (would never match)
  • settings/page.tsx:109 — removed non-functional indeterminate prop from MUI Switch
  • content-list.tsx:34 — UUID regex /i flag removed (enforces lowercase, prevents 404s on case-sensitive storage)
  • content-list.tsx:121 — silent catch block → showErrorToast('Failed to delete item')

Design Review

Frontend files changed — design review (lite) applied. Findings:

  • Colors match design system (#E8A238 hover, #C45C3B sienna for destructive, #1A1713 dialog background, Instrument Serif for dialog title, Geist for body)
  • No issues found.

Greptile Review

No Greptile comments.

Plan Completion

No plan file detected.

Verification Results

No dev server detected — skipping plan verification.

Test plan

  • All Jest tests pass (12 suites, 68 tests)
  • Verify "My Settings" tab appears in Settings page
  • Verify approval toggle saves and resets correctly
  • Verify delete button appears on uploaded content items
  • Verify delete confirmation dialog works (cancel + confirm)
  • Verify error toast appears when delete fails

🤖 Generated with Claude Code

iabouhashish and others added 8 commits April 2, 2026 16:55
New TypeScript types (UserSettings, UserSettingsResponse) and API methods
for per-user settings (GET/PUT /v1/users/me/settings) and content item
deletion (DELETE /v1/content/{contentType}/{fileId}).

New hooks: useUserSettings, useUpdateUserSettings, useDeleteContentItem.
Uploaded content items now show a delete icon button. Clicking it opens a
confirmation dialog before permanently removing the item via the API.
Deletion only shown for items with extractable UUID file IDs (uploaded files).

Fixes: UUID regex now enforces lowercase, error toast on delete failure,
and typo fix in release_notes path check.
New MySettingsPanel component and tab in Settings. Users can toggle their
personal require_approval override (on/off) or reset to the global default.
Shows loading skeleton during fetch, disables controls during save.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- settings/page.test.tsx: mock useUserSettings + useUpdateUserSettings so
  MySettingsPanel renders without hitting the real API
- setup.ts: suppress MUI anchorEl warning (jsdom has no layout engine) and
  the intentional getPipelineSettings fallback warn (test mock rejects by design)
@iabouhashish iabouhashish merged commit b8d56e6 into main Apr 2, 2026
3 checks passed
@iabouhashish iabouhashish deleted the feat/ui-improvements branch April 2, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant