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

オープン
#67,004 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, typescript
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

[!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.

主要言語
PHP
スター
37.6k
フォーク
5.4k
平均マージ
1日 13時間
マージ済み PR(30日)
623

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/server のほかの issue

nextcloud/server の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。