mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-04 04:53:39 +00:00
fix(dashboard): show every folder when a drag springs into Shared
Dragging an item out of a shared folder and holding it over Up, Back or the Shared crumb opens Shared to drop into a folder there. The people filter, which now lasts while browsing shared items, could hide those folders, and its chips can't be pressed mid-drag. A drag arriving in Shared now sees everyone's folders.
This commit is contained in:
1 parent
41b519ee75
commit
e4888592c7
2 files changed
+21
-2
No files matched your search
@@ -2911,8 +2911,11 @@ const TabFiles = {
|
||||
}
|
||||
this.loadingFolder = false;
|
||||
// The people filter lasts while the user browses what was shared with
|
||||
// them, so Back out of a shared folder finds it still set.
|
||||
if ( is_owned_by_me(this.currentPath) ) this.sharerFilter = null;
|
||||
// them, so Back out of a shared folder finds it still set. A drag
|
||||
// springing into Shared sees every folder: chips can't be pressed mid-drag.
|
||||
if ( is_owned_by_me(this.currentPath) || (window.an_item_is_being_dragged && ! isSameDirRefresh) ) {
|
||||
this.sharerFilter = null;
|
||||
}
|
||||
this.syncSharedViewChrome();
|
||||
|
||||
// Update browser URL to reflect current file path (only when Files tab is active)
|
||||
|
||||
@@ -647,6 +647,22 @@ describe('TabFiles people filter across navigation', () => {
|
||||
expect($('.files .row.selected').attr('data-name')).toBe('b');
|
||||
});
|
||||
|
||||
it('shows every folder to a drag that springs into Shared', async () => {
|
||||
await TabFiles.renderDirectory(SHARED);
|
||||
await TabFiles.setSharerFilter('bob');
|
||||
await TabFiles.renderDirectory('/bob/b-uid/b');
|
||||
|
||||
window.an_item_is_being_dragged = true;
|
||||
try {
|
||||
await TabFiles.renderDirectory(SHARED);
|
||||
} finally {
|
||||
window.an_item_is_being_dragged = false;
|
||||
}
|
||||
|
||||
expect(TabFiles.sharerFilter).toBeNull();
|
||||
expect(listed()).toEqual(['a', 'b']);
|
||||
});
|
||||
|
||||
it("clears once the user goes back to their own files", async () => {
|
||||
await TabFiles.renderDirectory(SHARED);
|
||||
await TabFiles.setSharerFilter('bob');
|
||||
|
||||
Reference in new issue
Block a user