Skip to content

fix: reload favorites and shares when clicking the current breadcrumb or shares tab - #3477

Merged
AlexAndBear merged 2 commits into
mainfrom
fix/reload-on-current-location-click
Sep 30, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
fix/reload-on-current-location-click

Conversation

@AlexAndBear

Copy link
Copy Markdown
Member

Description

Clicking the current breadcrumb item reloads the list in Personal, Spaces, Deleted files and the admin settings views, but not in Favorites and the Shares views. Those views set to on their breadcrumb item, pointing to the route that is already active. The router treats navigating to the current route as a no-op, so nothing happens. The same applies to the Shares navigation tabs (Shared with me, Shared with others, Shared via link): clicking the active tab does nothing.

Changes:

  • Favorites, Shared with me, Shared with others and Shared via link: the breadcrumb item uses onClick: () => loadResourcesTask.perform() instead of to. This is the same pattern as the Spaces view.
  • SharesNavigation: clicking the active tab (desktop list and mobile dropdown) publishes app.files.list.load. This event is already used to reload Personal and Deleted files. Clicking any other tab still just navigates.
  • The Shares views subscribe to app.files.list.load on mount and reload their list when it's published. They unsubscribe on unmount. The SSE handlers only publish this event while a folder view (files-spaces-generic) is active, so this doesn't cause extra reloads on the Shares views.
  • Fixed the isStativNav typo in the Spaces view breadcrumb (isStaticNav).

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • test environment: local dev setup (Vite dev server + OpenCloud backend via docker-compose), Chromium; Vitest
  • test case 1: click the current breadcrumb item in Favorites: before no request, after REPORT /dav/spaces
  • test case 2: click the current breadcrumb item in Shared with me, Shared with others and Shared via link: before no request, after the shares are reloaded (sharedWithMe / sharedByMe)
  • test case 3: click the active Shares tab on each of the three Shares views: the shares are reloaded
  • test case 4: click an inactive Shares tab: navigates to that view and loads it once
  • test case 5: new unit tests for SharesNavigation (active tab publishes the reload event, inactive tab doesn't); web-app-files unit tests and type check pass

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)

@AlexAndBear
AlexAndBear merged commit 24192ee into main Sep 30, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the fix/reload-on-current-location-click branch September 30, 2026 08:48
@openclouders openclouders mentioned this pull request Sep 30, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants