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: redraw managed-app git sources after an update instead of requiring a reload

Adam Eivy9dc8ec8cedc3
diff --git a/client/src/components/apps/tabs/RepositorySourcePanel.jsx b/client/src/components/apps/tabs/RepositorySourcePanel.jsx
index 6e0271dbc5..1be9686203 100644
--- a/client/src/components/apps/tabs/RepositorySourcePanel.jsx
+++ b/client/src/components/apps/tabs/RepositorySourcePanel.jsx
@@ -25,6 +25,8 @@ import AppOperationBanner from '../AppOperationBanner';
import GitRecoveryAction from './GitRecoveryAction';
import { useAppOperation } from '../../../hooks/useAppOperation';
+const PORTOS_APP_ID = 'portos-default';
+
const statusTone = {
current: 'bg-port-success/15 text-port-success',
attention: 'bg-port-warning/15 text-port-warning',
@@ -176,9 +178,14 @@ export default function RepositorySourcePanel({ appId, appName, onUpdated, refre
return result;
}, [appId]);
+ // Re-inspect the sources and release the "reload to update again" latch so
+ // the card redraws the post-update state without a page reload.
+ // PortOS itself restarts into a new client bundle, so it keeps the latch.
const handleOperationComplete = useCallback(() => {
+ if (appId !== PORTOS_APP_ID) setUpdateRequested(false);
+ load();
onUpdated?.();
- }, [onUpdated]);
+ }, [appId, load, onUpdated]);
const {
steps: operationSteps,
isOperating,
@@ -298,7 +305,7 @@ export default function RepositorySourcePanel({ appId, appName, onUpdated, refre
steps={operationSteps}
error={operationError}
completed={operationCompleted}
- completedMessage={operationType === 'update' ? 'Reload this page before starting another update.' : undefined}
+ completedMessage={appId === PORTOS_APP_ID && operationType === 'update' ? 'Reload this page before starting another update.' : undefined}
restarting={restarting}
/>
{/* Refusals PortOS's shared update preflight raises (server/services/updatePreflight.js)
diff --git a/client/src/components/apps/tabs/RepositorySourcePanel.test.jsx b/client/src/components/apps/tabs/RepositorySourcePanel.test.jsx
index 8f9367288c..c2ffacffb0 100644
--- a/client/src/components/apps/tabs/RepositorySourcePanel.test.jsx
+++ b/client/src/components/apps/tabs/RepositorySourcePanel.test.jsx
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
+import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
import { awaitEnabled } from '../../../test/enabledBarrier.js';
vi.mock('../../../services/api', () => ({
@@ -275,6 +275,24 @@ describe('managed app repository sources', () => {
);
});
+ it('re-checks sources and unlocks the update button when a managed app update completes', async () => {
+ let complete;
+ useAppOperation.mockImplementation(({ onComplete }) => {
+ complete = onComplete;
+ return { ...useAppOperation.mock.results[0]?.value, steps: [], isOperating: false, startUpdate: vi.fn(), restarting: false };
+ });
+ render(<RepositorySourcePanel appId="app-example" appName="Example App" />);
+ fireEvent.click(await screen.findByRole('button', { name: 'Update app' }));
+ fireEvent.click(within(await screen.findByRole('dialog')).getByRole('button', { name: 'Update app' }));
+ expect(await screen.findByRole('button', { name: 'Reload to update again' })).toBeDisabled();
+
+ const calls = api.getAppRepositorySources.mock.calls.length;
+ act(() => complete());
+ await waitFor(() => expect(api.getAppRepositorySources.mock.calls.length).toBe(calls + 1));
+ expect(await screen.findByRole('button', { name: 'Update app' })).toBeEnabled();
+ expect(screen.queryByRole('button', { name: 'Reload to update again' })).toBeNull();
+ });
+
it('refuses automatic fork sync after divergence but still permits updating from the fork as-is', async () => {
const status = canonicalStatus();
status.sources[0] = source({