Files
korean_comments_action/README.md
T

5.0 KiB

Korean comments action for Nextcloud 34

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

Screenshot

Nextcloud Files with stateful row icons and the comments-only sidebar tab

The selected file has comments, so its row shows the square-with-dots icon. Files without comments show an empty square. The dedicated 댓글 tab contains the native comment composer and history without mixing in Activity entries.

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().

Build and automated checks

Use Node 24, matching the installed package engines:

npm ci
npm run typecheck
npm test
npm run build

The production entry is generated as js/korean_comments_action-main.mjs. The listener therefore calls Util::addInitScript(Application::APP_ID, Application::APP_ID . '-main'); passing only 'main' would incorrectly resolve the nonexistent js/main.mjs.

Deployment commands (not run during this investigation)

Copy the app directory to /data/nextcloud/app/custom_apps/korean_comments_action, retaining appinfo/, lib/, and generated js/ (source/build metadata may also be retained), then run OCC in the Nextcloud PHP container as the web user:

php occ app:enable korean_comments_action

The app declares the filesystem type so its Files event listener is registered early. When upgrading from a build that lacked this type, disable and re-enable the app once so Nextcloud refreshes the persisted app type before restarting the app container.

Disable/rollback with:

php occ app:disable korean_comments_action

Manual acceptance test

  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

Upstream discussion

The verified findings and prototype design were shared, with the user's explicit permission and AI-authorship disclosure, in Nextcloud's existing issue:

License and public access

This repository is publicly readable and distributed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later), matching the license used by Nextcloud Server and the Nextcloud Files frontend library. Anyone may download, use, inspect, modify, and redistribute the source under the terms of that license. Anonymous visitors have read/clone access only; repository write access remains restricted to authorized maintainers.

See LICENSE for the complete terms.