Skip to content

Commit f693214

Browse files
fix(web): run a full status refresh when pointing at an empty actions menu
A local-only refresh keeps cached ahead counts, so a commit made in the terminal left Push unreachable. Upstream fetches stay throttled server-side. AI-assisted; verified with the tests and tools listed above.
1 parent 9e89122 commit f693214

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎apps/web/src/components/GitActionsControl.tsx‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,18 @@ const inlineSuccessExpiresAt = () => Date.now() + GIT_ACTION_SUCCESS_VISIBLE_MS;
154154

155155
type RefreshVcsStatus = (target: {
156156
readonly environmentId: ScopedThreadRef["environmentId"];
157-
readonly input: { readonly cwd: string; readonly localOnly?: boolean };
157+
readonly input: { readonly cwd: string };
158158
}) => Promise<unknown>;
159159

160160
function requestVcsStatusRefresh(
161161
refresh: RefreshVcsStatus,
162162
environmentId: ScopedThreadRef["environmentId"] | null,
163163
cwd: string | null,
164-
options?: { readonly localOnly: boolean },
165164
): void {
166165
if (environmentId === null || cwd === null) {
167166
return;
168167
}
169-
void refresh({ environmentId, input: { cwd, ...options } });
168+
void refresh({ environmentId, input: { cwd } });
170169
}
171170
const RUNNING_SOURCE_CONTROL_ACTIONS = ["runStackedAction", "pull", "publishRepository"] as const;
172171

@@ -1411,8 +1410,9 @@ export default function GitActionsControl({
14111410
hasNotice: isDetachedHead || isCleanAndBehind || Boolean(gitStatusError),
14121411
});
14131412

1414-
const refreshLocalStatus = () =>
1415-
requestVcsStatusRefresh(refreshVcsStatus, activeEnvironmentId, gitCwd, { localOnly: true });
1413+
// A disabled menu cannot refresh on open, and terminal edits or commits publish no status.
1414+
const refreshStatusForEmptyMenu = () =>
1415+
requestVcsStatusRefresh(refreshVcsStatus, activeEnvironmentId, gitCwd);
14161416

14171417
const initializeGit = () => {
14181418
void (async () => {
@@ -1520,9 +1520,8 @@ export default function GitActionsControl({
15201520
role="group"
15211521
aria-label="Git actions"
15221522
ref={panelAnchorRef}
1523-
// A disabled menu cannot refresh on open, and terminal edits publish no status.
1524-
onPointerEnter={hasGitMenuContent ? undefined : refreshLocalStatus}
1525-
onFocus={hasGitMenuContent ? undefined : refreshLocalStatus}
1523+
onPointerEnter={hasGitMenuContent ? undefined : refreshStatusForEmptyMenu}
1524+
onFocus={hasGitMenuContent ? undefined : refreshStatusForEmptyMenu}
15261525
className={cn(
15271526
"shrink-0",
15281527
THREAD_DETAILS_PANEL_SPLIT_GROUP_CLASS,

0 commit comments

Comments
 (0)