Skip to content

fix(ui): send the Show Changes prompt when launching a job - #1128

Open
MateusRoscoe wants to merge 1 commit into
ctrliq:mainfrom
MateusRoscoe:fix/launch-prompt-diff-mode
Open

MateusRoscoe wants to merge 1 commit into
ctrliq:mainfrom
MateusRoscoe:fix/launch-prompt-diff-mode

Conversation

@MateusRoscoe

Copy link
Copy Markdown
SUMMARY

Assisted-by: Claude Opus 5.5. Drafted with AI assistance; the commit carries the same trailer.

With Prompt on launch enabled for Show Changes, turning the toggle on in the launch wizard had no effect: the job ran with diff_mode: false and without --diff. There were two causes, and this fixes both:

  • handleSubmit in LaunchPrompt.tsx builds the launch request field by field and never added diff_mode. It now posts diff_mode next to verbosity, in the same way as the other prompted fields. LaunchPromptValues gains the diff_mode?: boolean field.
  • ShowChangesToggle in OtherPromptsStep.tsx passed the form setter straight to PatternFly's Switch (onChange={helpers.setValue}). Switch calls onChange(event, checked), so the field held the change event. An object is truthy, so the switch stayed on once clicked and could not be turned off. It now stores checked, and its label shows On or Off, as the Show Changes switch on the job template form already does.

The API side needs no change. It already applies a prompted diff_mode when it is posted.

Fixes #1127

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • UI
ASCENDER VERSION
25.6.2-267-g205e8fd5 (main, the base of this branch)
ADDITIONAL INFORMATION

New tests:

  • OtherPromptsStep.test.tsx: should turn show changes on and off again clicks the switch on and then off, and checks its state after each click.
  • LaunchPrompt.test.tsx: should launch with show changes when it is turned on and should launch without show changes when it is left off go through the wizard to Launch, and check that onLaunch receives diff_mode: true and diff_mode: false respectively.
# with this change
$ TZ=UTC vitest run src/components/LaunchPrompt
 Test Files  10 passed (10)
      Tests  58 passed (58)

$ TZ=UTC vitest run
 Test Files  555 passed (555)
      Tests  3126 passed (3126)

# main f9cf2733 with only the new tests
$ TZ=UTC vitest run src/components/LaunchPrompt
     × should turn show changes on and off again
     × should launch with show changes when it is turned on
     × should launch without show changes when it is left off
      Tests  3 failed | 55 passed (58)

# eslint, prettier --check and check-strings pass on the changed files

The launch wizard never added diff_mode to the launch request, so turning
Show Changes on at launch had no effect. The toggle also stored the Switch
change event instead of its checked state, which left it stuck on once
clicked.

related ctrliq#1127

Assisted-by: Claude Opus 5.5
Signed-off-by: Mateus Roscoe <mateusroscoe2@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 20:21

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Launch prompt: Show Changes toggle is never sent, so diff mode can't be enabled at launch

2 participants