fix: remove loader regression in no-code-model set-model handler#47
Conversation
The .finally() block was resetting setIsLoading(false) after both success and error paths. On success, this interfered with the loading state needed by runTransformation. The catch block already handles the error path loader reset. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| frontend/src/ide/editor/no-code-model/no-code-model.jsx | Removes 3 lines (the .finally(() => setIsLoading(false)) block) from handleSourceDestinationChange; fix is targeted and correct — the loader lifecycle now properly propagates through runTransformation → getSampleData. |
Sequence Diagram
sequenceDiagram
participant U as User
participant H as handleSourceDestinationChange
participant RT as runTransformation
participant GS as getSampleData
U->>H: Click Apply
H->>H: setIsLoading(true)
H->>H: POST /set-model
alt Success
H->>RT: runTransformation(model_data)
RT->>RT: setIsLoading(true)
RT->>RT: POST /execute/run
RT->>GS: getSampleData(spec)
GS->>GS: setIsLoading(true)
GS->>GS: GET /content
GS->>GS: setIsLoading(false) [.finally()]
Note over H,GS: Loader stays until getSampleData completes
else Error
H->>H: notify error
H->>H: setIsLoading(false) [.catch()]
Note over H: Loader dismissed on error
end
Reviews (1): Last reviewed commit: "fix: remove loader reset from finally bl..." | Re-trigger Greptile
Summary
.finally(() => setIsLoading(false))fromhandleSourceDestinationChangein no-code-modelrunTransformation()on the success pathRoot cause
Introduced in be398f6 — the
.finally()block was added alongside error notification improvements but caused a regression where the loader would disappear prematurely on successful model configuration.Test plan
🤖 Generated with Claude Code