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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: keep Actions usable while review history loads (#9445)
[._.]/ Adam Eivyff0d147ea2de
diff --git a/client/src/pages/Review.jsx b/client/src/pages/Review.jsxindex 3ae1f4f0fa..fb83563404 100644--- a/client/src/pages/Review.jsx+++ b/client/src/pages/Review.jsx@@ -34,7 +34,6 @@ import {} from 'lucide-react';import PageHeader from '../components/PageHeader';import QueueInvestigationButton from '../components/ui/QueueInvestigationButton';-import PageSkeleton from '../components/ui/PageSkeleton';import CollapsibleText from '../components/ui/CollapsibleText';import MarkdownOutput from '../components/cos/MarkdownOutput';import Drawer from '../components/Drawer';@@ -152,6 +151,7 @@ export default function Review() {const [items, setItems] = useState([]);const [briefing, setBriefing] = useState(null);const [loading, setLoading] = useState(true);+ const [itemsError, setItemsError] = useState(false);const [newTodo, setNewTodo] = useState('');const [editingId, setEditingId] = useState(null);const [filter, setFilter] = useState('pending');@@ -172,11 +172,18 @@ export default function Review() {// double-tap can't double-resolve while the request is pending.const [resolvingQueueIds, setResolvingQueueIds] = useState(() => new Set());- const fetchItems = useCallback(async () => {+ const fetchItems = useCallback(() => {const params = filter === 'all' ? {} : { status: filter };- const data = await api.getReviewItems(params).catch(() => []);- setItems(data);- setLoading(false);+ setLoading(true);+ setItemsError(false);+ return api.getReviewItems(params, { silent: true }).then(data => {+ setItems(data);+ setLoading(false);+ }).catch(() => {+ setItems([]);+ setItemsError(true);+ setLoading(false);+ });}, [filter]);const fetchCounts = useCallback(() => {@@ -354,8 +361,7 @@ export default function Review() {// Derived review state. Memoized because this page subscribes to// review:item:created/updated/deleted socket events and re-renders on each —// without memoization every one of these filter/sort passes over `items` reruns- // on unrelated re-renders (typing, hover state). Hooks must run before the- // loading early-return, so they live here above it.+ // on unrelated re-renders (typing, hover state).// Keep the detailed list aligned with the active status tab while socket// events update the cached items from every status.const visibleItems = useMemo(() => {@@ -394,18 +400,6 @@ export default function Review() {return new Date(b.createdAt) - new Date(a.createdAt);}), [pendingItems]);- if (loading) {- return <PageSkeleton- label="Loading Actions"- header="bar"- padded- fullHeight- titleWidthClass="w-40"- cards={4}- sidebar={false}- />;- }-// Cheap derivations off the memoized `pendingItems`/`actionableItems` — plain// consts, not memos: the action list is an O(8) slice with no consumer that// needs referential stability, so a hook here would be pure ceremony.@@ -591,6 +585,15 @@ export default function Review() {</section>)}+ {showLegacyReviewSurface && loading && (+ <p role="status" className="text-sm text-port-text-muted">Loading stored review items…</p>+ )}+ {showLegacyReviewSurface && itemsError && (+ <p role="alert" className="text-sm text-port-warning">+ Stored review items are unavailable. <button onClick={fetchItems} className="underline">Retry</button>+ </p>+ )}+{/* Daily Briefing remains available as compatibility/history context. */}{showLegacyReviewSurface && briefing && briefing.source !== 'none' && (<section@@ -662,7 +665,7 @@ export default function Review() {})}</div>}- {showLegacyReviewSurface && visibleItems.length === 0 && (+ {showLegacyReviewSurface && !loading && !itemsError && visibleItems.length === 0 && (<div className="text-center py-12 text-gray-500"><ClipboardList size={48} className="mx-auto mb-3 opacity-30" /><p className="text-lg">No review items in this view</p>diff --git a/client/src/pages/Review.test.jsx b/client/src/pages/Review.test.jsxindex d416051041..badfaec17a 100644--- a/client/src/pages/Review.test.jsx+++ b/client/src/pages/Review.test.jsx@@ -413,6 +413,56 @@ describe('Review Hub queue-card triage (#3282)', () => {});describe('Actions commitments workspace (#7739)', () => {+ it('renders the canonical Actions workspace while stored review items are pending', async () => {+ let resolveLegacyItems;+ api.getReviewItems.mockReturnValueOnce(new Promise((resolve) => { resolveLegacyItems = resolve; }));+ api.getReviewQueue.mockResolvedValueOnce({+ partial: false,+ sources: {},+ items: [],+ });++ render(<Review />);+ const input = await screen.findByLabelText('Quick add action');+ expect(input).toBeEnabled();+ expect(screen.getByRole('status')).toHaveTextContent('Loading stored review items');++ await act(async () => resolveLegacyItems([ITEM]));++ expect(await screen.findByLabelText('Quick add action')).toBe(input);+ expect(screen.getAllByText(ITEM.title)).toHaveLength(2);+ });++ it('shows and retries a canonical queue failure while stored review items are pending', async () => {+ api.getReviewItems.mockReturnValueOnce(new Promise(() => {}));+ api.getReviewQueue.mockRejectedValueOnce(new Error('synthetic queue failure'));++ render(<Review />);+ expect(await screen.findByRole('alert')).toHaveTextContent('Actions unavailable');+ expect(screen.getByLabelText('Quick add action')).toBeEnabled();++ fireEvent.click(screen.getByRole('button', { name: 'Retry' }));++ await waitFor(() => expect(api.getReviewQueue).toHaveBeenCalledTimes(2));+ expect(screen.queryByText('Actions unavailable')).not.toBeInTheDocument();+ expect(screen.getByLabelText('Quick add action')).toBeEnabled();+ });++ it('shows a local retry when stored review items fail to load', async () => {+ api.getReviewItems+ .mockRejectedValueOnce(new Error('synthetic legacy read failure'))+ .mockResolvedValueOnce([ITEM]);++ render(<Review />);+ const retry = await screen.findByRole('button', { name: 'Retry' });+ expect(screen.getByRole('alert')).toHaveTextContent('Stored review items are unavailable');++ fireEvent.click(retry);++ expect(await screen.findAllByText(ITEM.title)).toHaveLength(2);+ expect(screen.queryByText('Stored review items are unavailable')).not.toBeInTheDocument();+ });+it('uses Brain threads for quick-add instead of the legacy todo endpoint', async () => {render(<Review />);const input = await screen.findByLabelText('Quick add action');@@ -521,7 +571,7 @@ describe('Review Hub triage summary (#6926)', () => {fireEvent.change(screen.getByRole('combobox', { name: 'Filter review items by status' }), {target: { value: 'completed' }});- await waitFor(() => expect(api.getReviewItems).toHaveBeenLastCalledWith({ status: 'completed' }));+ await waitFor(() => expect(api.getReviewItems).toHaveBeenLastCalledWith({ status: 'completed' }, { silent: true }));expect(summaryValue('Pending')).toBe('8');expect(summaryValue('Alerts')).toBe('3');diff --git a/client/src/services/apiReview.js b/client/src/services/apiReview.jsindex 547c29374c..0b4221c3dd 100644--- a/client/src/services/apiReview.js+++ b/client/src/services/apiReview.js@@ -10,12 +10,12 @@ export const claimReviewQueueDelivery = (id, options = {}) => request('/review/q});// Review Hub-export const getReviewItems = (params) => {+export const getReviewItems = (params, options = {}) => {const qs = new URLSearchParams();if (params?.status) qs.set('status', params.status);if (params?.type) qs.set('type', params.type);const query = qs.toString();- return request(`/review/items${query ? `?${query}` : ''}`);+ return request(`/review/items${query ? `?${query}` : ''}`, options);};export const getReviewCounts = (options = {}) => request('/review/counts', options);export const getReviewBriefing = () => request('/review/briefing');