Skip to content

feat: add trash UI for cloud view (consume /files/trash endpoints)#238

Merged
DenizAltunkapan merged 2 commits into
Vault-Web:mainfrom
GabrielBBaldez:feature/cloud-trash-ui
Jun 15, 2026
Merged

feat: add trash UI for cloud view (consume /files/trash endpoints)#238
DenizAltunkapan merged 2 commits into
Vault-Web:mainfrom
GabrielBBaldez:feature/cloud-trash-ui

Conversation

@GabrielBBaldez

Copy link
Copy Markdown
Contributor

Closes #237.

Adds the cloud-page trash view that consumes the per-user trash endpoints from Vault-Web/cloud-page#79.

What's included

  • CloudService methods for the three endpoints (GET /files/trash, POST /files/trash/{id}/restore, DELETE /files/trash/{id}) plus a TrashEntryDto model (id, name, originalPath, deletedAt, size).
  • A standalone TrashComponent (route /cloud/trash, behind authGuard): a table of trashed entries (name, original location, deleted date, size) with Restore and permanent-delete actions; permanent delete asks for confirmation. Loading / error / empty states included.
  • A Trash entry point in the cloud toolbar.
  • Restore-conflict handling: when a file already exists at the original path, the user gets a clear message instead of a generic failure.

Notes

  • Depends on feat: add per-user trash (soft delete) with scheduled cleanup cloud-page#79 (the backend trash endpoints) being merged for the endpoints to exist.
  • The backend currently surfaces a restore conflict as a 500 (FileAlreadyExistsException isn't mapped to 409); the UI handles both that and a future 409, so it degrades gracefully either way. Happy to send a one-line follow-up on cloud-page#79 mapping it to 409 for a cleaner contract.
  • Verified locally with ng build (AOT + strict templates) and Prettier.

Adds a recycle-bin view listing trashed files (name, original location, deleted date, size) with restore and permanent-delete (confirm dialog) actions, plus a Trash entry point in the cloud toolbar. Consumes the GET/POST/DELETE /files/trash endpoints from cloud-page#79. Restore conflicts (a file already exists at the original path) are surfaced gracefully.
Copilot AI review requested due to automatic review settings June 14, 2026 01:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a Trash feature to the Cloud UI, including API methods and a standalone Trash page for listing, restoring, and permanently deleting items.

Changes:

  • Added TrashEntryDto and new CloudService endpoints for trash list/restore/purge.
  • Introduced a standalone TrashComponent (TS/HTML/SCSS) to display and manage trash entries.
  • Added navigation from Cloud page to Trash and registered a new /cloud/trash route.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend/src/app/services/cloud.service.ts Adds HTTP methods to list/restore/purge trash entries.
frontend/src/app/pages/cloud/trash/trash.component.ts New Trash page logic (loading, restore/purge actions, error handling).
frontend/src/app/pages/cloud/trash/trash.component.html New Trash page template with table + actions.
frontend/src/app/pages/cloud/trash/trash.component.scss New styles for Trash page layout/states.
frontend/src/app/pages/cloud/cloud.component.ts Adds navigation method to open Trash.
frontend/src/app/pages/cloud/cloud.component.html Adds “Trash” button in Cloud header actions.
frontend/src/app/models/dtos/TrashEntryDto.ts New DTO for trash entries.
frontend/src/app/app.routes.ts Registers /cloud/trash route (guarded).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/app/pages/cloud/trash/trash.component.ts
Comment thread frontend/src/app/pages/cloud/trash/trash.component.html
Comment thread frontend/src/app/app.routes.ts
Comment thread frontend/src/app/app.routes.ts
Comment thread frontend/src/app/pages/cloud/cloud.component.html Outdated
Comment thread frontend/src/app/pages/cloud/cloud.component.ts
…style

Review follow-up: formatFileSize now clamps the unit index (and adds TB/PB) so sizes >= 1 TB render correctly; the icon-only permanent-delete button gets an aria-label; the cloud header actions move their inline flex styles into the stylesheet.
@GabrielBBaldez

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot comments in 444d351:

  • formatFileSize clamps the unit index (and adds TB/PB) so sizes ≥ 1 TB render correctly
  • aria-label on the icon-only permanent-delete button
  • moved the header-actions inline styles into the component stylesheet

Left two as-is, for consistency with the existing code:

  • Lazy-loading the Trash route — every route in app.routes.ts is eagerly imported today, so making only this one lazy would be inconsistent. Happy to switch if you'd like to move the app toward lazy routes more broadly.
  • Explicit : void on goToTrash — the sibling methods in cloud.component.ts don't declare return types, so I kept it consistent with the file.

Separately, restore conflicts now get a clean 409 from the backend (Vault-Web/cloud-page#79), which this UI already handles.

@DenizAltunkapan DenizAltunkapan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@GabrielBBaldez Thank you very much 😄

@DenizAltunkapan DenizAltunkapan merged commit 6e16d99 into Vault-Web:main Jun 15, 2026
2 checks passed
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.

[Feature]: Trash UI for cloud view (consume /files/trash endpoints)

3 participants