Skip to content

feat: added --disable-size flag and related handling#246

Open
yetanotheraryan wants to merge 1 commit intovoidcosmos:mainfrom
yetanotheraryan:main
Open

feat: added --disable-size flag and related handling#246
yetanotheraryan wants to merge 1 commit intovoidcosmos:mainfrom
yetanotheraryan:main

Conversation

@yetanotheraryan
Copy link
Copy Markdown

@yetanotheraryan yetanotheraryan commented Apr 7, 2026

For #240

Changes

  • Added disableSize to the CLI config interface and default config.
  • Registered the --disable-size option in CLI help/options.
  • Passed CLI config into ResultsUi so result rendering can react to disableSize.
  • Updated result display to show placeholder size text when size calculation is disabled.
  • Updated UI scan flow to skip calculateFolderStats() when disableSize is enabled.
  • Updated --delete-all handling so folders can be deleted as soon as they are found when size calculation is disabled.
  • Updated test config fixture to include the new disableSize field.

Validation

  • npm run build passes.
  • npm test passes.
  • Verified node lib/index.js --help shows --disable-size.

Note

--disable-size currently affects interactive UI mode.

@zaldih
Copy link
Copy Markdown
Member

zaldih commented Apr 13, 2026

Thanks for opening this PR!

I've been reviewing it and found a bug: when --disable-size is enabled, the age column also stops working.
This happens because calculateFolderStats handles both the size and the modification time calculations, so skipping it entirely also skips the age (and other side effects).

The fix should keep calling calculateFolderStats and move the disableSize check inside it, skipping only the size part.

Comment on lines +771 to +791
if (this.config.disableSize) {
this.scanSubscription = scan$.subscribe({
next: () => this.printFoldersSection(),
error: (error) => this.newError(error),
complete: () => this.completeSearch(),
});
} else {
this.scanSubscription = scan$
.pipe(
mergeMap(
(nodeFolder) => this.scanService.calculateFolderStats(nodeFolder),
10, // Limit to 10 concurrent stat calculations at a time
),
tap((folder) => this.processFolderStatsForUi(folder)),
)
.subscribe({
next: () => this.printFoldersSection(),
error: (error) => this.newError(error),
complete: () => this.completeSearch(),
});
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of branching here, keep callng calculateFolderStats always. Move the disableSize check inside that emthod so it skips only the size calculation but still computes modificationTime.

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.

2 participants