Skip to content

feat:(PB-6297) preview public shared folder contents - #2052

Merged
victor-ferro merged 28 commits into
masterfrom
PB-6297-folder-link-preview
Aug 5, 2026
Merged

feat:(PB-6297) preview public shared folder contents#2052
victor-ferro merged 28 commits into
masterfrom
PB-6297-folder-link-preview

Conversation

@victor-ferro

@victor-ferro victor-ferro commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

First part of PB-6297 (public shared folder preview). Until now, a public folder link only showed a card with the folder name and a Download button — the recipient had to download the whole folder as a zip without knowing its contents.

This PR adds a "View" button next to Download that opens a read-only listing of the shared folder contents, fetched without authentication:

  • usePublicSharedFolderContent (new hook): fetches folders first and then files per level via getPublicSharedFolderContent, handling pagination (30 items/page), per-level resource tokens (each response provides the token that authorizes listing the next level) and network credentials (returned by the files request, which carries the link code).
  • PublicSharedFolderContent (new): breadcrumbs, item selection, sorting, and navigation into subfolders. Exiting the preview returns to the classic card.
  • PublicSharedItemList (new): list UI for the items.
  • ShareFolderView: renders the new preview when the eye button is clicked.
  • ShareFileView: Phosphor icon imports renamed to their non-deprecated *Icon variants (no behavior change).

Scope note: this PR only lists contents. Image thumbnails and per-item download/preview come in two follow-up stacked PRs.

Related Issues

Relates to PB-6297.

Related Pull Requests

Stacked on top of this PR (will be opened next):

  • PB-6297-thumbnails — image thumbnails in the listing.
  • PB-6297-preview-download — per-item download and file preview.

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

  • Unit tests: yarn vitest run src/views/PublicShared/hooks/usePublicSharedFolderContent.test.ts (4 tests: initial folders→files fetch sequence, subfolder navigation with the parent level token + breadcrumb back-navigation, no-op navigation guards, and pagination).
  • yarn typecheck and yarn lint clean; full unit suite run by the pre-commit hook.
  • Manual: opened a public shared folder link (/sh/folder/:token/:code), clicked View, browsed root and subfolders, checked pagination on folders with 30+ items, breadcrumb navigation back to parent levels, and exit back to the download card. Verified with and without link password.

Additional Notes

…terators

New-code coverage was failing the SonarCloud quality gate (75% vs 80%
required). Adds tests for the untested useWarnBeforeUnload hook and for
the previously uncovered lines in share.service.ts: the folders/files
iterator factories passed to downloadFolderAsZip, and the happy/error
paths of downloadPublicSharedFolder.
@victor-ferro victor-ferro self-assigned this Jul 24, 2026

@CandelR CandelR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Check sonnar and the layout whilst navigate, there are some odd jumps when the content stops loading

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 91bed92
Status: ✅  Deploy successful!
Preview URL: https://27984dc7.drive-web.pages.dev
Branch Preview URL: https://pb-6297-folder-link-preview.drive-web.pages.dev

View logs

@victor-ferro
victor-ferro requested a review from CandelR July 27, 2026 17:16

@CandelR CandelR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The flickering persists when the loaded list is empty. There are also subfolders where, when navigating, the server returns a 500 error and it just keeps loading instead of displaying any kind of error message. I’ve attached a video, if you have any further questions, we can discuss them via DM

Screen.Recording.2026-07-28.at.10.56.05.mov

@victor-ferro
victor-ferro requested a review from CandelR July 28, 2026 12:59
# Conflicts:
#	src/views/PublicShared/components/PublicSharedFolderContent.tsx
# Conflicts:
#	src/views/PublicShared/components/PublicSharedFolderContent.tsx
#	src/views/PublicShared/components/PublicSharedItemList.tsx
#	src/views/PublicShared/hooks/usePublicSharedFolderContent.ts
CandelR
CandelR previously approved these changes Jul 29, 2026
Moves download and preview state out of PublicSharedFolderContent into
usePublicSharedDownload, discarding stale preview downloads when the
preview is closed or replaced, and removes 'as unknown as' casts by
typing fileId on AdvancedSharedItem and narrowing helper signatures.
victor-ferro and others added 2 commits August 5, 2026 15:28
feat:(PB-6297) download and preview individual items in public shared folder
…-preview

# Conflicts:
#	src/app/drive/services/thumbnail.service.test.ts
#	src/views/Checkout/views/CheckoutView.tsx
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@victor-ferro
victor-ferro requested a review from CandelR August 5, 2026 14:07
@victor-ferro
victor-ferro merged commit 0b63b95 into master Aug 5, 2026
10 of 11 checks passed
@victor-ferro
victor-ferro deleted the PB-6297-folder-link-preview branch August 5, 2026 14:09
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