Skip to content

fix(files): keep reactivity when destructuring the store in grid view - #63188

Open
ELHart05 wants to merge 3 commits into
nextcloud:masterfrom
ELHart05:fix/grid-entry-store-reactivity
Open

fix(files): keep reactivity when destructuring the store in grid view#63188
ELHart05 wants to merge 3 commits into
nextcloud:masterfrom
ELHart05:fix/grid-entry-store-reactivity

Conversation

@ELHart05

Copy link
Copy Markdown

Summary

#59942 fixed FileEntry.vue but left FileEntryGrid.vue behind, so the same bug is still there in grid view on 34.

The grid entry destructures the store directly:

const {
	activeFolder,
	activeNode,
	activeView,
} = useActiveStore()

Those are plain values captured on the first render and never update again. FileEntryMixin.execDefaultAction hands this.activeFolder to the file action, the viewer builds its route from folder.path, and the list gets navigated to whichever folder was active back then.

Reproduced on 34.0.2 with the list in grid view, going into /Level1/Level2/Level3/Level4 and clicking a PDF:

pushState    /apps/files/files/79?dir=/Level1/Level2/Level3/Level4
replaceState /apps/files/files/80?dir=/&editing=false&openfile=true
replaceState /apps/files/files/80?dir=/Level1/Level2/Level3/Level4&editing=false&openfile=true

The first replace goes to dir=/, so the root is fetched and the file opens over the wrong listing. It corrects itself a moment later, but the wrong navigation has already happened, and that is the "dropped back at the root" from #59941. The same steps in list view keep the right dir the whole way.

Same storeToRefs change as #59942. The setup block already carried a // keep in sync with FileEntry.vue comment, which is what got missed.

FileEntryGrid.spec.ts covers it: it fails on master and passes with the change.

Worth backporting to stable34 and stable33, both are affected. Happy to request that once this looks good.

Checklist

@ELHart05
ELHart05 requested review from a team and skjnldsv as code owners August 12, 2026 16:03
@ELHart05
ELHart05 requested review from kristian-zendato and susnux and removed request for a team August 12, 2026 16:03
FileEntryGrid destructured useActiveStore() directly, so activeFolder,
activeNode and activeView were plain snapshots taken when the entry was
first rendered. Opening a file from grid view therefore handed the file
actions a stale folder, and the viewer navigated the list to whichever
folder happened to be active back then: from a nested folder this drops
you at the root, or a level or two above, with the file open on top.

Same fix as nextcloud#59942, which covered FileEntry but left its grid counterpart
behind despite the "keep in sync with FileEntry.vue" note above it.

Signed-off-by: ELHart05 <o.allaoua@esi-sba.dz>
@ELHart05
ELHart05 force-pushed the fix/grid-entry-store-reactivity branch from 9c3e503 to 208428a Compare August 12, 2026 16:11
@susnux susnux added bug 3. to review Waiting for reviews labels Aug 12, 2026
@susnux susnux added this to the Nextcloud 35 milestone Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants