54 lines
3.0 KiB
Markdown
54 lines
3.0 KiB
Markdown
# Korean comments action for Nextcloud 34
|
|
|
|
Minimal custom app that adds **댓글** to each eligible Files row action menu and opens that node's comments UI. On Nextcloud 34 with Activity enabled, comments are integrated into sidebar tab `activity`; if Activity is disabled, the app falls back to tab `comments`.
|
|
|
|
## 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 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:
|
|
|
|
```bash
|
|
npm ci
|
|
npm run typecheck
|
|
npm test
|
|
npm run build
|
|
```
|
|
|
|
The production entry is generated as `js/korean_comments_action-main.mjs`. `Util::addInitScript(Application::APP_ID, 'main')` resolves that app-prefixed asset.
|
|
|
|
## 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:
|
|
|
|
```bash
|
|
php occ app:enable korean_comments_action
|
|
```
|
|
|
|
Disable/rollback with:
|
|
|
|
```bash
|
|
php occ app:disable korean_comments_action
|
|
```
|
|
|
|
## Manual acceptance test
|
|
|
|
1. Open **Files → Personal files**, then open a file row's `…` menu. Confirm one **댓글** item appears and is not an inline icon.
|
|
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.
|
|
|
|
## Primary references
|
|
|
|
- Files event: https://docs.nextcloud.com/server/latest/developer_manual/basics/events.html
|
|
- Files frontend API: https://nextcloud-libraries.github.io/nextcloud-files/
|
|
- `registerFileAction`: https://nextcloud-libraries.github.io/nextcloud-files/functions/index.registerFileAction.html
|
|
- `getSidebar`: https://nextcloud-libraries.github.io/nextcloud-files/functions/index.getSidebar.html
|
|
- Bootstrap API: https://docs.nextcloud.com/server/latest/developer_manual/app_development/bootstrap.html
|