Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

Description

Related Issue

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

The PR enhances the trash overview footer to display how many trash bins are empty when filtering is active.

  • Introduces emptyTrashSpaces calculation in footerTextTotal
  • Updates translation strings to include empty-trash count
  • Adds conditional logic to show the additional detail only when there are empty bins
Comments suppressed due to low confidence (2)

packages/web-app-files/src/views/trash/Overview.vue:167

  • There are no tests covering the branch when there are empty trash spaces; consider adding unit tests for footerTextTotal to verify both conditional outputs.
const footerTextTotal = computed(() => {

packages/web-app-files/src/views/trash/Overview.vue:171

  • These new translation strings introduce additional keys; ensure the project's i18n catalogs are updated so translators see and handle the new variants.
    return $ngettext(

Comment on lines +168 to +176
const emptyTrashSpaces = unref(spaces).filter((s) => s.hasTrashedItems === false)
if (!emptyTrashSpaces.length) {
return $ngettext(
'%{spaceCount} trash bin in total',
'%{spaceCount} trash bins in total',
unref(spaces).length,
{
spaceCount: unref(spaces).length.toString()
Copy link

Copilot AI Jul 12, 2025

Choose a reason for hiding this comment

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

Repeatedly calling unref(spaces) for filtering and counting could be optimized by storing the unwrapped array in a local variable once, then deriving emptyTrashSpaces and totalSpaces from it.

Suggested change
const emptyTrashSpaces = unref(spaces).filter((s) => s.hasTrashedItems === false)
if (!emptyTrashSpaces.length) {
return $ngettext(
'%{spaceCount} trash bin in total',
'%{spaceCount} trash bins in total',
unref(spaces).length,
{
spaceCount: unref(spaces).length.toString()
const unwrappedSpaces = unref(spaces)
const emptyTrashSpaces = unwrappedSpaces.filter((s) => s.hasTrashedItems === false)
if (!emptyTrashSpaces.length) {
return $ngettext(
'%{spaceCount} trash bin in total',
'%{spaceCount} trash bins in total',
unwrappedSpaces.length,
{
spaceCount: unwrappedSpaces.length.toString()

Copilot uses AI. Check for mistakes.
@AlexAndBear AlexAndBear merged commit 61e9db2 into main Jul 14, 2025
23 of 24 checks passed
@AlexAndBear AlexAndBear deleted the issues/936 branch July 14, 2025 12:12
This was referenced Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Counter not updating when trash bins are filtered

3 participants