feat: folder system for datasets#694
Merged
Merged
Conversation
- Added folder creation, renaming, and deletion functionalities. - Integrated folder management into the ModelsContext and ModelsLeftBar components. - Created DatasetFolderList component for displaying datasets organized in folders. - Implemented drag-and-drop functionality for moving datasets between folders. - Updated dataset type to include folder_id for association with folders. - Enhanced internationalization support for folder-related messages.
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a first-class folder system for organizing datasets end-to-end: DB schema + API endpoints + frontend sidebar UI (including drag & drop), with seed-data initialization and i18n updates.
Changes:
- Backend: adds
Foldermodel/table, nullableDataset.folder_idFK (SET NULL), folder CRUD endpoints, and extends dataset PATCH to acceptfolder_id. - Frontend: adds folder API/types/hooks and replaces flat dataset lists in sidebars with a folder-based list supporting DnD and inline folder management.
- Operations/i18n: new Alembic migration, seed datasets assigned to an “Example datasets” folder, and locale strings added across 5 languages.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| DashAI/front/yarn.lock | Locks new @dnd-kit/* transitive dependencies for drag & drop. |
| DashAI/front/package.json | Adds @dnd-kit/core dependency for DnD support. |
| DashAI/front/src/utils/i18n/locales/en/datasets.json | Adds folder-related labels/messages/errors (EN). |
| DashAI/front/src/utils/i18n/locales/es/datasets.json | Adds folder-related labels/messages/errors (ES). |
| DashAI/front/src/utils/i18n/locales/de/datasets.json | Adds folder-related labels/messages/errors (DE). |
| DashAI/front/src/utils/i18n/locales/pt/datasets.json | Adds folder-related labels/messages/errors (PT). |
| DashAI/front/src/utils/i18n/locales/zh/datasets.json | Adds folder-related labels/messages/errors (ZH). |
| DashAI/front/src/types/folder.ts | Introduces frontend IFolder type. |
| DashAI/front/src/types/dataset.ts | Adds folder_id to dataset type. |
| DashAI/front/src/api/folders.ts | Implements folder REST API client wrapper. |
| DashAI/front/src/hooks/datasets/useFolders.js | Adds folder state + CRUD hook with snackbar feedback. |
| DashAI/front/src/hooks/datasets/useDatasets.js | Adds optimistic dataset move-to-folder action. |
| DashAI/front/src/components/threeSectionLayout/DatasetFolderList.jsx | New folder-aware sidebar list with DnD + inline folder CRUD UI. |
| DashAI/front/src/components/notebooks/DatasetNotebookLeftBar.jsx | Swaps dataset list to DatasetFolderList and wires folder actions. |
| DashAI/front/src/components/models/ModelsLeftBar.jsx | Swaps dataset list to DatasetFolderList and wires folder actions. |
| DashAI/front/src/components/models/ModelsContext.jsx | Exposes folder state/actions in models context and triggers initial fetch. |
| DashAI/front/src/components/custom/contexts/DatasetsAndNotebooksContext.jsx | Exposes folder state/actions in datasets/notebooks context. |
| DashAI/back/dependencies/database/models.py | Adds Folder ORM model and Dataset.folder_id relationship/FK. |
| DashAI/back/api/api_v1/schemas/folders_params.py | Adds Pydantic schemas for folder create/update/response. |
| DashAI/back/api/api_v1/schemas/datasets_params.py | Extends dataset schemas to include folder_id. |
| DashAI/back/api/api_v1/endpoints/folders.py | Adds folder CRUD endpoints under /api/v1/folder. |
| DashAI/back/api/api_v1/endpoints/datasets.py | Extends dataset PATCH endpoint to handle folder_id. |
| DashAI/back/api/api_v1/api.py | Registers the new folders router. |
| DashAI/back/seeds/init.py | Creates “Example datasets” folder and assigns seeded datasets to it. |
| DashAI/alembic/versions/f1a2b3c4d5e6_add_folder_system.py | Migration creating folder table and adding dataset.folder_id FK. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move dnd-kit imports before styled component in DatasetFolderList - Add missing title prop to DatasetFolderList in ModelsLeftBar - Remove redundant fetchFolders() call in ModelsContext useEffect - Migrate folders_params schema to Pydantic v2 ConfigDict - Fix _get_or_create_example_folder return type to int | None - Update update_dataset docstring to mention folder_id
cristian-tamblay
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Foldermodel (dedicated DB table) with a nullablefolder_idFK onDataset(ondelete="SET NULL"so deleting a folder never deletes its datasets).GET/POST /api/v1/folder,PATCH/DELETE /api/v1/folder/{id}.PATCH /api/v1/dataset/{id}extended to acceptfolder_id(usesmodel_fields_setto distinguish "not sent" fromnull).DatasetFolderListcomponent replaces the flatCollapsibleListin both the Datasets/Notebooks and Models sidebars. Features:@dnd-kit/core, 5px activation distance to preserve click/edit).Migration
Alembic revision
f1a2b3c4d5e6— runs automatically on startup. Usesop.batch_alter_tablefor SQLite FK compatibility.Test plan
alembic upgrade head/alembic downgrade -1clean round-trip.pytest tests/back/andyarn lintpass.Notes (optional)
Additional context or considerations.