Skip to content

Conversation

romanowska
Copy link
Contributor

📝 Description

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Run automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and meaningful
  • ✍️ PR description clearly explains the changes and their reason
  • 📝 I have linked the PR to the corresponding GitHub Issues, if any
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 09:39
@github-actions github-actions bot added the UI label Oct 2, 2025
@romanowska romanowska changed the title Add Add component test of augmentation parameters and add minor fixes Oct 2, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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.

Comment on lines +19 to +20
async changeSubsetRange(slider: Locator, range: 'start' | 'end', iterations: number) {
await slider.getByLabel(range === 'start' ? 'Start range' : 'End range').click();
Copy link

Copilot AI Oct 2, 2025

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.

Suggested change
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.

Comment on lines +158 to +161
const distributionSlider = page.getByText('Distribution 70/20/10%');
await trainModelPage.changeSubsetRange(distributionSlider, 'start', 10);

const refreshedDistributionSlider = page.getByText('Distribution 60/30/10%');
Copy link

Copilot AI Oct 2, 2025

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.

Suggested change
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)',
Copy link

Copilot AI Oct 2, 2025

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.

Suggested change
'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.

Comment on lines +2968 to +2969
description:
'Whether to apply random flip images vertically along the horizontal axis (swap top and bottom)',
Copy link

Copilot AI Oct 2, 2025

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.

romanowska and others added 2 commits October 3, 2025 08:47
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}>
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

@romanowska romanowska Oct 16, 2025

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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing await?

Copy link
Contributor Author

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();
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, await?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

pplaskie
pplaskie previously approved these changes Oct 9, 2025
@romanowska romanowska linked an issue Oct 16, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce configurable augmentations for all supervised tasks

4 participants