Skip to content

feat(recent-files): allow configuring image grouping#58908

Open
cristianscheid wants to merge 6 commits intomasterfrom
feat/1701/recent-files-img-grouping
Open

feat(recent-files): allow configuring image grouping#58908
cristianscheid wants to merge 6 commits intomasterfrom
feat/1701/recent-files-img-grouping

Conversation

@cristianscheid
Copy link
Copy Markdown
Contributor

@cristianscheid cristianscheid commented Mar 13, 2026

  • Resolves: #

Summary

New settings have been added to the Files settings page allowing users to configure image grouping in the Recent Files view.

Behaviour

  • Grouping only occurs in the Recent Files view when this option is enabled
  • When an image upload is detected, a time window opens from its timestamp with a duration defined in the settings
    • Subsequent images uploaded within that window are collected into the same group
    • If a non-image file is uploaded within the active time window, grouping is suppressed and no group is formed for that batch
    • Once the window closes or is suppressed, the next uploaded image starts a fresh time window
    • This process repeats for the entire list, producing as many groups as the data allows
  • Groups can be expanded or collapsed to show/hide individual images
  • Selecting a group selects all images within it, with indeterminate state when partially selected

Visuals

demo.webm

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@cristianscheid
Copy link
Copy Markdown
Contributor Author

/compile

@cristianscheid cristianscheid force-pushed the feat/1701/recent-files-img-grouping branch from a9b23e1 to f08a1c9 Compare March 19, 2026 10:22
@nextcloud-command nextcloud-command force-pushed the feat/1701/recent-files-img-grouping branch from f08a1c9 to 11b45bf Compare March 19, 2026 11:25
@cristianscheid cristianscheid marked this pull request as ready for review March 19, 2026 11:40
@cristianscheid cristianscheid requested review from a team and skjnldsv as code owners March 19, 2026 11:40
@cristianscheid cristianscheid requested review from ArtificialOwl, CarlSchwan, leftybournes, nfebe and szaimen and removed request for a team March 19, 2026 11:40
@cristianscheid cristianscheid added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 19, 2026
@cristianscheid cristianscheid force-pushed the feat/1701/recent-files-img-grouping branch 2 times, most recently from 1da5753 to e872416 Compare March 20, 2026 10:27
nfebe
nfebe previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Contributor

@nfebe nfebe left a comment

Choose a reason for hiding this comment

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

yolod

@susnux
Copy link
Copy Markdown
Contributor

susnux commented Mar 23, 2026

Has this been approved by @nextcloud/designers ?

Copy link
Copy Markdown
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

blocking for two reasons:

  1. This is completely changing the UI/UX and should go through feature planning / @nextcloud/designers review
  2. Have you properly checked virtual scrolling? What happens if you extend them and then scroll down over the scroll order? Because now one item is no longer a fixed height and that can likely break all of the virtual scrolling

@cristianscheid
Copy link
Copy Markdown
Contributor Author

cristianscheid commented Mar 23, 2026

Has this been approved by @nextcloud/designers ?

Pinging as requested, thanks for the reminder! @marcoambrosini @kra-mo could you please take a look at this PR to see if it's ok from a design POV?

A demo video is available in the PR description, and below is an updated recording after incorporating @susnux suggestions, focusing on the grouping UI in the Recent section:

demo.webm

Also a closer screenshot:
image

@cristianscheid cristianscheid force-pushed the feat/1701/recent-files-img-grouping branch from e872416 to 31ab098 Compare March 23, 2026 17:35
Copy link
Copy Markdown
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

some comments otherwise

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMHO it makes more sense to make this more generic, meaning just make this a group based on mime type. Of cause for now you can use image formats but then we can adjust this if needed anytime and dont create special cases :)

The reason we have comparatively few issues in the files app nowadays is the results of the quite flexible way we changed if when migrated from jQuery.

@cristianscheid
Copy link
Copy Markdown
Contributor Author

  1. Have you properly checked virtual scrolling? What happens if you extend them and then scroll down over the scroll order? Because now one item is no longer a fixed height and that can likely break all of the virtual scrolling

Hi @susnux, not sure if this is what you meant, but I've tested manually with 2 image groups and 33 images total. Expanding and collapsing groups correctly pushes items down and up without any overlap, gaps, or rendering issues while scrolling.

demo.webm

@kra-mo
Copy link
Copy Markdown
Member

kra-mo commented Mar 23, 2026

The feature itself looks like a nice enhancement from the design side, however it should definitely not be opt-in and we should definitely not add settings for this in general. See our design guidelines.

Can't it just be enabled by default with common image types and that's that, without extra options?

@kra-mo
Copy link
Copy Markdown
Member

kra-mo commented Mar 23, 2026

Common image types I guess being .png, .jpg, .jpeg, .webp, .avif, .jxl, .gif, .tiff, .heic, did I miss something?

@kra-mo
Copy link
Copy Markdown
Member

kra-mo commented Mar 23, 2026

Ah, it's actually using MIME types. In that case, can't it just be image/* in general?

cristianscheid and others added 5 commits March 24, 2026 09:17
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
…er to FileEntry component

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
…mports on FilesListVirtual

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
…yntax

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
v-bind="$attrs" />
</template>

<script lang="ts">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please directly use script setup syntax for all new components, helping to not create new backlog and simplify boilerplate

@update:modelValue="onSelectionChange" />
</td>

<td class="files-list__row-name" @click="emit('toggle', source.source)">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This must be changed this is not accessible.
You cannot put the event listener on the td element as this is not interactive for keyboard users.

You will have to put in either a proper a or button element with the proper semantics to make this accessible.

Comment on lines +6 to +9
import type { INode } from '@nextcloud/files'

// eslint-disable-next-line perfectionist/sort-named-imports
import { type Ref, computed } from 'vue'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please fix instead of ignore this.

Suggested change
import type { INode } from '@nextcloud/files'
// eslint-disable-next-line perfectionist/sort-named-imports
import { type Ref, computed } from 'vue'
import type { INode } from '@nextcloud/files'
import type { Ref } from 'vue'
import { computed } from 'vue'

Comment on lines +93 to +99
'image/png',
'image/jpeg',
'image/gif',
'image/webp',
'image/avif',
'image/heic',
'image/heif',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about tif or other image formats?
We could just always (if grouping is enabled) group by mime group, e.g. image/* and / or video/*

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid cristianscheid force-pushed the feat/1701/recent-files-img-grouping branch from bc434eb to 2d9f283 Compare March 24, 2026 23:57
@cristianscheid
Copy link
Copy Markdown
Contributor Author

Quick update on the state of this PR:

  • after internal discussion with @artonge, it was agreed that this PR should focus only on the backend part for now.

I'll update the PR asap.

Copy link
Copy Markdown
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

Is there some demand for it?
I'm asking because I'm really not sure this is something we want. The files app aims to be as simple as we can, the virtual scroller is already sooo complicated to maintain, this is really not somethign we wanna mess with.

How does it looks like from an accessible POV too ? From a semantic POV ? With a screen reader ?

Personally, while this looks nice, I don't think this have a place on our FIles app as of now. I've never seen this mechanics used in another file browser :)

@skjnldsv skjnldsv dismissed nfebe’s stale review March 26, 2026 17:12

@nfebe please no yolo on such drastic changes

@cristianscheid
Copy link
Copy Markdown
Contributor Author

Is there some demand for it? I'm asking because I'm really not sure this is something we want. The files app aims to be as simple as we can, the virtual scroller is already sooo complicated to maintain, this is really not somethign we wanna mess with.

How does it looks like from an accessible POV too ? From a semantic POV ? With a screen reader ?

Personally, while this looks nice, I don't think this have a place on our FIles app as of now. I've never seen this mechanics used in another file browser :)

Thanks for the input @skjnldsv, really appreciated! After internal discussion, this PR will likely not move forward as is. We'll focus on the backend part (exposing configs/flags via OCC) and the frontend changes will probably be dropped.

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 enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants