Skip to content

Conversation

@terrerox
Copy link
Contributor

@terrerox terrerox commented Jan 13, 2026

Description

  • Upgrade @internxt/sdk to 1.12.1 to support folder statistics
  • Add getFolderStats service method to fetch folder metadata
  • Display folder size and file count in item details modal
  • Implement parallel data fetching with Promise.all for better performance
  • Add proper error handling for folder stats with graceful degradation
  • Refactor getDetailsData to reduce cognitive complexity
  • Extract helper functions for location fetching and size calculation
  • Add i18n support for file count with pluralization (7 languages)
  • Update skeleton loading state to show numberOfFiles only for folders
  • Fix field ordering: type/numberOfFiles before size based on item type
  • Add proper TypeScript types for FolderStatsResponse and ItemType

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

@cloudflare-workers-and-pages
Copy link

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

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2de2431
Status: ✅  Deploy successful!
Preview URL: https://e14cad8f.drive-web.pages.dev
Branch Preview URL: https://feature-folder-details.drive-web.pages.dev

View logs

);
};

async function getFolderStatsOrUndefined(
Copy link
Collaborator

Choose a reason for hiding this comment

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

🙃 not add the return types at the function name, for that we have types :)

Copy link
Contributor Author

@terrerox terrerox Jan 14, 2026

Choose a reason for hiding this comment

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

I changed the approach, but I still need to return undefined if the item is not a folder. That way, Promise.all won’t trigger a request for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

he means that this function name should be just getFolderStats instead of getFolderStatsOrUndefined @terrerox

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, my bad 😅. I fixed it

return newStorageService.getFolderStats(itemUuid).catch(() => undefined);
}

function calculateItemSize(item: DriveItemDetails, folderStats: FolderStatsResponse | undefined): string | undefined {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: remember to use arrow functions

Comment on lines +831 to +835
"fileCount_one": "{{count}} файл",
"fileCount_few": "{{count}} файла",
"fileCount_many": "{{count}} файлов",
"fileCount_other": "{{count}} файлов",
"fileCountMoreThan1000": "Более 1000 файлов"
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove unused translations

Copy link
Contributor Author

@terrerox terrerox Jan 14, 2026

Choose a reason for hiding this comment

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

They are actually used, Russian uses 4 plural forms:

  • _one: for numbers ending in 1 (except 11): 1 файл, 21 файл, 101 файл
  • _few: for numbers ending in 2-4 (except 12-14): 2 файла, 3 файла, 22 файла
  • _many: for numbers ending in 0, 5-9, and 11-14: 5 файлов, 11 файлов, 100 файлов
  • _other: fallback for any other cases

i18next will dynamically choose it according the count value

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, good to know 💯

@terrerox terrerox self-assigned this Jan 14, 2026
@terrerox terrerox requested a review from CandelR January 14, 2026 13:31
@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.

4 participants