Skip to content

Conversation

@terrerox
Copy link
Contributor

Description

Implement a locked feature modal for file version history when versioning
is not enabled, prompting users to upgrade to access the feature.

Changes:

  • Add LockedFeatureModal component with upgrade flow integration
  • Show blurred background versions when versioning is disabled
  • Refetch version limits after subscription changes (upgrade/cancel)
  • Hide skeleton loader when versioning is not enabled
  • Simplify mock versions data generation for locked state

Refactor:

  • Move version history hooks to Drive-level hooks directory
    • useVersionHistoryMenuConfig
    • useVersionItemActions
    • useDropdownPositioning
  • Move fileVersion.service to Drive-level services directory
  • Update all import paths to reflect new structure
  • Remove onUpgradeClick from useVersionHistoryMenuConfig hook
    (upgrade flow now handled in context menu and Sidebar)

Translations:

  • Add lockedFeature translations for all supported languages
    (en, es, fr, de, it, ru, zh, tw)

Tests:

  • Update test mocks for moved service paths
  • Simplify useVersionHistoryMenuConfig tests to remove redundant checks
  • All tests passing (15 tests across moved files)

Related Issues

Related Pull Requests

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

Additional Notes

- Added a locked feature modal to inform users about version restoration capabilities in paid plans.
- Updated i18n translations for the new locked feature.
- Refactored file version service imports and related tests.
- Enhanced version history menu configuration to handle locked states.
- Implemented dropdown positioning hook for better UI interactions.
- Added tests for version item actions and dropdown positioning.
- Integrated version limits fetching in the PlansSection for better user experience.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 10, 2026

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4315ad2
Status: ✅  Deploy successful!
Preview URL: https://751fe0df.drive-web.pages.dev
Branch Preview URL: https://feature-file-version-history-8eiq.drive-web.pages.dev

View logs

Base automatically changed from feature/file-version-history-v2 to feature/file-version-history January 10, 2026 04:17
  - Add downloadName option to DownloadItem type to support custom filenames
  - Update downloadWorkerHandler to accept and use custom download names
  - Format version download filenames as "(DD-MM-YYYY at HH:mm) filename.ext"
  - Use dateService and itemsUtils from @internxt/lib for proper formatting
  - Pass custom filename through downloadOptions instead of modifying item name
Comment on lines 9 to 12
const MODAL_DIMENSIONS = {
width: '282px',
height: '333px',
} as const;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The modal has to have this fixed sizes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, since it’s inside the file, the version sidebar will not have any issues on smaller screens

if (item.isFolder) {
return item.name;
}
return item.type ? `${item.name}.${item.type}` : item.name;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will the name never include the extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the name/plainName does not include the extension, it's stored separately in the type field.

<div className="absolute inset-0 z-10 flex items-center justify-center bg-black/10 dark:bg-black/30 backdrop-blur-[3px]">
<div
className="mx-6 flex max-w-xs flex-col items-center gap-4 rounded-2xl border border-gray-10 bg-surface pt-6 dark:border-gray-5 dark:bg-gray-1"
style={MODAL_DIMENSIONS}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Whenever possible, use classes instead of inline styles

@terrerox terrerox requested a review from CandelR January 13, 2026 03:51
@sonarqubecloud
Copy link

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