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" };
|
||||
}
|
||||
|
||||
if (input.checkoutState.kind === "pending" && input.workspace.projectKind === "git") {
|
||||
return { kind: "skeleton" };
|
||||
}
|
||||
|
||||
const header = resolveWorkspaceHeader({ workspace: input.workspace });
|
||||
const checkout = input.checkoutState.kind === "ready" ? input.checkoutState.checkout : null;
|
||||
const currentBranchName =
|
||||
|
||||
@@ -95,13 +95,20 @@ describe("workspace source of truth consumption", () => {
|
||||
).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(
|
||||
resolveWorkspaceHeaderRenderState({
|
||||
workspace: createWorkspaceDescriptor({ projectKind: "git" }),
|
||||
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", () => {
|
||||
|
||||
Reference in New Issue
Block a user