Skip to content

feat(ui): UI/UX project setup - P1 - #3784

Merged
camiloHimura merged 3 commits into
mainfrom
ccolora11/3733-trainig-warning
Sep 9, 2026
Merged

camiloHimura merged 3 commits into
mainfrom
ccolora11/3733-trainig-warning

Conversation

@camiloHimura

@camiloHimura camiloHimura commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

📝 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

image

✨ Changes

Select what type of change your PR is:

  • 🚀 New feature (non-breaking change which adds functionality)
  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔄 Refactor (non-breaking change which refactors the code base)
  • ⚡ Performance improvements
  • 🎨 Style changes (code style/formatting)
  • 🧪 Tests (adding/modifying tests)
  • 📚 Documentation update
  • 📦 Build system changes
  • 🚧 CI/CD configuration
  • 🔧 Chore (general maintenance)
  • 🔒 Security update
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).
  • 🏷️ My PR title follows conventional commit format.

For more information about code review checklists, see the Code Review Checklist.

Signed-off-by: Colorado, Camilo <camilo.colorado@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 TrainModelButton implementation that shows an informational help message when training is disabled due to insufficient normal images.
  • Introduce a small pluralize utility and refactor train-model components/imports to a clearer folder structure.
  • Add application/ui/tests/utils.ts and update multiple tests to use shared render/renderHook helpers 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.

Comment thread application/ui/rsbuild.config.ts Resolved
@github-actions

github-actions Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Docker Image Sizes

CPU

Image Size
anomalib-studio-cpu:pr-3784 978.42M
anomalib-studio-cpu:sha-986bf1b 978.42M

CUDA

Image Size
anomalib-studio-cuda:pr-3784 4.36G
anomalib-studio-cuda:sha-986bf1b 4.36G

XPU

Image Size
anomalib-studio-xpu:pr-3784 3.33G
anomalib-studio-xpu:sha-986bf1b 3.33G

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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>
@camiloHimura
camiloHimura force-pushed the ccolora11/3733-trainig-warning branch from 543226c to 3d9276e Compare September 7, 2026 19:06
@camiloHimura
camiloHimura temporarily deployed to windows-msix-signing September 7, 2026 19:07 — with GitHub Actions Inactive
@camiloHimura
camiloHimura temporarily deployed to windows-msix-signing September 7, 2026 19:07 — with GitHub Actions Inactive
@camiloHimura
camiloHimura temporarily deployed to windows-msix-signing September 7, 2026 19:07 — with GitHub Actions Inactive
Comment thread .agents/skills/ui-test-utils/SKILL.md Resolved
jpggvilaca
jpggvilaca previously approved these changes Sep 8, 2026
ashwinvaidya17
ashwinvaidya17 previously approved these changes Sep 8, 2026
Signed-off-by: Colorado, Camilo <camilo.colorado@intel.com>
Copilot AI review requested due to automatic review settings September 8, 2026 11:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@ashwinvaidya17 ashwinvaidya17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@camiloHimura
camiloHimura merged commit 713ca87 into main Sep 9, 2026
49 checks passed
@camiloHimura
camiloHimura deleted the ccolora11/3733-trainig-warning branch September 9, 2026 11:59

This branch was previously deployed

1 inactive deployment
windows-msix-signing — 845b6e56 Deployed Sep 8, 2026 by camiloHimura via Build Windows MSIX (xpu) #1025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants