[PR #745] [MERGED] feat(connections): add folders for organising API connections #4758

Closed
opened 2026-10-22 04:10:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/745
Author: @Romuromylus
Created: 5/12/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @Romuromylus

Base: main ← Head: fix/connection-folders


📝 Commits (3)

  • cc4e664 feat(connections): add folders for organising API connections
  • be2f6a7 fix(connections): register api_connection_folders in file-backed store
  • c2b789a Merge branch 'main' into fix/connection-folders

📊 Changes

11 files changed (+779 additions, -100 deletions)

View changed files

📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+474 -100)
➕ packages/client/src/hooks/use-connection-folders.ts (+75 -0)
📝 packages/server/src/db/file-backed-store.ts (+1 -0)
📝 packages/server/src/db/migrate.ts (+19 -0)
➕ packages/server/src/db/schema/connection-folders.ts (+14 -0)
📝 packages/server/src/db/schema/connections.ts (+4 -0)
📝 packages/server/src/db/schema/index.ts (+1 -0)
➕ packages/server/src/routes/connection-folders.routes.ts (+86 -0)
📝 packages/server/src/routes/index.ts (+2 -0)
➕ packages/server/src/services/storage/connection-folders.storage.ts (+88 -0)
📝 packages/shared/src/types/connection.ts (+15 -0)

📄 Description

Linked issue

Closes #686

Why this change

Users with many connections (ComfyUI workflow variants, OpenRouter / NanoGPT model sets, etc.) currently see a flat scrollable list in the Connections panel. The reporter asked for a folder system mirroring the chat-folder UX. Triage labelled it normal-scope and suggested reusing the app's existing folder-style interaction model, starting with the smallest first slice — which is what this PR does.

What changed

  • New table api_connection_folders (id, name, color, sort_order, collapsed, timestamps), created via the idempotent runtime migrator in packages/server/src/db/migrate.ts.
  • api_connections table gains nullable folder_id and sort_order columns. Pure additive ALTER TABLE ADD COLUMN migrations — safe on existing installs, zero impact on connection selection / generation / agent code paths.
  • Server: new connection-folders.storage.ts (CRUD + reorder + move) and connection-folders.routes.ts mounted at /api/connection-folders for GET /, POST /, PATCH /:id, DELETE /:id, POST /reorder, POST /move-connection, POST /reorder-connections.
  • Shared: APIConnection gains folderId: string | null and sortOrder: number; new ConnectionFolder type.
  • Client: new use-connection-folders.ts React Query hook module; ConnectionsPanel.tsx now renders folders above the unfiled list with the same FolderRow UX pattern used by chat folders (drag-to-reorder, expand/collapse, rename, delete). Each connection row gains a "Move to folder" pill action when at least one folder exists.
  • Color picker UI is intentionally deferred — the color column is reserved so a small follow-up can add the picker without another schema change.

Out-of-scope for this PR (deferred to follow-ups): drag-to-reorder within a folder, batch multi-select move, color picker UI, per-folder default connection.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify creating a folder via inline input (Enter to confirm, Esc/blur to cancel).
  • Manually verify moving a connection into a folder and back to Unfiled via the FolderOpen pill action + modal picker.
  • Manually verify renaming a folder (Pencil button) and deleting one (Trash button → confirm dialog → connections inside reappear under Unfiled).
  • Manually verify expand/collapse and the drag-handle reorder of folders.
  • Manually verify Unfiled connections render unchanged when zero folders exist (no UX regression for users who never create a folder).
  • Manually verify Add/Duplicate/Shuffle/Delete connection actions still work on both filed and unfiled rows.
  • Manually verify in dark + light mode and at mobile viewport (action pill stays visible per panel conventions).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

image

Summary by CodeRabbit

  • New Features
    • Organize connections into custom folders for improved organization
    • Rename, delete, and collapse folders to manage your workspace
    • Move connections between folders through a dedicated interface
    • Drag-to-reorder folders to customize your organization
    • Separate "Unfiled connections" section for unorganized items
    • Assign custom colors to folders for visual distinction

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/745 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 5/12/2026 **Status:** ✅ Merged **Merged:** 5/12/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `main` ← **Head:** `fix/connection-folders` --- ### 📝 Commits (3) - [`cc4e664`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cc4e664579a2a285749a6f39d3e2301b74a4669b) feat(connections): add folders for organising API connections - [`be2f6a7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/be2f6a7beee5ca4ed29dd861b4cc06e88b9531b3) fix(connections): register api_connection_folders in file-backed store - [`c2b789a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c2b789aa89dbdaef9edc4683984aea97e38495e5) Merge branch 'main' into fix/connection-folders ### 📊 Changes **11 files changed** (+779 additions, -100 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+474 -100) ➕ `packages/client/src/hooks/use-connection-folders.ts` (+75 -0) 📝 `packages/server/src/db/file-backed-store.ts` (+1 -0) 📝 `packages/server/src/db/migrate.ts` (+19 -0) ➕ `packages/server/src/db/schema/connection-folders.ts` (+14 -0) 📝 `packages/server/src/db/schema/connections.ts` (+4 -0) 📝 `packages/server/src/db/schema/index.ts` (+1 -0) ➕ `packages/server/src/routes/connection-folders.routes.ts` (+86 -0) 📝 `packages/server/src/routes/index.ts` (+2 -0) ➕ `packages/server/src/services/storage/connection-folders.storage.ts` (+88 -0) 📝 `packages/shared/src/types/connection.ts` (+15 -0) </details> ### 📄 Description ## Linked issue Closes #686 ## Why this change Users with many connections (ComfyUI workflow variants, OpenRouter / NanoGPT model sets, etc.) currently see a flat scrollable list in the Connections panel. The reporter asked for a folder system mirroring the chat-folder UX. Triage labelled it `normal-scope` and suggested reusing the app's existing folder-style interaction model, starting with the smallest first slice — which is what this PR does. ## What changed - **New table** `api_connection_folders` (id, name, color, sort_order, collapsed, timestamps), created via the idempotent runtime migrator in `packages/server/src/db/migrate.ts`. - **`api_connections` table** gains nullable `folder_id` and `sort_order` columns. Pure additive `ALTER TABLE ADD COLUMN` migrations — safe on existing installs, zero impact on connection selection / generation / agent code paths. - **Server**: new `connection-folders.storage.ts` (CRUD + reorder + move) and `connection-folders.routes.ts` mounted at `/api/connection-folders` for `GET /`, `POST /`, `PATCH /:id`, `DELETE /:id`, `POST /reorder`, `POST /move-connection`, `POST /reorder-connections`. - **Shared**: `APIConnection` gains `folderId: string | null` and `sortOrder: number`; new `ConnectionFolder` type. - **Client**: new `use-connection-folders.ts` React Query hook module; `ConnectionsPanel.tsx` now renders folders above the unfiled list with the same `FolderRow` UX pattern used by chat folders (drag-to-reorder, expand/collapse, rename, delete). Each connection row gains a "Move to folder" pill action when at least one folder exists. - **Color picker UI is intentionally deferred** — the `color` column is reserved so a small follow-up can add the picker without another schema change. Out-of-scope for this PR (deferred to follow-ups): drag-to-reorder *within* a folder, batch multi-select move, color picker UI, per-folder default connection. ## Validation - [x] ``pnpm check`` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed ``CONTRIBUTING.md`` ### Manual verification notes - Manually verify creating a folder via inline input (Enter to confirm, Esc/blur to cancel). - Manually verify moving a connection into a folder and back to Unfiled via the FolderOpen pill action + modal picker. - Manually verify renaming a folder (Pencil button) and deleting one (Trash button → confirm dialog → connections inside reappear under Unfiled). - Manually verify expand/collapse and the drag-handle reorder of folders. - Manually verify Unfiled connections render unchanged when zero folders exist (no UX regression for users who never create a folder). - Manually verify Add/Duplicate/Shuffle/Delete connection actions still work on both filed and unfiled rows. - Manually verify in dark + light mode and at mobile viewport (action pill stays visible per panel conventions). ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <img width="448" height="839" alt="image" src="https://github.com/user-attachments/assets/1a18d6f7-0bf1-4d6c-88cf-bdbb4d94ed59" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Organize connections into custom folders for improved organization * Rename, delete, and collapse folders to manage your workspace * Move connections between folders through a dedicated interface * Drag-to-reorder folders to customize your organization * Separate "Unfiled connections" section for unorganized items * Assign custom colors to folders for visual distinction [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/745) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:24 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4758
No description provided.