Commit Graph

33 Commits

Author SHA1 Message Date
Dionisio 7737ed90c7 feat: folder ownership scoping, batch operations integration, frontend audit fixes
Backend:
- Add owner_id to Folder entity + FolderDto (DB user_id column)
- Add list_folders_by_owner to FolderRepository trait + PG impl
- Add list_folders_for_owner to FolderUseCase + FolderService
- Rewrite FolderHandler: all endpoints now scope by AuthUser
- Remove dead handler methods (list_folders_inner, list_folders_for_user, is_user_home_folder, folder_belongs_to_user)
- Add ownership check in get_folder (returns 404 on mismatch)

Batch operations:
- Add trash_service + zip_service to BatchOperationService
- New methods: trash_files, trash_folders, move_folders, download_zip
- New handlers: trash_batch, move_folders_batch, download_batch
- New routes: POST /api/batch/trash, /api/batch/folders/move, /api/batch/download

Frontend:
- Replace findUserHomeFolder (~130 lines) with resolveHomeFolder (~35 lines)
- Remove client-side folder filtering in loadFiles (backend now scopes)
- Rewrite batchDelete: N requests -> 1 POST /api/batch/trash
- Rewrite batchMove: N requests -> 2 POST max (files + folders)
- Rewrite batchDownload: N requests -> 1 POST /api/batch/download (ZIP)
- Search moved to backend, share system uses backend API
- Dark mode fixes, frontend audit improvements
2026-02-15 23:45:11 +01:00
Dionisio 1ed20f425f perf: Phase 4+5 optimizations — uploads 10x, downloads 2x, concurrent 2x. moka cache, 512KB buffers, remove sync_all, hash-on-write, preloaded queries, bench.sh v3, gitignore storage/. 500MB upload 12.6s->1.3s (392MB/s). RSS 69-113MB, 0 swap. 2026-02-15 17:56:47 +01:00
Dionisio 9290aea591 fix(#107): trash/recent/favorites list view rendering bugs
Trash view:
- Fix 'Invalid Date': use item.trashed_at (ISO 8601) instead of item.deleted_at * 1000
- Fix literal i18n key 'files.file_types.file': determine type from file extension
  (pdf, image, video, audio, text, document) since trash DTO has no mime_type
- Fix column alignment: remove checkbox from trash header (not applicable),
  add .trash-header CSS class matching the 5-column grid layout

Recent view:
- Fix header/row column misalignment: add empty placeholder div for indicator
  column and .recent-header CSS class matching the 5-column grid
- Fix missing i18n key: use 'recent.accessed' instead of 'files.last_accessed'
- Fix default typeLabel not internationalized: use i18n.t('files.file_types.document')

Favorites view:
- Fix header/row column misalignment: add empty placeholder div for indicator
  column and .favorites-header CSS class matching the 5-column grid
- Fix default typeLabel not internationalized: use i18n.t('files.file_types.document')

Bump SW cache to v11.
2026-02-14 11:06:29 +01:00
Dionisio 1672889044 feat(#93): notification bell with upload progress
Replace the floating upload toast with a notification bell in the top bar
(between language selector and user avatar). All upload progress, completion,
and quota errors now flow through the bell dropdown panel.

- Add notification bell button with animated badge counter
- Dropdown panel shows per-file upload progress bars and overall batch progress
- Bell rings on new notifications when panel is closed
- Upload success/error states with color-coded icons
- Quota exceeded errors shown as notification items
- Clear all button to dismiss notifications
- Panel auto-opens when upload starts
- Full dark mode support
- Mutual exclusion with user menu (opening one closes the other)
- i18n keys for en/es (notifications.title, notifications.empty)
- SW cache bump to v10

Files:
- static/js/notifications.js (new module)
- static/index.html: bell markup + remove old toast
- static/css/style.css: bell + panel styles + dark mode
- static/js/fileOperations.js: redirect upload progress to notification bell
- static/js/app.js: close bell when user menu opens
- static/locales/{en,es}.json: i18n keys
- static/sw.js: cache v10 + notifications.js asset
2026-02-14 10:46:23 +01:00
Dionisio 516b8727d2 fix: dark mode toggle and search auth headers (#102)
Dark mode:
- Toggle now applies data-theme='dark' attribute to <html>
- Theme applied immediately on page load to prevent FOUC
- Comprehensive dark mode CSS covering all UI components:
  sidebar, top bar, search, file cards, list view, context
  menus, modals, dialogs, notifications, user menu, etc.

Search:
- Add Authorization headers to all search API fetch calls
  (searchFiles, advancedSearch, clearSearchCache)
- Fix missing checkbox column in search results list header
2026-02-14 00:45:45 +01:00
Dionisio 82dd7a5c56 feat: multi-select for batch file/folder actions (#100)
- Add checkboxes to list view items (grid view already had them)
- Add 'select all' checkbox in list view header
- Add batch action bar with Delete, Move, and Download buttons
- Batch delete: moves all selected items to trash in one operation
- Batch move: reuses existing move dialog in batch mode
- Batch download: downloads each selected item
- Keyboard shortcuts: Ctrl+A (select all), Escape (deselect), Delete key
- Shift+click for range selection in both grid and list views
- Selection state synced between grid and list views
- New multiSelect.js module manages selection state and batch operations
2026-02-14 00:12:18 +01:00
Dionisio 4560a8042c fix(routes): serve pages with clean URLs (no .html extension)
Add server-side routes for /profile, /admin, and /shared that
serve their respective HTML pages directly (same pattern already
used for /login). Updated all frontend references to use clean
URLs instead of .html extensions.

Fixes #99
2026-02-13 22:44:20 +01:00
Dionisio 6f3baabbb2 fix(ui): close About modal on ESC key press
Add keydown listener for Escape to dismiss the About OxiCloud
modal overlay, matching standard modal behavior.

Fixes #98
2026-02-13 22:38:26 +01:00
Dionisio 5771d82b21 refactor: remove Spanish folder naming convention, keep English only
Remove all 'Mi Carpeta - ' references from backend and frontend.
Only 'My Folder - {username}' is now recognized as the home folder
naming convention.
2026-02-13 22:33:27 +01:00
Dionisio 05135529ce fix(security): scope root folder listing to authenticated user
Non-admin users were seeing all users' root folders, including the
admin's. Three root causes fixed:

1. Backend: list_root_folders now extracts AuthUser and filters
   results so each user only sees their own home folder at the
   root level (folders matching 'My Folder - {username}' or
   'Mi Carpeta - {username}').

2. Frontend: findUserHomeFolder() searched only for the Spanish
   pattern 'Mi Carpeta - {username}' but the backend creates
   folders with the English pattern 'My Folder - {username}'.
   Now checks both naming conventions.

3. Frontend: when the home folder was not found, the code fell
   back to folderList[0] — which was usually the admin's folder.
   Removed that dangerous fallback; now shows empty root instead.

Fixes #94
2026-02-13 22:31:05 +01:00
Dionisio 177f82ca16 fix: make checkAuthentication async to fix app.js parse error (#90)
checkAuthentication() used await for the OIDC exchange fetch but was
declared as a regular function, not async. This caused a JavaScript
syntax error that prevented the entire app.js file from parsing,
resulting in a completely non-interactive frontend after OIDC login.

Also bumped service worker cache version to v2 so browsers
discard stale cached JS files on the next load.
2026-02-13 21:49:01 +01:00
Dionisio 33ed3bd66c Fix: Complete OIDC login flow - exchange code for tokens on frontend
The backend redirected to /?oidc_code=<code> after successful OIDC auth,
but the frontend never exchanged this code for JWT tokens. The user
was redirected back to the login page every time.

- app.js: Detect oidc_code in URL params before token check, call
  POST /api/auth/oidc/exchange, store tokens, reload clean
- auth.js: Fallback handler if oidc_code lands on login page

Fixes #90
2026-02-13 21:33:45 +01:00
Dionisio fb65d1976b fix: resolve file management operations not working (#83)
- Fix rename: context menu was nullifying target reference before rename dialog could use it
- Fix delete files/folders: auth extractors were mandatory, causing 401 when auth not configured
- Fix view-file: async fetch race condition with context menu cleanup
- Fix orphaned ID mappings on file deletion
- Fix Authorization: Bearer null headers sent without token
- Add OptionalUserId and OptionalAuthUser infallible extractors
2026-02-13 08:54:51 +01:00
Dionisio ab8f3191cb refactor: remove legacy 'Mi Carpeta' references, use 'My Folder' only 2026-02-12 15:31:39 +01:00
Dionisio d31a413e57 chore: translate all Spanish comments and log messages to English 2026-02-12 09:41:25 +01:00
Dionisio 1e8a7dd5bb feat: redesign admin panel & profile page, optimize Dockerfile, remove rootless
- Completely redesign admin.html matching OxiCloud design system
- Create standalone profile.html page with avatar, details & password change
- Optimize Dockerfile: 3-stage build, non-root user, OCI labels, layer cache
- Add .dockerignore to reduce build context
- Remove redundant Dockerfile.rootless & rootless-compose.yml
- Redesign login language selector as compact dropdown with search
- Fix CI/CD workflows (ci.yml, docker-build.yml, docker-publish.yml)
- Update app.js to navigate to profile page instead of modal
2026-02-11 14:09:40 +01:00
Dionisio 3050955f9c feat: add admin/profile UI, i18n (fr/de/pt), fix CI pipelines
- Add admin panel link and profile modal in user menu dropdown
- Add French, German and Portuguese locale support (full translations)
- Register new locales across JS frontend and Rust backend
- Create CI pipeline (fmt, clippy, test, audit, build)
- Fix docker-build.yml (cache, real tests, reduced timeout)
- Fix docker-publish.yml (multi-arch via QEMU, latest tag, pre-publish tests)
- Add dependabot.yml for automated dependency updates
2026-02-11 12:37:03 +01:00
Diocrafts 5bd505ccd7 modernizing frontend 2026-02-08 22:44:42 +01:00
Dionisio 8f2b0a354c big refactoring 2026-02-03 17:59:04 +01:00
DioCrafts 5306bdc9e3 fix uploding bugs 2025-04-12 12:21:57 +02:00
DioCrafts 8f1d213526 improve postgresql performance 2025-04-09 00:21:20 +02:00
DioCrafts e3256bb3b5 fix ui home folder 2025-04-04 04:30:49 +02:00
DioCrafts a79c335b73 adding recent feature + bug fixed 2025-04-02 05:08:30 +02:00
DioCrafts 7069a54d8d adding favorite feature 2025-04-02 03:43:44 +02:00
DioCrafts 705cb5b069 adding pdf and image viewer 2025-04-02 01:22:05 +02:00
DioCrafts f1f5f46728 fix shared tab bug 2025-04-01 21:14:09 +02:00
DioCrafts 2e1cb4a034 fixing several bugs 2025-03-31 06:20:15 +02:00
DioCrafts fb276d9b24 adding ui sharing 2025-03-28 08:09:18 +01:00
DioCrafts 7affff379d adding search engine 2025-03-27 01:13:34 +01:00
DioCrafts bd623ec07e adding trash folder 2025-03-24 17:49:53 +01:00
DioCrafts 9a9fd72f61 fixing bugs 2025-03-23 22:44:18 +01:00
DioCrafts cafad0fbfd adding user authentication 2025-03-20 09:22:31 +01:00
DioCrafts 961545aef7 adding features 2025-03-19 23:28:29 +01:00