Skip to content

Bug-1995794: Disable retrigger dropdown when there are no runs - #1087

Open
moijes12 wants to merge 2 commits into
mozilla:mainfrom
moijes12:disable-retrigger-dropdown
Open

Bug-1995794: Disable retrigger dropdown when there are no runs#1087
moijes12 wants to merge 2 commits into
mozilla:mainfrom
moijes12:disable-retrigger-dropdown

Conversation

@moijes12

Copy link
Copy Markdown
Contributor

Disable the Base and New retrigger count selects independently when there are no retriggerable job ids for that side, and default a disabled select to 0 so it does not look like jobs will start.

@beatrice-acasandrei @kala-moz

@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for mozilla-perfcompare ready!

Name Link
🔨 Latest commit bea514f
🔍 Latest deploy log https://app.netlify.com/projects/mozilla-perfcompare/deploys/6a979628f328f70008426a22
😎 Deploy Preview https://deploy-preview-1087--mozilla-perfcompare.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@beatrice-acasandrei beatrice-acasandrei 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.

In my opinion it would be helpful to gray out the dropdown text to clearly indicate that the field is disabled. @esanuandra @kala-moz What do you think?

Image

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.

Consider disabling "Confirm" when both are disabled:

Suggested change
<Button
type='submit'
disabled={!props.hasBaseJobs && !props.hasNewJobs}
>
{retriggerStrings.submitButton}
</Button>

expect(new MockedHooks().triggerHook).toHaveBeenCalled();
});

async function openRetriggerConfigModal(

@beatrice-acasandrei beatrice-acasandrei Sep 1, 2026

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.

Test helper should be at the top of the describe block before any test cases, not in the middle

labelId={`${prefix}-retrigger-count-label`}
name={`${prefix}-retrigger-count`}
defaultValue={5}
defaultValue={disabled ? 0 : 5}

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.

Could you add a brief explanatory comment here? It’s worth noting that using defaultValue is safe in this context because the modal unmounts when closed, ensuring the state re-initializes on each open.

name={`${prefix}-retrigger-count`}
defaultValue={5}
defaultValue={disabled ? 0 : 5}
disabled={disabled}

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.

FormControl automatically passes disabled down to its children through React context. So passing disabled explicitly to Select too is unnecessary. It's not a bug — it just creates extra noise and could confuse a reader into thinking it's needed for a reason.

Suggested change
disabled={disabled}

Disable the Base and New retrigger count selects independently when
there are no retriggerable job ids for that side, and default a
disabled select to 0 so it does not look like jobs will start.
Drop the redundant Select disabled prop, document why defaultValue is
safe, move the retrigger test helper to the top of the describe block,
and disable submit when neither base nor new can be retriggered.
@cursor
cursor Bot force-pushed the disable-retrigger-dropdown branch 2 times, most recently from 3d01970 to bea514f Compare September 2, 2026 03:21
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.

3 participants