[verified] add comments-only file panel

This commit is contained in:
2026-09-19 09:45:20 +00:00
parent a2bfb69ea8
commit a84aa33d82
11 changed files with 689 additions and 104 deletions
+11 -8
View File
@@ -1,10 +1,12 @@
# Korean comments action for Nextcloud 34
Minimal custom app that adds a **댓글** icon directly to each eligible Files row and opens that node's comments UI without using the `…` menu. On Nextcloud 34 with Activity enabled, comments are integrated into sidebar tab `activity`; if Activity is disabled, the app falls back to tab `comments`.
Minimal custom app that adds an icon-only **댓글** action directly to each eligible Files row. An empty square means no comments; a square containing three dots means at least one comment exists. Clicking either icon opens a dedicated **댓글** sidebar tab containing only the native comment composer and comment history, not the Activity feed.
## Why these APIs
The installed Nextcloud 34.0.4 bundle uses `@nextcloud/files` 4.0.0. Its own Comments app implements the same flow with `registerFileAction()`, `getSidebar()`, `sidebar.open(node, tabId)`, and `sidebar.setActiveTab(tabId)`. The installed Activity app registers sidebar tab ID `activity`; Comments registers tab ID `comments` only when Activity integration is unavailable.
The installed Nextcloud 34.0.4 bundle uses `@nextcloud/files` 4.0.0. The app registers `oc:comments-count` before the Files listing loads, then uses the count to choose the row icon. It registers a supported custom Files sidebar tab and mounts Nextcloud Comments' native `OCA.Comments.View` in that tab, retaining native creation, history, edit, delete, mention, and permission behavior while avoiding the mixed Activity feed.
Nextcloud's built-in `comments-unread` row action is reused when unread comments exist so users still see only one comment icon. Its click target and icon are aligned with the dedicated comments-only tab; the custom action covers rows without unread comments.
The PHP bootstrap listens for `OCA\Files\Event\LoadAdditionalScriptsEvent`, the supported event fired while Files is rendered, and loads the frontend with `OCP\Util::addInitScript()`.
@@ -39,12 +41,13 @@ php occ app:disable korean_comments_action
## Manual acceptance test
1. Open **Files → Personal files**. Confirm one **댓글** icon appears directly on every eligible file row without opening the `…` menu.
2. Click **댓글**. Confirm the details sidebar opens for that exact filename, the **Activity** tab is active, existing comments load, and the comment composer is visible.
3. On the same file, switch to another sidebar tab and click **댓글** again. Confirm it switches back to Activity without closing the sidebar.
4. With the sidebar still open, use **댓글** on another file. Confirm the sidebar header and comments belong to the second file.
5. Select multiple rows. Confirm the action is not offered. Confirm it is also absent for nodes outside the supported `/files/<user>` tree or with `Permission.NONE`.
6. Optional fallback check on a test instance: disable Activity while leaving Comments enabled, reload Files, and confirm **댓글** opens the standalone **Comments** tab.
1. Open **Files → Personal files**. Confirm each eligible row shows only an icon without a `댓글` text label or a required `…` menu click.
2. Confirm a file with no comments uses an empty square and a file with one or more comments uses a square containing three dots.
3. Click either icon. Confirm the dedicated **댓글** tab opens for that exact file and contains the comment input plus comment history, with no Activity entries.
4. Create a comment, then edit and delete one of your own comments. Confirm the native controls and list updates work.
5. Click the same file's icon again while the sidebar is already open. Confirm the dedicated **댓글** tab remains active and never falls back to **활동**.
6. With the sidebar still open, use the icon on another file. Confirm the sidebar header, input, and comments belong to the second file.
7. Select multiple rows. Confirm the action is not offered. Confirm it is also absent for nodes outside the supported `/files/<user>` tree, nodes without a file ID, nodes with `Permission.NONE`, or when the Comments app is unavailable.
## Primary references