Files: context menu on right-click in the empty area of the file list

Ouverte
#67,004 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
45/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
javascript, typescript
Domaine
frontend

Piste de recherche

Start from apps/files/src/components/FileEntryMixin.ts and trace onRightClick to see how row and selection menus open, then find the container component that renders the file list. Add a contextmenu handler there that reuses the UploadPicker "New" menu when nothing is selected and actionsMenuStore.opened = 'global' for a multi-selection, and check where --mouse-pos-x/y are set and cleared on main.app-content. Done when empty list space, the footer and the empty-folder view open the right menu while rows, inputs and breadcrumbs keep native behaviour.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

[!TIP]

Help move this idea forward
  • Use the 👍 reaction to show support for this feature.
  • Avoid commenting unless you have relevant information to add; unnecessary comments create noise for subscribers.
  • Subscribe to receive notifications about status changes and new comments.

Is your feature request related to a problem? Please describe.

In Files, right-clicking a file or folder row opens the Files actions menu. Right-clicking anywhere else in the file list opens the browser's native context menu instead. That includes the empty space below the rows, the summary footer and the empty-folder view. This also happens when items are selected, so there is no right-click way to reach the actions for the selection unless you hit one of the selected rows.

Users coming from desktop file managers (and other web drives) expect a context menu in the empty area. They reported it as missing.

Seen on Nextcloud 35 (list and grid view). The row handling is onRightClick in apps/files/src/components/FileEntryMixin.ts. Nothing handles contextmenu on the list container.

Describe the solution you'd like

A Files context menu, opened at the mouse, for right-clicks in the empty area of the file list:

  • nothing selected: the "New" menu of the current folder (New folder, Upload files, templates, …), i.e. the UploadPicker menu, as long as the user can create in this folder
  • items selected: the batch actions menu for the selection. Today this is what a right-click on a selected row opens when more than one item is selected (actionsMenuStore.opened = 'global').

Rows, inputs, the breadcrumbs and a second right-click while the menu is open could keep the current behaviour (the native menu).

Describe alternatives you've considered

We currently ship a small script in a custom app that listens for contextmenu on the document. It opens the existing menus by clicking their toggles (.files-list__header-upload-button, [data-cy-files-list-selection-actions]) and moves the popover to the cursor. It works, but it depends on the DOM structure and will break with UI changes, so a native solution would be much better.

Additional context

Related: #41223 (right-click on breadcrumbs), #53342 (details of the current folder).

One detail we noticed while doing this: --mouse-pos-x/y set on main.app-content by onRightClick are only removed by the per-row openedMenu watcher. After a right-click on a multi-selected row (global menu), they stay set, and the next menu inside the app content opens at the old cursor position.

Langage dominant
PHP
Étoiles
37.6k
Forks
5.4k
Merge moyen
1 j 13 h
PR mergées (30 j)
623

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de nextcloud/server

Toutes les issues de nextcloud/server

Issues similaires

Plus d'issues PHP

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.