-
Notifications
You must be signed in to change notification settings - Fork 46
Add component test of augmentation parameters and add minor fixes #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactor to allow configurable numeric parameters to have nullable minimum values and update related UI components, tests, and training configuration mocks accordingly. Also expands augmentation configuration options and adjusts range slider accessibility labels.
- Add support for minValue/min_value being null across DTOs, services, and UI components.
- Update NumberParameterField and RangeParameterField logic and associated tests for new nullable constraints and revised aria-labels.
- Replace and expand augmentation configuration mocks (center_crop removed; new augmentations and parameters added).
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
web_ui/tests/fixtures/page-objects/train-model-dialog-page.ts | Adjust page object method to require external slider Locator. |
web_ui/tests/features/project-models/train-model.spec.ts | Update tests to use new method signature and interact with new augmentation controls. |
web_ui/tests/features/project-models/mocks.ts | Overhaul augmentation configuration mocks and expected payload structure. |
web_ui/src/shared/components/header/active-learning-configuration/training-settings/required-annotations.component.tsx | Support nullable minValue by passing undefined when null. |
web_ui/src/pages/project-details/components/project-models/train-model-dialog/advanced-settings/ui/range-parameter-field.test.tsx | Update tests to match new aria-labels and rendering helper. |
web_ui/src/pages/project-details/components/project-models/train-model-dialog/advanced-settings/ui/range-parameter-field.component.tsx | Change slider aria-label and wrap in Flex with aria-label. |
web_ui/src/pages/project-details/components/project-models/train-model-dialog/advanced-settings/ui/number-parameter-field.component.tsx | Support nullable min/max and modify step calculation logic. |
web_ui/src/pages/project-details/components/project-models/train-model-dialog/advanced-settings/data-management/filters/filters-options.component.tsx | Pass undefined when minValue is null. |
web_ui/src/core/configurable-parameters/services/configuration.interface.ts | Change minValue type to number |
web_ui/src/core/configurable-parameters/dtos/configuration.interface.ts | Change min_value type to number |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../project-models/train-model-dialog/advanced-settings/ui/number-parameter-field.component.tsx
Outdated
Show resolved
Hide resolved
.../project-models/train-model-dialog/advanced-settings/ui/number-parameter-field.component.tsx
Show resolved
Hide resolved
async changeSubsetRange(slider: Locator, range: 'start' | 'end', iterations: number) { | ||
await slider.getByLabel(range === 'start' ? 'Start range' : 'End range').click(); |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Adding a required slider Locator shifts locator responsibility to every test and duplicates retrieval logic; consider keeping the page object self-contained by resolving the slider internally (or offering an overload) to reduce coupling and future selector churn.
async changeSubsetRange(slider: Locator, range: 'start' | 'end', iterations: number) { | |
await slider.getByLabel(range === 'start' ? 'Start range' : 'End range').click(); | |
async changeSubsetRange(range: 'start' | 'end', iterations: number) { | |
// Assume the slider can be found by label, e.g., "Start range" or "End range" | |
const slider = this.page.getByLabel(range === 'start' ? 'Start range' : 'End range'); | |
await slider.click(); |
Copilot uses AI. Check for mistakes.
const distributionSlider = page.getByText('Distribution 70/20/10%'); | ||
await trainModelPage.changeSubsetRange(distributionSlider, 'start', 10); | ||
|
||
const refreshedDistributionSlider = page.getByText('Distribution 60/30/10%'); |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using getByText with the full dynamic distribution string is brittle (any formatting or recalculation change will break the test); prefer a stable aria-label/role or a test id (e.g. getByLabel('Training subsets distribution slider')) to improve selector resilience.
const distributionSlider = page.getByText('Distribution 70/20/10%'); | |
await trainModelPage.changeSubsetRange(distributionSlider, 'start', 10); | |
const refreshedDistributionSlider = page.getByText('Distribution 60/30/10%'); | |
const distributionSlider = page.getByTestId('training-subsets-distribution-slider'); | |
await trainModelPage.changeSubsetRange(distributionSlider, 'start', 10); | |
const refreshedDistributionSlider = page.getByTestId('training-subsets-distribution-slider'); |
Copilot uses AI. Check for mistakes.
name: 'Enable random horizontal flip', | ||
type: 'bool', | ||
description: | ||
'Whether to apply random flip images horizontally along the vertical axis (swap left and right)', |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The phrasing is ungrammatical; consider revising to "Whether to randomly flip images horizontally along the vertical axis (swap left and right)" and "Whether to randomly flip images vertically along the horizontal axis (swap top and bottom)" for clarity.
'Whether to apply random flip images horizontally along the vertical axis (swap left and right)', | |
'Whether to randomly flip images horizontally along the vertical axis (swap left and right)', |
Copilot uses AI. Check for mistakes.
description: | ||
'Whether to apply random flip images vertically along the horizontal axis (swap top and bottom)', |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The phrasing is ungrammatical; consider revising to "Whether to randomly flip images horizontally along the vertical axis (swap left and right)" and "Whether to randomly flip images vertically along the horizontal axis (swap top and bottom)" for clarity.
Copilot uses AI. Check for mistakes.
Ensure both single task training and task chain training tests use the same mocks and behavior, fixing inconsistencies that previously caused test failures.
|
||
return ( | ||
<Flex gap={'size-100'}> | ||
<Flex gap={'size-100'} aria-label={name}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC flex does not have aria-label
, could u please double check it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't. updated
type: 'int' | 'float'; | ||
value: number; | ||
min_value: number; | ||
min_value: number | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When min_value
can be null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for Random Affine Maximum shear degree
, Gaussian noise mean
await brightnessStart.click(); | ||
|
||
const brightnessSlider = page.getByLabel('Change Brightness range value'); | ||
brightnessSlider.click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing await
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
await brightnessStart.click(); | ||
|
||
const brightnessSlider = page.getByLabel('Change Brightness range value'); | ||
brightnessSlider.click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, await?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
📝 Description
number
tonumber | null
✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
✅ Checklist
Before submitting the PR, ensure the following: