Skip to content

Conversation

lethemanh
Copy link
Contributor

No description provided.

@lethemanh lethemanh self-assigned this Jul 2, 2025
Copy link

bundlemon bot commented Jul 2, 2025

BundleMon

Files updated (4)
Status Path Size Limits
public/static/js/(chunkId).(hash).js
872.3KB (+15.83KB +1.85%) -
public/static/js/public.(hash).js
86.16KB (+801B +0.92%) -
public/static/css/public.(hash).css
5.89KB (+269B +4.67%) -
static/js/main.(hash).js
117.17KB (+13B +0.01%) -
Unchanged files (17)
Status Path Size Limits
static/js/(chunkId).(hash).js
967.38KB -
static/js/cozy.(hash).js
845.89KB -
public/static/js/cozy.(hash).js
711.52KB -
(hash).js
337.62KB -
public/(hash).js
337.62KB -
services/qualificationMigration.js
282.6KB -
services/dacc.js
264.84KB -
public/static/js/lib-react.(hash).js
39.37KB -
static/js/lib-react.(hash).js
39.37KB -
public/static/css/cozy.(hash).css
33.69KB -
static/css/cozy.(hash).css
33.69KB -
public/static/js/lib-router.(hash).js
22.05KB -
static/js/lib-router.(hash).js
22.05KB -
static/css/main.(hash).css
16.2KB -
manifest.webapp
1.89KB -
index.html
689B -
assets/manifest.json
185B -

Total files change +16.89KB +0.34%

Groups updated (2)
Status Path Size Limits
**/*.js
6.45MB (+16.61KB +0.25%) -
**/*.css
128.49KB (+269B +0.2%) -
Unchanged groups (1)
Status Path Size Limits
**/*.{png,svg,ico}
2.15MB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Contributor

@JF-Cozy JF-Cozy left a comment

Choose a reason for hiding this comment

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

It's more a feat than a fix in my opinion 🤔

No need to use DropzoneDnD? I don't remember if we have dnd feature on public pages...

@lethemanh
Copy link
Contributor Author

lethemanh commented Jul 2, 2025

It's more a feat than a fix in my opinion 🤔

No need to use DropzoneDnD? I don't remember if we have dnd feature on public pages...

@JF-Cozy there is a ticket that require to add drag and drop in public page https://www.notion.so/linagora/Public-shared-page-add-drag-and-drop-22362718bad180e98f13d504d4f68868?source=copy_link and it's marked as bug

@lethemanh lethemanh force-pushed the dnd-public-sharing branch from 451212e to 865e691 Compare July 2, 2025 09:01
@lethemanh lethemanh requested a review from JF-Cozy July 2, 2025 09:01
@lethemanh lethemanh force-pushed the dnd-public-sharing branch from 865e691 to 20f086f Compare July 2, 2025 09:41
@JF-Cozy
Copy link
Contributor

JF-Cozy commented Jul 2, 2025

It's more a feat than a fix in my opinion 🤔
No need to use DropzoneDnD? I don't remember if we have dnd feature on public pages...

@JF-Cozy there is a ticket that require to add drag and drop in public page https://www.notion.so/linagora/Public-shared-page-add-drag-and-drop-22362718bad180e98f13d504d4f68868?source=copy_link and it's marked as bug

Ok, but it's not, it's a lack of feature, not the same. But anyway, it's a detail...

@JF-Cozy
Copy link
Contributor

JF-Cozy commented Jul 3, 2025

No need to use DropzoneDnD? I don't remember if we have dnd feature on public pages...

I just took a look, we don't use virtualized table on public page, so no need to use DropzoneDnD

@lethemanh lethemanh force-pushed the dnd-public-sharing branch from 20f086f to b756e28 Compare July 3, 2025 06:58
@JF-Cozy
Copy link
Contributor

JF-Cozy commented Jul 3, 2025

@lethemanh don't forget to modify src/modules/views/Sharings/SharingsFolderView.jsx please and then I think we will be good to go

@lethemanh lethemanh force-pushed the dnd-public-sharing branch from b756e28 to e746b11 Compare July 3, 2025 08:59
@lethemanh
Copy link
Contributor Author

@JF-Cozy I've remove prop role from DropZone in src/modules/views/Sharings/SharingsFolderView.jsx

@rezk2ll
Copy link
Contributor

rezk2ll commented Jul 7, 2025

LGTM, but there is a small issue:

I just tested and the drag&drop works, just a small issue with the folder view not being updated after the upload is complete ( it refreshes if you upload via the create button ).
I think there is an issue with the refreshFolderContent not being triggered after the drag-and-drop action.

i made a small video:

dragdrop.mp4

edit: after some checking, the dropzone component dispatches the uploadFiles call with fileUploadedCallback = () => null

and this approach relies on the cozy-realtime to handle the update and this won't happen because the publicly shared folder view can't subscribe to the events.

one possible solution is to update the Dropzone component to support this case:

export const Dropzone = ({
  displayedFolder,
  disabled,
  refreshFolderContent = null,
  children,
}) => {
  const client = useClient()
  const { t } = useI18n()
  const { isMobile } = useBreakpoints()
  const { showAlert } = useAlert()
  const sharingState = useSharingContext()
  const vaultClient = useVaultClient()
  const dispatch = useDispatch()
  const fileUploadCallback = refreshFolderContent
    ? refreshFolderContent
    : () => null

  const onDrop = async (files, _, evt) => {
    if (!canDrop(evt)) return

    const filesToUpload = canHandleFolders(evt) ? evt.dataTransfer.items : files
    dispatch(
      uploadFiles(
        filesToUpload,
        displayedFolder.id,
        sharingState,
        fileUploadCallback,
        {
          client,
          vaultClient,
          showAlert,
          t,
        }
      )
    )
  }

and in the src/modules/views/Public/PublicFolderView.jsx

<Dropzone
  disabled={!hasWritePermissions}
  displayedFolder={displayedFolder}
  refreshFolderContent={refreshFolderContent}
>

@rezk2ll rezk2ll changed the title fix: Add drag and drop in public sharing page 🐛 feat: Add drag and drop in public sharing page 🐛 Jul 8, 2025
@rezk2ll rezk2ll changed the title feat: Add drag and drop in public sharing page 🐛 feat: Add drag and drop in public sharing page ✨ Jul 8, 2025
@rezk2ll rezk2ll force-pushed the dnd-public-sharing branch from e746b11 to 5440ab7 Compare July 8, 2025 12:26
@lethemanh lethemanh force-pushed the dnd-public-sharing branch from 5440ab7 to 964fa77 Compare July 8, 2025 12:40
@lethemanh lethemanh requested a review from JF-Cozy July 8, 2025 12:40
@lethemanh
Copy link
Contributor Author

LGTM, but there is a small issue:

I just tested and the drag&drop works, just a small issue with the folder view not being updated after the upload is complete ( it refreshes if you upload via the create button ). I think there is an issue with the refreshFolderContent not being triggered after the drag-and-drop action.

i made a small video:

dragdrop.mp4
edit: after some checking, the dropzone component dispatches the uploadFiles call with fileUploadedCallback = () => null

and this approach relies on the cozy-realtime to handle the update and this won't happen because the publicly shared folder view can't subscribe to the events.

one possible solution is to update the Dropzone component to support this case:

export const Dropzone = ({
  displayedFolder,
  disabled,
  refreshFolderContent = null,
  children,
}) => {
  const client = useClient()
  const { t } = useI18n()
  const { isMobile } = useBreakpoints()
  const { showAlert } = useAlert()
  const sharingState = useSharingContext()
  const vaultClient = useVaultClient()
  const dispatch = useDispatch()
  const fileUploadCallback = refreshFolderContent
    ? refreshFolderContent
    : () => null

  const onDrop = async (files, _, evt) => {
    if (!canDrop(evt)) return

    const filesToUpload = canHandleFolders(evt) ? evt.dataTransfer.items : files
    dispatch(
      uploadFiles(
        filesToUpload,
        displayedFolder.id,
        sharingState,
        fileUploadCallback,
        {
          client,
          vaultClient,
          showAlert,
          t,
        }
      )
    )
  }

and in the src/modules/views/Public/PublicFolderView.jsx

<Dropzone
  disabled={!hasWritePermissions}
  displayedFolder={displayedFolder}
  refreshFolderContent={refreshFolderContent}
>

@rezk2ll I've updated

@rezk2ll rezk2ll merged commit 69b4e1f into master Jul 8, 2025
4 checks passed
@rezk2ll rezk2ll deleted the dnd-public-sharing branch July 8, 2025 12:49
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.

3 participants