Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: refresh Repository sources card after git push/sync/commit so it stops showing a stale ahead count

[._.]/ Adam Eivy95f11f687fea
diff --git a/client/src/components/apps/tabs/GitTab.jsx b/client/src/components/apps/tabs/GitTab.jsx
index b14719ca2a..bfe55b4b9c 100644
--- a/client/src/components/apps/tabs/GitTab.jsx
+++ b/client/src/components/apps/tabs/GitTab.jsx
@@ -199,7 +199,12 @@ export default function GitTab({ appId, appName, repoPath }) {
}
}, [repoPath]);
- const loadGitInfo = useCallback(() => loadGitData({ includeRemote: false }), [loadGitData]);
+ // Local git mutations (push/sync/commit) change ahead/behind counts, so the
+ // Repository sources card must re-fetch too.
+ const loadGitInfo = useCallback(async () => {
+ await loadGitData({ includeRemote: false });
+ setSourceRefreshKey((key) => key + 1);
+ }, [loadGitData]);
const loadRemoteBranches = useCallback(async (opts = {}) => {
if (!repoPath) return;
diff --git a/client/src/components/apps/tabs/GitTab.test.jsx b/client/src/components/apps/tabs/GitTab.test.jsx
index 50ac4b9ae9..ebd1f4222c 100644
--- a/client/src/components/apps/tabs/GitTab.test.jsx
+++ b/client/src/components/apps/tabs/GitTab.test.jsx
@@ -13,6 +13,7 @@ vi.mock('../../../services/api', () => ({
getBranchComparison: vi.fn(),
getRemoteBranches: vi.fn(),
updateBranches: vi.fn(),
+ pushAllBranches: vi.fn(),
getGitDiff: vi.fn(),
cleanupMergedBranches: vi.fn(),
resetToDefaultBranch: vi.fn(),
@@ -112,6 +113,18 @@ describe('GitTab managed repository sources', () => {
await waitFor(() => expect(api.updateBranches).toHaveBeenCalledWith('/repo'));
await waitFor(() => expect(screen.getByTestId('repository-source-panel')).toHaveAttribute('data-refresh-key', '1'));
});
+
+ it('refreshes repository sources after pushing so the ahead count clears', async () => {
+ api.getBranches.mockResolvedValue({ branches: [{ name: 'dev', tracking: 'origin/dev', ahead: 1, behind: 0 }] });
+ api.pushAllBranches.mockResolvedValue({ success: true, pushed: 1, results: {} });
+ render(<GitTab appId="app-example" appName="Example App" repoPath="/repo" />);
+
+ expect(await screen.findByTestId('repository-source-panel')).toHaveAttribute('data-refresh-key', '0');
+ fireEvent.click(screen.getAllByRole('button', { name: /^Push$/ })[0]);
+
+ await waitFor(() => expect(api.pushAllBranches).toHaveBeenCalledWith('/repo'));
+ await waitFor(() => expect(screen.getByTestId('repository-source-panel')).toHaveAttribute('data-refresh-key', '1'));
+ });
});
describe('GitTab modal accessibility (issue #1090)', () => {