Skip to content

feat(webapp): path-based tab routing, upload badges, badge filters, and sort-by-size#659

Merged
camathieu merged 7 commits into
masterfrom
feat/url-routing-tabs
Mar 2, 2026
Merged

feat(webapp): path-based tab routing, upload badges, badge filters, and sort-by-size#659
camathieu merged 7 commits into
masterfrom
feat/url-routing-tabs

Conversation

@camathieu
Copy link
Copy Markdown
Member

@camathieu camathieu commented Mar 1, 2026

Description

What

New webapp features for upload management (badges, filters, sorting, URL state), plus UI polish and a critical bug fix for stream + E2EE downloads.

Why

Improve upload browsing in home/admin views with badge filters, sorting, and URL-synced state. Fix streaming + E2EE downloads which were completely broken (wrong endpoint + content-length mismatch).

Commits

  • b7116129 feat(webapp): sync home/admin tab and filter state with URL query params
  • 2ca4c6a1 feat(webapp): add upload setting badges to upload cards and download sidebar
  • 63f5cb86 feat: add badge filter controls to upload listings
  • 5116d5be feat: add sort-by-size to home uploads with shared UploadControls component
  • a1c2b3bb chore(webapp): rename Source button to GitHub in header
  • 86bc63e8 fix: stream + E2EE download
    • webapp: getFileURL() returns /stream/ URLs when upload.stream is set
    • server: skip Content-Length for streaming downloads (encrypted blob > original file size)
    • e2e: new stream-e2ee.spec.js with full decrypt roundtrip test
  • 00fbaaa4 chore: add /commit workflow and mandatory review gate to AGENTS.md

Testing

  • All E2E tests pass including 4 new stream+E2EE roundtrip tests
  • Manual testing of stream + E2EE upload/download confirmed working

@camathieu camathieu force-pushed the feat/url-routing-tabs branch from 4439fcb to 7c30d75 Compare March 1, 2026 16:28
@camathieu camathieu changed the title feat(webapp): sync home/admin tab and filter state with URL query params feat(webapp): path-based tab routing with URL state sync and upload badges Mar 1, 2026
ca.mathieu added 3 commits March 1, 2026 22:04
Make the active tab and filter state in HomeView and AdminView
URL-addressable via query parameters (?tab=, &user=, &sort=, &order=,
&provider=, &admin=) to enable bookmarking, sharing, and browser
back/forward navigation.

Token filter values are intentionally excluded from URLs for security
(they contain raw API tokens that would leak in browser history and
Referer headers).

- HomeView: ?tab=stats|uploads|tokens
- AdminView: ?tab=stats|users|uploads with filter/sort params
- Views use router.replace() + watch(route.query) for sync
- lastRouteQuery dedup prevents double API calls
- 8 new E2E tests for URL-based tab navigation
- ARCHITECTURE.md updated with query param documentation
…sidebar

Extract shared UploadBadges component showing one-shot, removable,
stream, extend TTL, password, and e2e encryption badges on upload
cards (Home/Admin views) and the download sidebar.

- New UploadBadges.vue with size prop (sm for cards, md for sidebar)
- DRY: replaces inline badges in DownloadSidebar.vue and UploadCard.vue
- Color scheme: warning (one-shot), danger (removable), accent (stream/e2e),
  emerald (extend TTL), surface (password)
Add server-side filtering for upload badge settings (oneShot, removable,
stream, extendTTL, password, e2ee) via query parameters on both
/uploads (admin) and /me/uploads (user) endpoints.

Backend:
- Replace positional (userID, tokenStr) args with UploadFilters struct
- Add applyUploadFilters() with explicit WHERE clauses (GORM ignores
  zero-value bools in struct conditions)
- Add parseBoolFilter() helper for *bool query param parsing
- Fix GetUploadsSortedBySize: INNER JOIN → LEFT JOIN + COALESCE so
  uploads without files appear with size 0 instead of being excluded

Frontend:
- Add badge filter toggle buttons in Admin and Home upload views
- Full URL persistence: filters sync to query params, restored on
  mount, tab switch, and back/forward navigation
- Use router.push() for filter toggles to enable browser history
- Explicit === true checks for badge filter API params

Tests:
- Add TestBackend_GetUploadsSortedBySize_EmptyUploads (Go)
- Add badge-filters.spec.js with 10 E2E tests covering filter
  visibility, matching, URL persistence, and back/forward navigation
- Update existing tests to use UploadFilters struct

Docs:
- Update ARCHITECTURE.md with new filter query params
- Update AGENTS.md with UploadFilters reference
@camathieu camathieu force-pushed the feat/url-routing-tabs branch from e26d91a to f56f69b Compare March 1, 2026 21:09
@camathieu camathieu changed the title feat(webapp): path-based tab routing with URL state sync and upload badges feat(webapp): path-based tab routing, upload badges, badge filters, and sort-by-size Mar 1, 2026
@camathieu camathieu force-pushed the feat/url-routing-tabs branch from f56f69b to 960bc1a Compare March 2, 2026 06:54
…ponent

- Backend: extract parseBadgeFilters() helper in misc.go (DRY admin.go & me.go)
- Backend: add sort=size and CountUploads to /me/uploads endpoint
- Frontend: create shared UploadControls.vue (sort/order/badge filters)
- Frontend: integrate UploadControls in AdminView and HomeView
- Frontend: add sort state, URL persistence, and API sort param to HomeView
- Tests: add E2E tests for sort controls and direct URL filter restoration
- Docs: update ARCHITECTURE.md and AGENTS.md
@camathieu camathieu force-pushed the feat/url-routing-tabs branch from 960bc1a to 5116d5b Compare March 2, 2026 06:55
@camathieu
Copy link
Copy Markdown
Member Author

docker deploy

1 similar comment
@camathieu
Copy link
Copy Markdown
Member Author

docker deploy

Copy link
Copy Markdown
Member

@bodji bodji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 2, 2026

🚀 Deployment Successful!

The instance at plik.root.gg has been redeployed with image rootgg/plik:pr-659 (freshly built).

ca.mathieu added 3 commits March 2, 2026 08:57
- webapp: getFileURL() returns /stream/ URLs when upload.stream is set
- server: skip Content-Length for streaming downloads (size is stale
  for E2EE because encrypted blob > original file size)
- e2e: add stream-e2ee.spec.js with full roundtrip test
@camathieu camathieu force-pushed the feat/url-routing-tabs branch from 4ae7f78 to 00fbaaa Compare March 2, 2026 08:44
@camathieu
Copy link
Copy Markdown
Member Author

docker deploy

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 2, 2026

🚀 Deployment Successful!

The instance at plik.root.gg has been redeployed with image rootgg/plik:pr-659.

@camathieu
Copy link
Copy Markdown
Member Author

docker deploy

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 2, 2026

🚀 Deployment Successful!

The instance at plik.root.gg has been redeployed with image rootgg/plik:pr-659.

@camathieu
Copy link
Copy Markdown
Member Author

docker deploy

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 2, 2026

🚀 Deployment Successful!

The instance at plik.root.gg has been redeployed with image rootgg/plik:pr-659.

@camathieu camathieu merged commit e6ddd36 into master Mar 2, 2026
7 checks passed
@camathieu camathieu deleted the feat/url-routing-tabs branch March 7, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants