Skip to content

fix: show filenames on tight space - #65131

Open
kristian-zendato wants to merge 1 commit into
masterfrom
fix/files-list-responsive
Open

kristian-zendato wants to merge 1 commit into
masterfrom
fix/files-list-responsive

Conversation

@kristian-zendato

@kristian-zendato kristian-zendato commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add useFileListLayout that works out which parts of the list fit into the available width and hides them one at a time until the name column has at least 200px
  • FilesListVirtual computes the layout from the list width and the available columns. It then provides the layout to FileEntry, FileEntryActions, FilesListTableHeader and FilesListTableFooter, so the header, rows and footer always show the same columns.
  • Each row's FileEntryActions reports how much width its inline actions need. That includes render actions, which are measured with a ResizeObserver because they render asynchronously. The layout uses the largest width reported. That value is reset when the current folder or view changes.
  • Inline actions are no longer always hidden when isNarrow is set. They are now hidden only when there isn't enough space for them.

Screenshots

Before After
image image
image image

Checklist

AI (if applicable)

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

@kristian-zendato
kristian-zendato requested review from a team and skjnldsv as code owners October 5, 2026 11:06
@kristian-zendato
kristian-zendato requested review from sorbaugh and susnux and removed request for a team October 5, 2026 11:06
@susnux susnux added bug 3. to review Waiting for reviews feature: files team: Files Code maintained by 📁 Files team labels Oct 5, 2026
@susnux susnux added this to the Nextcloud 36 milestone Oct 5, 2026
@skjnldsv

skjnldsv commented Oct 6, 2026

Copy link
Copy Markdown
Member

Screenshots ? 😊

@kristian-zendato

Copy link
Copy Markdown
Contributor Author

@skjnldsv screenshots are added.

Comment on lines +11 to +14
/** Row height of the files list, must match `--row-height` */
const ROW_HEIGHT = 44
/** Margin around cells after the actions cell, must match `--cell-margin` */
const CELL_MARGIN = 14

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.

I am not really happy with this as this now causes two places to adjust in case we change anything on the styles.

Just asking: is it not possible to just have some break points even if not ideal?
If not then this is ok as well ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@susnux When I implement it, I also feel it but I think it's the best way for this.

About breakpoints, it is not a perfect solution as well because we have different columns on different file list(for example, personal files and deleted files).

@mpivchev

Copy link
Copy Markdown

Hi @kristian-zendato @susnux any ETA on possible merge?

@susnux susnux left a comment

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.

Works and definitively a good fix.
I would like to have @skjnldsv opinion on the implementation :)

Comment on lines +345 to +350
const renderActionsWidth = [...this.$el.querySelectorAll<HTMLElement>(':scope > .files-list__row-action--inline')]
.filter((element) => element.offsetWidth > 0)
.reduce((total, element) => total + element.offsetWidth + parseFloat(getComputedStyle(element).marginInlineEnd || '0'), 0)

reportInlineActionsWidth(this.inlineCapableActions.length * INLINE_ACTION_WIDTH + renderActionsWidth)
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I gotta say, not super fond of hard pixel computation in a reactive design like Files.

@skjnldsv skjnldsv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, I'm not against it, because I think it's a² nice addition and definitely something needed.
BUT, I ill only approve if many tests are added to ensure

  1. new columns added without matching tests fails, so we can caugh this and adjust accordingly
  2. various width computation and calculation are also tested, so that if something external changes, we also catch it

Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
Comment thread apps/files/src/composables/useFileListLayout.spec.ts Dismissed

@skjnldsv skjnldsv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great work!

This branch has not been deployed

No deployments
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 feature: files team: Files Code maintained by 📁 Files team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Filenames get hidden if space is tight

5 participants