authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-07-07 08:54:27-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-07-07 08:54:27-07:00
log4414f922fe4c83b819f9c1585a85d42f7b295ef6
treead0189c7f192692821caec9eadd357a58fdfb970
parent6e42231cb1da130069cbc694f9da4a185067a81f
signature Signed by PGP key B5690EEEBB952194

Clear VCS presentation state on finish (#3764)


2 files changed, 41 insertions(+), 3 deletions(-)

packages/client-runtime/src/state/vcsAction.test.ts+40
......@@ -155,6 +155,46 @@ describe("vcsActionState", () => {
155155 });
156156 });
157157
158 it("clears running presentation state once the action finishes", () => {
159 const initial = beginVcsActionState({
160 operation: "run_change_request",
161 label: "Running source control action",
162 actionId,
163 });
164 const pushing = applyVcsActionProgressEvent(
165 initial,
166 progress({
167 actionId,
168 action,
169 cwd,
170 kind: "phase_started",
171 phase: "push",
172 label: "Pushing...",
173 }),
174 );
175 const finished = applyVcsActionProgressEvent(
176 pushing,
177 progress({
178 actionId,
179 action,
180 cwd,
181 kind: "action_finished",
182 result,
183 }),
184 );
185
186 expect(finished).toMatchObject({
187 isRunning: false,
188 operation: "run_change_request",
189 actionId,
190 action,
191 currentLabel: null,
192 currentPhaseLabel: null,
193 lastOutputLine: null,
194 error: null,
195 });
196 });
197
158198 it("retains a terminal action error for presentation", () => {
159199 const initial = beginVcsActionState({
160200 operation: "run_change_request",
packages/client-runtime/src/state/vcsAction.ts+1-3
......@@ -386,12 +386,10 @@ export function applyVcsActionProgressEvent(
386386 };
387387 case "action_finished":
388388 return {
389 ...current,
390 isRunning: false,
389 ...EMPTY_VCS_ACTION_STATE,
391390 actionId: event.actionId,
392391 action: event.action,
393392 operation: "run_change_request",
394 error: null,
395393 };
396394 case "action_failed":
397395 return {