fix(app): keep cached workspace header visible while reconnecting
Checkout refresh was replacing known workspace identity with a skeleton. Keep persisted identity visible until fresh checkout details arrive.
This commit is contained in:
@@ -54,10 +54,6 @@ export function resolveWorkspaceHeaderRenderState(input: {
|
|||||||
return { kind: "skeleton" };
|
return { kind: "skeleton" };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input.checkoutState.kind === "pending" && input.workspace.projectKind === "git") {
|
|
||||||
return { kind: "skeleton" };
|
|
||||||
}
|
|
||||||
|
|
||||||
const header = resolveWorkspaceHeader({ workspace: input.workspace });
|
const header = resolveWorkspaceHeader({ workspace: input.workspace });
|
||||||
const checkout = input.checkoutState.kind === "ready" ? input.checkoutState.checkout : null;
|
const checkout = input.checkoutState.kind === "ready" ? input.checkoutState.checkout : null;
|
||||||
const currentBranchName =
|
const currentBranchName =
|
||||||
|
|||||||
@@ -95,13 +95,20 @@ describe("workspace source of truth consumption", () => {
|
|||||||
).toEqual({ kind: "skeleton" });
|
).toEqual({ kind: "skeleton" });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps git workspace headers skeletoned until checkout status resolves", () => {
|
it("keeps cached git workspace identity visible while checkout status refreshes", () => {
|
||||||
expect(
|
expect(
|
||||||
resolveWorkspaceHeaderRenderState({
|
resolveWorkspaceHeaderRenderState({
|
||||||
workspace: createWorkspaceDescriptor({ projectKind: "git" }),
|
workspace: createWorkspaceDescriptor({ projectKind: "git" }),
|
||||||
checkoutState: { kind: "pending" },
|
checkoutState: { kind: "pending" },
|
||||||
}),
|
}),
|
||||||
).toEqual({ kind: "skeleton" });
|
).toEqual({
|
||||||
|
kind: "ready",
|
||||||
|
title: "feat/workspace-sot",
|
||||||
|
subtitle: "getpaseo/paseo",
|
||||||
|
shouldShowSubtitle: true,
|
||||||
|
isGitCheckout: false,
|
||||||
|
currentBranchName: null,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders known non-git workspace identity while checkout status is pending", () => {
|
it("renders known non-git workspace identity while checkout status is pending", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user