coreforge196 opened a new issue, #42798: URL: https://github.com/apache/superset/issues/42798
## [SIP] Proposal for hierarchical dashboard folders ### Motivation Large Superset deployments can contain hundreds or thousands of dashboards. The current flat dashboard list relies mainly on search, ownership, status, and tags, which makes repeated navigation and delegated organization difficult. This proposal adds an optional hierarchical folder structure to the dashboard list while keeping existing dashboards uncategorized by default. ### Proposed Change Add hierarchical dashboard folders to the dashboard list. Users with the corresponding permissions can create, rename, move, and delete folders, and move dashboards into a writable folder or back to the uncategorized root. The folder tree is collapsible and synchronized with the existing Folder list filter. Selecting a folder filters the dashboard list, while selecting a Folder filter expands and selects the matching tree path. Folder visibility is access-scoped. Administrators can manage all folders. Other users see folders they own, folders containing dashboards they can access, and the required ancestor path. Read-only folders remain usable for navigation, but cannot be selected as write targets. Folder names are trimmed and compared case-insensitively; duplicate names within the same parent and a child matching its parent name are rejected. The navigation tree does not display dashboard counts, keeping the narrow sidebar focused on folder wayfinding. Deleting a folder deletes its descendant folders but preserves dashboards by moving them to the uncategorized root. This avoids destructive dashboard deletion. ### New or Changed Public Interfaces - Add the `DashboardFolder` metadata model and its owner association. - Add nullable `Dashboard.folder_id`. - Add `GET /api/v1/dashboard_folder/` for the visible folder tree and access-scoped counts. - Add `POST /api/v1/dashboard_folder/` to create a folder. - Add `PUT /api/v1/dashboard_folder/<folder_id>` to rename or move a folder. - Add `DELETE /api/v1/dashboard_folder/<folder_id>` to delete a folder subtree and uncategorize its dashboards. - Add `PUT /api/v1/dashboard_folder/dashboard/<dashboard_id>` to move a dashboard or return it to the uncategorized root. - Add `DashboardFolder` permissions for read, create, rename, delete, and move-dashboard operations. - Extend the dashboard list filter contract with an optional folder filter. - Add a collapsible folder tree and dashboard move workflow to the dashboard list UI. No existing dashboard URL, chart URL, CLI command, or deployment interface changes. ### New dependencies None. The implementation uses existing Superset backend, frontend, and UI dependencies. ### Migration Plan and Compatibility The migration creates `dashboard_folders` and `dashboard_folder_user`, adds the nullable `dashboards.folder_id` foreign key and index, and uses `ON DELETE SET NULL` for dashboard-folder associations. Existing dashboards remain valid and uncategorized because `folder_id` defaults to `NULL`. The downgrade removes the index, foreign key, and column before dropping the new association and folder tables. The implementation uses the existing Superset migration helpers and batch-alter pattern. No data rewrite or service downtime is expected beyond the normal metadata schema migration window. Upgrade and downgrade behavior will be validated on Superset-supported database engines during review and CI. ### Rejected Alternatives - Tags only: tags support cross-cutting classification but do not provide an opinionated navigational hierarchy or parent-child permissions. - Client-only folders: they cannot provide shared organization, server-side filtering, or access-scoped counts. - Encoding folder paths in dashboard titles or metadata: this is fragile, difficult to authorize, and creates rename and move consistency problems. - Deleting dashboards with folders: folder cleanup should not destroy dashboard content. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
