Add a dialog to clear storage when changing pipeline config#5871
Add a dialog to clear storage when changing pipeline config#5871Karakatiza666 wants to merge 3 commits intomainfrom
Conversation
b1b381a to
92109b1
Compare
mythical-fred
left a comment
There was a problem hiding this comment.
The dialog system refactor (GenericDialog, useGlobalDialog) and the new clear-storage flow (doClearAndApply, showClearStorageConfirm, phase state machine) are behavioral changes with no tests. Per the hard rule for web-console PRs: please add tests before this can be approved.
| @@ -1,7 +1,11 @@ | |||
| <script lang="ts"> | |||
There was a problem hiding this comment.
The doClearAndApply async flow has three phases (confirm → progress → error) and fallback error paths — this is exactly the kind of business logic that belongs in tests. Please add Vitest + @testing-library/svelte tests covering at least:
- Happy path:
doClearAndApplysucceeds → dialog closes,pipeline.patchcalled with the pending patch - Error path:
postPipelineActionrejects →clearStoragePhasebecomeserror, message shown isStorageNotClearedError: unit test the error-detection predicate in isolation
Setup: npm install -D vitest @testing-library/svelte jsdom
|
Testing: after the refactor I manually tested various interactions of all dialogs:
|
| onSuccess?: DialogAction | ||
| /** | ||
| * Called when the user clicks the cancel button, the "X" button, or clicks away from the dialog. | ||
| * If `name` is provided, it overrides the default "Cancel" button label. |
There was a problem hiding this comment.
It's a field in DialogAction struct
89fbdff to
30de585
Compare
30de585 to
75baec1
Compare
75baec1 to
2a91737
Compare
| @@ -0,0 +1 @@ | |||
| # Web Console Library | |||
There was a problem hiding this comment.
Nit: this file contains only a heading with no content. Per PR_REVIEW_RULES.md, AGENTS.md/CLAUDE.md files in subdirectories should be driven by a specific observed struggle, not added speculatively. If there is a real need here, add the actual guidance. Otherwise, a README.md would serve humans and agents equally well.
There was a problem hiding this comment.
Added by mistake, removed
Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
Replaced duplicated implementations with GenericDialog instances Improve API key menu behavior when there are a lot of API keys Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
2a91737 to
3356836
Compare
3356836 to
1096284
Compare
…anges Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
1096284 to
b357927
Compare
Screencast.from.2026-03-19.20-42-50.webm