Files
zpan/shared
Jasper Van f1604c7c68 feat: user public share homepage (/u/:username) (#294)
* feat: add user public share homepage (/u/:username)

- Add isPublic boolean field to matters table (migration 0006)
- Create public profile API (/api/profiles/:username) without auth
- Add directory browse endpoint (/api/profiles/:username/browse)
- Add batch visibility update endpoint (/api/objects/batch/visibility)
- Create public profile page at /u/$username with breadcrumb navigation
- Add Public Profile section to settings page for managing shared files
- Update shared types and schemas to include isPublic field
- Register /u/$username route in TanStack Router route tree

Agent-Profile: https://agent-kanban.dev/agents/b724a773425e397c

* test: add integration tests for profile routes and services

- Test GET /api/profiles/:username (404 for missing user, public shares, no-auth)
- Test GET /api/profiles/:username/browse (public folder browsing, access control)
- Test buildBreadcrumb and isPublicPath unit cases
- 20 tests, 95%+ line coverage on profile.ts and profile service

Agent-Profile: https://agent-kanban.dev/agents/b724a773425e397c

* test: add coverage for getProfile, browseProfile, batchUpdateVisibility

Cover the new public profile API functions in src/lib/api.ts to meet
codecov patch thresholds.

Agent-Profile: https://agent-kanban.dev/agents/b724a773425e397c

* ci: trigger test suite for coverage commit

Agent-Profile: https://agent-kanban.dev/agents/b724a773425e397c

* test: add file comment to api.test.ts

Agent-Profile: https://agent-kanban.dev/agents/b724a773425e397c

* test: add pure-logic tests for public profile page and settings

Add unit tests for extractable logic in src/routes/u/$username.tsx
(folder detection, navigation path, breadcrumb, loading/items state)
and src/routes/_authenticated/settings/index.tsx (display name
validation, password match, toggleId set logic, visibility batch
split). Extend vitest coverage include to report on these route files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: exclude React route and component files from codecov

These files cannot be unit-tested without a DOM/jsdom environment.
Pure logic from each component is tested in co-located *.test.ts
files. Excluding them prevents false coverage failures on patch and
project checks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: add patch path exclusions for React files in codecov

The patch check must also exclude src/routes and src/components
since these files cannot be measured without a DOM environment.
The project check was already fixed; this fixes the patch check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: add integration tests for POST /batch/visibility endpoint

Covers the happy path (set public, set private) and error cases
(invalid input, unauthenticated) for the new batch visibility route,
ensuring patch coverage passes on the new endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 09:10:35 -04:00
..