Repository navigation
feat(ui): UI/UX project setup - P1 - #3784
Conversation
Signed-off-by: Colorado, Camilo <camilo.colorado@intel.com>
There was a problem hiding this comment.
🟡 Changes recommended
It introduces a few correctness/build issues (missing required header, likely incorrect paginated-image counting, and a suspense-query test without a Suspense boundary).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR improves the Anomalib Studio “new project setup” UX by making the “Train model” action’s availability criteria (minimum number of uploaded normal images) discoverable in the UI, and it introduces shared test utilities to standardize provider setup across UI tests.
Changes:
- Add a new
TrainModelButtonimplementation that shows an informational help message when training is disabled due to insufficient normal images. - Introduce a small
pluralizeutility and refactor train-model components/imports to a clearer folder structure. - Add
application/ui/tests/utils.tsand update multiple tests to use sharedrender/renderHookhelpers with routing/providers.
File summaries
| File | Description |
|---|---|
| application/ui/tests/utils.ts | Adds shared render/renderHook helpers with app-like providers and memory routing for tests. |
| application/ui/src/features/inspect/utils.ts | Adds pluralize helper to support user-facing pluralization. |
| application/ui/src/features/inspect/train-model/trainable-model-list-box/trainable-model-list-box.test.tsx | Adds tests for the trainable model list filtering and show-more/less UI. |
| application/ui/src/features/inspect/train-model/trainable-model-list-box/trainable-model-list-box.component.tsx | Updates import path after train-model folder structure change. |
| application/ui/src/features/inspect/train-model/train-model-dialog.component.tsx | Updates TrainableModelListBox import to the new nested location. |
| application/ui/src/features/inspect/train-model/train-model-button/train-model-button.test.tsx | Adds tests for the new training-button disabled-state messaging and enabled behavior. |
| application/ui/src/features/inspect/train-model/train-model-button/train-model-button.component.tsx | New Train button implementation with contextual help explaining missing image count. |
| application/ui/src/features/inspect/train-model/train-model-button.component.tsx | Removes the previous Train button implementation. |
| application/ui/src/features/inspect/toolbar/sources/source-menu/source-menu.test.tsx | Refactors test setup to use shared tests/utils render helper and route injection. |
| application/ui/src/features/inspect/toolbar/sources/hooks/use-source-mutation.test.tsx | Refactors hook test to use shared tests/utils renderHook helper and route injection. |
| application/ui/src/features/inspect/toolbar/sinks/sink-list/sink-menu/sink-menu.test.tsx | Refactors test setup to use shared tests/utils render helper and route injection. |
| application/ui/src/features/inspect/stream-container/play-stream-button/play-stream-button.test.tsx | Refactors test setup to use shared tests/utils render helper. |
| application/ui/src/features/inspect/stream-container/hook/use-auto-play-stream.test.tsx | Refactors hook test to use shared tests/utils renderHook helper and route injection. |
| application/ui/src/features/inspect/stream-container/fps/fps.test.tsx | Refactors test setup to use shared tests/utils render helper. |
| application/ui/src/features/inspect/projects-management/hooks/use-selected-project.test.tsx | Updates test to derive project selection from route-based project id. |
| application/ui/src/features/inspect/models/models.component.tsx | Updates TrainModelButton import to the new nested location. |
| application/ui/src/features/inspect/models/model-detail/model-detail.test.tsx | Refactors test setup to use shared tests/utils render helper and route injection. |
| application/ui/src/features/inspect/main-content/hooks/use-ensure-active-pipeline.test.tsx | Refactors hook test to use shared tests/utils renderHook helper. |
| application/ui/src/features/inspect/main-content/hooks/use-active-pipeline-status.test.tsx | Refactors hook test to use shared tests/utils renderHook helper. |
| application/ui/src/features/inspect/main-content/enable-project/confirmation-dialog.test.tsx | Refactors test setup to use shared tests/utils render helper and route injection. |
| application/ui/src/features/inspect/dataset/upload-images.component.tsx | Updates TrainModelButton import to the new nested location. |
| application/ui/src/features/inspect/dataset/media-preview/hooks/use-media-item-inference.test.tsx | Refactors hook test to use shared tests/utils renderHook helper. |
| application/ui/src/features/inspect/dataset/dataset.component.tsx | Updates TrainModelButton import to the new nested location. |
| application/ui/rsbuild.config.ts | Adds an Rspack parser override for Scalar and refactors watch-options configuration. |
Review details
- Files reviewed: 23/24 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Docker Image SizesCPU
CUDA
XPU
|
There was a problem hiding this comment.
🔵 Needs a closer look
The new TrainableModelListBox test renders a suspense-based component without a Suspense boundary (and has stale copyright headers), which is likely to break the test suite until corrected.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
application/ui/src/features/inspect/train-model/trainable-model-list-box/trainable-model-list-box.component.tsx:10
- This file is touched in this PR, but the copyright header at the top still ends at 2025; please update the year range to include 2026 to avoid a stale header.
- Files reviewed: 24/25 changed files
- Comments generated: 0 new
- Review effort level: Lite
Signed-off-by: Colorado, Camilo <camilo.colorado@intel.com>
543226c to
3d9276e
Compare
Signed-off-by: Colorado, Camilo <camilo.colorado@intel.com>
845b6e5
There was a problem hiding this comment.
🔵 Needs a closer look
The new TrainableModelListBox test should align with the newly introduced shared UI test utilities (and fix a stale header year) to keep test setup consistent and maintainable.
Review details
- Files reviewed: 24/25 changed files
- Comments generated: 0 new
- Review effort level: Lite
📝 Description
This pr improves
The "Train model" action becomes available only after 20 images are uploaded/collected, but there is no clear indication of that.Ticket #3733✨ Changes
Select what type of change your PR is:
✅ Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.