papermark icon indicating copy to clipboard operation
papermark copied to clipboard

fix: Keep state in dataroom view between document and dataroom view #783

Open Nithin-532 opened this issue 1 year ago • 8 comments

Bug: The folderId state is getting resetted everytime when we changing the view.

Fix: I lifted the state of folderId in DataroomViewer component to DataroomView component.

Screencast from 13-10-24 11_40_10 PM IST.webm

Nithin-532 avatar Oct 13 '24 19:10 Nithin-532

@Nithin-532 is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 13 '24 19:10 vercel[bot]

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

github-actions[bot] avatar Oct 13 '24 19:10 github-actions[bot]

PR Summary

  • Enhanced DataroomViewer Component We've upgraded our DataroomViewer component's functionality, allowing it to accept additional information (folderId and setFolderId) directly from its surrounding environment.

  • Simplified State Management We removed the local state initiation for folderId and setFolderId. These pieces of data are now received as parameters, enhancing flexibility and control over component behavior.

  • Improved DataroomView Component We introduced local state management for folderId and setFolderId within the DataroomView component, providing it with the ability to manage these data in its scope.

  • Enhanced Data Flow to Child Components We've improved how we distribute information to component's offspring. The folderId and setFolderId are now transferred to the relevant child components within the DataroomView, improving hierarchy operation and data accessibility.

what-the-diff[bot] avatar Oct 13 '24 19:10 what-the-diff[bot]

I have read the CLA Document and I hereby sign the CLA

Nithin-532 avatar Oct 13 '24 19:10 Nithin-532

recheck

Nithin-532 avatar Oct 13 '24 19:10 Nithin-532

@Nithin-532 great job! it's such a simple change.

One small request and probably that might take some fiddling around but even tho the folder state is preserved, for some reason the folder tree doesn't expand to the current folder automatically

Could you test this with a deeply-nested file (i.e. 2 or more folders deep) and see if you can fix the issue :)

https://github.com/user-attachments/assets/4ca4f448-486e-46e3-864e-e8888d76b51a

mfts avatar Oct 14 '24 05:10 mfts

@mfts sure

Nithin-532 avatar Oct 14 '24 06:10 Nithin-532

@mfts I somewhat solved the problem. Here is the video.

Screencast from 14-10-24 05:57:38 PM IST.webm

But I think this is not an optimal approach. I nested through all the folders and children of those folders to find the path of the folderId that has been selected.

Nithin-532 avatar Oct 14 '24 12:10 Nithin-532

But I think this is not an optimal approach. I nested through all the folders and children of those folders to find the path of the folderId that has been selected.

@Nithin-532 I see. let me know if you want me to review some part of the code

mfts avatar Oct 14 '24 15:10 mfts