- Implement `ExampleDataService` to export/import Characters, Equipments, Poses, Expressions, and Generations.
- Add `generate-example` script to `package.json` to generate example data from current DB.
- Add startup logic in `src/index.ts` to seed example data if system is uninitialized and no data exists.
- Store system initialization state in `Setting` table.
- Add comprehensive tests for `ExampleDataService` in `src/service/example-data.test.ts` mocking filesystem and database operations.
- Refactor `src/service/example-data.ts` to use default `node:fs` import for better test compatibility.
- Implement `ExampleDataService` to export/import Characters, Equipments, Poses, Expressions, and Generations.
- Add `generate-example` script to `package.json` to generate example data from current DB.
- Add startup logic in `src/index.ts` to seed example data if system is uninitialized and no data exists.
- Store system initialization state in `Setting` table.
- Add comprehensive tests for `ExampleDataService` in `src/service/example-data.test.ts` mocking filesystem and database operations.
- Implement `ExampleDataService` to export/import Characters, Equipments, Poses, Expressions, and Generations.
- Add `generate-example` script to `package.json` to generate example data from current DB.
- Add startup logic in `src/index.ts` to seed example data if system is uninitialized and no data exists.
- Store system initialization state in `Setting` table.
- Add comprehensive tests for `ExampleDataService` in `src/service/example-data.test.ts` mocking filesystem and database operations.
- Implement `ExampleDataService` to export/import Characters, Equipments, Poses, Expressions, and Generations.
- Add `generate-example` script to `package.json` to generate example data from current DB.
- Add startup logic in `src/index.ts` to seed example data if system is uninitialized and no data exists.
- Store system initialization state in `Setting` table.
- Add comprehensive tests for `ExampleDataService` in `src/service/example-data.test.ts` mocking filesystem and database operations.
- Add `DELETE /api/equipments/:id` endpoint.
- Add `deleteEquipment` method to `EquipmentService` which also cleans up associated assets and generation references.
- Implement delete action in `Equipments` page UI.
- Pass `actions` prop to `VibeCard` to enable context menu.
Split the equipment extraction process into two phases:
1. Analyze & Split: Generates texture sheet and crops assets.
2. Refine & Save: Allows user to select which assets to keep before refining and saving.
- Refactored `src/api/extract.ts` to expose `/analyze` and `/refine` endpoints.
- Updated `src/ui/components/ExtractorDialog.tsx` to handle the multi-step flow and selection UI.
- Added `CandidateAsset` type and updated `ExtractionStatus` in `src/ui/types.ts`.
- Added `deleteFile` to `FileService` and `deleteAsset` to `AssetService` to support file deletion.
- Implemented cascading deletion in `CharacterService` (delete looks -> delete character image -> delete character).
- Updated `GenerationService`, `PoseService`, and `ExpressionService` to delete associated image assets upon deletion.
- Added `DELETE /api/generations/:id` endpoint.
- Created `DropdownMenu` and `DeleteConfirmDialog` UI components.
- Updated `VibeCard` to include an internal `DropdownMenu` driven by a new `actions` prop.
- Updated `Characters`, `Poses`, and `Expressions` pages to use the new `VibeCard` `actions` prop for deletion.
- Updated `FittingRoom` page to use the `DropdownMenu` and `DeleteConfirmDialog` for deleting looks.
- Updated `CreateLookDialog` to enforce single selection for equipment categories.
- Added necessary tests adjustments.
- Added `deleteFile` to `FileService` and `deleteAsset` to `AssetService` to support file deletion.
- Implemented cascading deletion in `CharacterService` (delete looks -> delete character image -> delete character).
- Updated `GenerationService`, `PoseService`, and `ExpressionService` to delete associated image assets upon deletion.
- Added `DELETE /api/generations/:id` endpoint.
- Created `DropdownMenu` and `DeleteConfirmDialog` UI components.
- Updated `Characters`, `Poses`, `Expressions`, and `FittingRoom` pages to use the new delete UI (3-dot menu + confirmation).
- Updated `CreateLookDialog` to enforce single selection for equipment categories.
- Added necessary tests adjustments.
- Update `src/service/backup.test.ts` to fully mock `node:fs` methods (`existsSync`, `renameSync`, `mkdirSync`, `rmSync`).
- This prevents the test from interacting with the real file system, eliminating the `ENOENT` race condition error observed in CI pipelines.
- Ensures the test is idempotent and safely verifies the service logic without side effects.
- Verified all 49 tests pass locally.
- Create `BackupService` in `src/service/backup.ts` to encapsulate tar stream creation and restore logic (db connection, fs operations).
- Refactor `src/api/backup.ts` and `src/api/restore.ts` to use `BackupService`.
- Add unit tests for `BackupService` in `src/service/backup.test.ts`.
- Add API tests for backup and restore endpoints in `src/api/backup.test.ts` and `src/api/restore.test.ts`.
- Maintain existing functionality: uncompressed tar streaming, safe restore with rollback.
- Implement `GET /api/backup` to stream `data` directory as a tarball using `node-tar`.
- Implement `POST /api/restore` to accept and extract tarballs to the `data` directory.
- Update `BackupRestoreDialog` to accept `.tar` files and remove gzip references.
- Ensure safe restore with database connection management and rollback.
- Disabled Gzip compression as requested since assets are already compressed WebP files.
- Implement `GET /api/backup` to stream `data` directory as a gzipped tarball using `node-tar`.
- Implement `POST /api/restore` to accept and extract gzipped tarballs to the `data` directory, handling database disconnection/reconnection and rollbacks.
- Add `BackupRestoreDialog` UI component for downloading backups and uploading restore files.
- Integrate backup dialog trigger into the AppSidebar logo.
- Ensure type safety and add temporary integration tests for verification.
- Add `GET /api/backup` endpoint to stream `data` directory as a tar file.
- Add `POST /api/restore` endpoint to handle tar file upload and restore.
- Implement `BackupRestoreDialog` in the UI for user interaction.
- Integrate backup/restore dialog into the sidebar via the logo.
- Ensure safe restore with rollback on failure and database connection management.
- Consolidate SQLite database and file storage into `data/` directory.
- Update `src/index.ts` to ensure `data` and `data/files` directories exist on startup.
- Update `src/db.ts` to use hardcoded `file:./data/data.db` path.
- Update `prisma.config.ts` to use absolute path to `data/data.db` for CLI compatibility.
- Update `.gitignore` to ignore `data/` directory entirely.
- Remove `.env.example` and `.env.test` as they are no longer needed.
- Fix TS2307 typecheck error by adding `*.webp` declaration to `src/env.d.ts`.
- Consolidate SQLite database and file storage into `data/` directory.
- Update `src/index.ts` to ensure `data` and `data/files` directories exist on startup.
- Update `src/db.ts` to use hardcoded `file:./data/data.db` path.
- Update `prisma.config.ts` to use absolute path to `data/data.db` for CLI compatibility.
- Update `.gitignore` to ignore `data/` directory entirely.
- Remove `.env.example` and `.env.test` as they are no longer needed.
- Added `useInfiniteScroll` hook using `react-intersection-observer`.
- Updated `PoseService` and `ExpressionService` to support pagination with mixed built-in and DB items.
- Updated `OutfitService` to support pagination.
- Updated `src/api/pose.ts`, `src/api/expression.ts`, `src/api/outfit.ts`, `src/api/character.ts` to accept `page`/`limit` (default limit 20).
- Refactored `Equipments`, `Characters`, `Poses`, `Expressions` pages to use infinite scroll.
- Refactored `CreateLookDialog` and `LoadOutfitDialog` to use infinite scroll.
- Updated `AGENTS.md` with new guidelines.
This change refines the `CreateLookDialog` layout to be more compact and user-friendly.
Key changes:
- Replaced the sidebar with a text-only vertical navigation bar (`w-32`) to maximize content space.
- Adjusted the equipment, pose, and expression grids to a fixed 2-column layout (`grid-cols-2`) for better item visibility and reduced density.
- Removed icons from sidebar buttons to streamline the interface.
- Updated `ScrollArea` components to correctly fill available height (`h-full`) to enable proper scrolling.
- Maintained the tabbed structure (Equipment, Pose, Expression, Instructions) and footer layout from the previous iteration.
This change refines the `CreateLookDialog` layout to be more compact and user-friendly.
Key changes:
- Replaced the sidebar with a text-only vertical navigation bar (`w-32`) to maximize content space.
- Adjusted the equipment grid to a fixed 2-column layout (`grid-cols-2`) for better item visibility and reduced density.
- Removed icons from sidebar buttons to streamline the interface.
- Maintained the tabbed structure (Equipment, Pose, Expression, Instructions) and footer layout from the previous iteration.
- Rename public/expressions files to expression_*.webp
- Add Expression model to Prisma schema
- Add expression field to Generation model
- Implement ExpressionService and API
- Update GenerationService to support expressions in AI prompt
- Add Expressions page and dialogs
- Update CreateLookDialog to include expression selector
- Add Expressions to sidebar and routing
- Moved builtin poses to `public/poses`
- Added `Pose` model to schema and updated `Generation` model
- Created Pose Service and API
- Added Poses page to Frontend
- Updated CreateLookDialog to allow pose selection
- Updated Generation Service to handle pose instructions
- Added tests for Pose Service and Generation Service update
- Refactored `Equipments` page to use single category selection.
- Updated `FittingRoom` page to use `PageHeader` component.
- Added `backButton` prop to `PageHeader` component to support navigation controls.
- Removed "Manage looks for" hint text from Fitting Room header.
- Updated texture generation and refinement prompts to emphasize capturing and maintaining all details, materials, and patterns.
- Reverted analyze prompt to original state to avoid over-constraint.
- Removed AI-based bounding box detection
- Implemented deterministic grid calculation (1x3, 2x2, 2x3, 3x3)
- Updated extraction prompts to request specific grid layouts and white background
- Removed color assignment logic
- Updated ExtractedAsset interface
- Updated API to stream grid splitting status instead of detection status
- Updated tests to verify new logic and mock removal of color fields
- Removed "Detect Bounding Boxes" step from ExtractionFlowDesigner UI
- Removed AI-based bounding box detection
- Implemented deterministic grid calculation (1x3, 2x2, 2x3, 3x3)
- Updated extraction prompts to request specific grid layouts and white background
- Removed color assignment logic
- Updated ExtractedAsset interface
- Updated API to stream grid splitting status instead of detection status
- Updated tests to verify new logic and mock removal of color fields