Skip to content

frontend: keep a setting typed while a pipeline save is in flight, and stop promising a create never starts - #2658

Merged
malinskibeniamin merged 1 commit into
masterfrom
rpcn-draft/follow-up-feedback
Sep 28, 2026
Merged

malinskibeniamin merged 1 commit into
masterfrom
rpcn-draft/follow-up-feedback

Conversation

@SpicyPete

Copy link
Copy Markdown
Contributor

Summary

Post-merge review comments on #2624, both marked P1.

A setting typed while a save is in flight was lost without warning. The settings stay editable during a save (only the Save button is disabled, the inline header title is not), but markSaved rebaselined the form to whatever was on screen when the response landed. So a name typed during the round trip became the saved default: the form read clean, the unsaved-changes guard stood down, and the recovery buffer was dropped. The baseline is now the snapshot the request actually carried, and anything typed since stays dirty.

There is a second half to that. A save that navigates unmounts the editor before the 1s debounced autosave can run, and the hook drops its pending timer by design so that Discard means discard. Staying dirty is therefore not enough on the paths that navigate, so those edits are now written as part of the save, against the target the editor continues on. On create that is the new pipeline's editor, so the restore notice offers them on arrival.

Worth noting for reviewers: reset(values, { keepDirtyValues: true }) looks like the one-line version of this and is not. It copies each dirty field's current value into the object that becomes the new defaults, which is the original bug.

The create copy promised something the wire cannot deliver. CreatePipeline always deploys, so with drafts off the primary Save is a deploy followed by a separate stop, and a fast input can process messages before the stop arrives. The leave dialog said saving "creates the pipeline without starting it". It now says it stops it afterwards and may run briefly. The success toast dropped the "yet" that implied it had never run.

Behaviour and button labels are unchanged. The end state is stopped, which beats the pre-#2624 create-and-leave-running, and the window cannot be closed from the client.

Also fixed, found reviewing the above

  • A create response with no id skipped the follow-up stop but still reported the pipeline as parked. The comment directly above that code already ruled this out; stopFailed now covers a stop that was needed and did not happen. Only the drafts-enabled twin had a test.
  • The Unsaved changes lane test block read whatever localStorage the preceding block left behind. It now clears in its own beforeEach, so its DOM is not order-dependent.
  • A test named for a stop "that creating never performs" now contradicts the deploy-then-stop model, so it is named for what it asserts.

Testing

Both new behaviours are verified red against the old code, not just green against the new. 1065 unit and 1605 integration tests pass, plus type:check and lint with no net-new diagnostics.

Open for discussion

  • Whether a flag-off create should instead be labelled as a deployment, which was the reviewer's suggested fallback. That reverts a deliberate UX-179 - rpcn: save pipelines as drafts #2624 decision, so I left it alone.
  • A concurrent external rename landing mid-flight, while the settings happen to be clean, will show as an unsaved settings change the user did not make. It needs a poll in STARTING/STOPPING plus a rename in the same window, and the signal is arguably true, so I left it.

🤖 Generated with Claude Code

…d stop promising a create never starts

Post-merge review of #2624.

The settings stay editable while a save is in flight, but `markSaved` rebaselined
the form to the values on screen when the response landed. A name typed during the
round trip became the saved default, so the form read clean, the unsaved-changes
guard stood down and the recovery buffer was dropped. The baseline is now the
snapshot the request carried, and edits made since stay dirty. A save that
navigates unmounts the editor before the debounced write can run, so those edits
are written as part of the save, against the target the editor continues on.

`CreatePipeline` always deploys, so a create without drafts is a deploy followed by
a stop and cannot promise the pipeline never runs. The leave dialog said it creates
the pipeline "without starting it"; it now says it stops it afterwards and may run
briefly. A create response with no id skipped the stop but still reported the
pipeline as parked, which the surrounding comment already ruled out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Registry drift detected

App: frontend · Scope: diff vs origin/master · Files: 4

Count
⚠️ Outdated registry components 6
🛠 Locally-modified components 0
❓ Unknown to registry 0
🎨 Off-token palette colours 0
🔢 Ad-hoc utility classes 0
Components needing attention
Status Component Uses Detail
⚠️ outdated alert 1× installed 3.4.1 → latest 3.5.0
⚠️ outdated button 1× installed 3.4.1 → latest 3.5.0
⚠️ outdated dialog 1× installed 3.4.1 → latest 3.5.0
⚠️ outdated resizable 1× installed 3.4.1 → latest 3.5.0
⚠️ outdated skeleton 1× installed 3.4.1 → latest 3.5.0
⚠️ outdated tabs 1× installed 3.4.1 → latest 3.5.0

Refresh command:

bunx shadcn@latest add @redpanda/alert @redpanda/button @redpanda/dialog @redpanda/resizable @redpanda/skeleton @redpanda/tabs --overwrite

Generated by lookout audit-changes.

@SpicyPete
SpicyPete requested review from a team and jvorcak and removed request for a team September 22, 2026 16:07
@SpicyPete SpicyPete self-assigned this Sep 22, 2026
@malinskibeniamin
malinskibeniamin merged commit 27099a0 into master Sep 28, 2026
17 checks passed
@malinskibeniamin
malinskibeniamin deleted the rpcn-draft/follow-up-feedback branch September 28, 2026 12:34
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.

2 participants