feat: add optional directory sizes in listings#5832
Open
posalex wants to merge 1 commit intofilebrowser:masterfrom
Open
feat: add optional directory sizes in listings#5832posalex wants to merge 1 commit intofilebrowser:masterfrom
posalex wants to merge 1 commit intofilebrowser:masterfrom
Conversation
kumaraguru1735
added a commit
to kumaraguru1735/filebrowser-laravel
that referenced
this pull request
Mar 31, 2026
Bug fixes: - filebrowser#5627: Skip inaccessible subfolders in directory listing (was 500) - filebrowser#5294: Cap text editor content at 5MB (prevents memory exhaustion DoS) - filebrowser#5683: Allow copy/move TO root directory (was blocked) - filebrowser#5835: Share creation requires both share AND download permissions - filebrowser#5834: Reject negative/zero TUS Upload-Length, add 10GB sanity cap - filebrowser#5239: Block sharing root directory (too broad, accidental exposure) - filebrowser#5216: Validate JWT signature on token renewal - filebrowser#2078: Support BMP thumbnails, skip GIF resize (preserve animation) - filebrowser#5306: Normalize paths in copy/rename (strip trailing slashes) Ported PRs: - filebrowser#5876: Reject negative TUS upload-length - filebrowser#5875: Check download perm when sharing - filebrowser#5873: Deep conflict resolution — merge dirs, preserve non-conflicting - filebrowser#5832: Optional directory sizes via ?dirSizes=true param - filebrowser#5658: User quota management — configurable quota_resolver callback Config additions: - quota_resolver: callable for per-user disk quotas - max_content_size: cap for text editor loading (default 5MB) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add an optional per-user setting to calculate and display directory sizes in file listings.
Today File Browser shows file sizes but not useful directory sizes in the listing view. This change adds a new profile setting,
showDirectorySizes, which is disabled by default. When enabled, directory sizes are calculated recursively in the backend and shown in the UI. The calculated values are also used when sorting by size.Additional Information
The implementation was added to the existing backend listing pipeline instead of shelling out to a platform-specific command such as
du. That keeps the feature portable, testable, and consistent with the current file metadata flow.The setting is stored on the user model, passed through defaults/auth payloads, exposed in Profile Settings, and consumed by the listing UI. Directory size calculation respects the existing checker/rule filtering so hidden or blocked entries are not counted. Symlinked directories are not traversed.
The feature is intentionally opt-in because recursive size calculation can be expensive on large directory trees.
I also added backend tests for directory size calculation and size-based sorting.
This PR includes minimal UI string additions in
en.jsonandde.jsononly because the new setting requires labels in the interface. It is not intended as a translation-focused change.Checklist
masterbranch.