- Branch Name:
refactor/studio-local-doc-sync-menu
- PR Title:
[Feature] [Studio]: refactor document actions sync options based on cloud presence
Affected Apps / Packages
Is your feature request related to a problem?
Yes. In the Documents library page, the action menu (DocumentActionsMenu.tsx) for each document displays "Sync now" and "View sync details".
If a document has never been synced to the cloud (it is local-only), showing "View sync details" is confusing since it has no sync history or cloud destination. However, hiding both options is also problematic because it completely blocks the user from uploading the document to the cloud.
Describe the solution you'd like
We should conditionally render the actions in DocumentActionsMenu.tsx based on doc.sync?.cloudDocumentId:
- If
cloudDocumentId is present (already synced):
- Display "Sync now" (or "Syncing...")
- Display "View sync details"
- If
cloudDocumentId is null (local-only):
- Display "Upload to cloud" or "Sync to cloud" instead of "Sync now".
- Hide the "View sync details" menu item.
Describe alternatives you've considered
- Hiding both actions, which completely disables syncing local-only documents.
- Leaving both actions as they are, which displays a confusing, empty sync details modal for unsynced files.
Additional Context
The doc.sync object is already fetched inside the library snapshot, so we don't need any additional API fetches.
refactor/studio-local-doc-sync-menu[Feature] [Studio]: refactor document actions sync options based on cloud presenceAffected Apps / Packages
Is your feature request related to a problem?
Yes. In the Documents library page, the action menu (
DocumentActionsMenu.tsx) for each document displays "Sync now" and "View sync details".If a document has never been synced to the cloud (it is local-only), showing "View sync details" is confusing since it has no sync history or cloud destination. However, hiding both options is also problematic because it completely blocks the user from uploading the document to the cloud.
Describe the solution you'd like
We should conditionally render the actions in
DocumentActionsMenu.tsxbased ondoc.sync?.cloudDocumentId:cloudDocumentIdis present (already synced):cloudDocumentIdis null (local-only):Describe alternatives you've considered
Additional Context
The
doc.syncobject is already fetched inside the library snapshot, so we don't need any additional API fetches.