Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions static/app/views/settings/projectSeer/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,4 +549,38 @@ describe('ProjectSeer', () => {
);
});
});

it('hides Scan Issues toggle when triage-signals-v0 feature flag is enabled', async () => {
const projectWithFeatureFlag = ProjectFixture({
features: ['triage-signals-v0'],
});

render(<ProjectSeer />, {
organization,
outletContext: {project: projectWithFeatureFlag},
});

// Wait for the page to load
await screen.findByText(/Automation/i);

// The Scan Issues toggle should NOT be visible
expect(
screen.queryByRole('checkbox', {
name: /Scan Issues/i,
})
).not.toBeInTheDocument();
});

it('shows Scan Issues toggle when triage-signals-v0 feature flag is disabled', async () => {
render(<ProjectSeer />, {
organization,
outletContext: {project},
});

// The Scan Issues toggle should be visible
const toggle = await screen.findByRole('checkbox', {
name: /Scan Issues/i,
});
expect(toggle).toBeInTheDocument();
});
});
4 changes: 3 additions & 1 deletion static/app/views/settings/projectSeer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ function ProjectSeerGeneralForm({project}: {project: Project}) {
model?.getValue('autofixAutomationTuning') !== 'off',
} satisfies FieldObject;

const isTriageSignalsFeatureOn = project.features.includes('triage-signals-v0');

const seerFormGroups: JsonFormObject[] = [
{
title: (
Expand All @@ -218,7 +220,7 @@ function ProjectSeerGeneralForm({project}: {project: Project}) {
</div>
),
fields: [
seerScannerAutomationField,
...(isTriageSignalsFeatureOn ? [] : [seerScannerAutomationField]),
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Phantom Toggle Hides Automation Fields

When the triage-signals-v0 feature is enabled and seerScannerAutomation is false, the autofixAutomatingTuningField and automatedRunStoppingPointField will be hidden because their visible conditions check model?.getValue('seerScannerAutomation') === true. Removing the seerScannerAutomationField from the form doesn't change the underlying value, causing the dependent automation fields to remain hidden even though the toggle is no longer accessible to users.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that is true. It's an edge case we discussed on #proj-triage-signals and we are okay with it.

autofixAutomatingTuningField,
automatedRunStoppingPointField,
],
Expand Down
Loading