Skip to content

Files list: the empty state says "use New" when the New menu is turned off, and gives the drag tip twice #2189

Open

Description

@SudoThijn

Description

An empty files list (CnFilesBrowser) says "Drop files here, or use New", also when the host turned the New menu off with newMenu: false. There is then no New button to use. Right under it the drop hint says "Or drag files onto this list.", so the empty list gives the drag tip twice.

In Dossiq this shows on the Files tab of any case without files, found while comparing it with the design board DqDocumentenBeheer. Dossiq shows Add files and New folder as their own buttons and turns the New menu off.

Steps to reproduce

  1. In Dossiq, open a case that has no files and its Files tab.
  2. Read the text in the empty list and the line under it.

Expected behaviour

The empty state names only controls that are on screen. With newMenu: false and an upload button, it points to Add files (for example "Drop files here, or use Add files"). When the drop hint already shows under the list, the empty state does not repeat the drag tip.

Actual behaviour

The empty list reads "This folder is empty / Drop files here, or use New", with "Or drag files onto this list." under it. The toolbar shows Columns, Request a file from a party, New folder and Add files; there is no New.

The empty Files tab: "Drop files here, or use New" while the toolbar has no New button, and "Or drag files onto this list." under it

Cause

src/components/CnFilesBrowser/CnFilesBrowser.vue:1228-1231: the emptyHint prop defaults to t('nextcloud-vue', 'Drop files here, or use New') without looking at newMenu (line 1104) or uploadButton. The drop hint (dropHint, default text at line 1218) is drawn independently of it.

A host can pass its own emptyHint as a workaround, but the default should match the controls the browser actually shows.

Acceptance criteria

  • With newMenu: false, the default empty hint does not mention New
  • With an upload button, the default empty hint names it
  • An empty list with dropHint on gives the drag tip once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions