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: scope review controls to stored items (#10693)
Adam Eivy1e7a3bce117f
diff --git a/client/src/pages/Review.jsx b/client/src/pages/Review.jsxindex 325859d774..32cd407088 100644--- a/client/src/pages/Review.jsx+++ b/client/src/pages/Review.jsx@@ -421,41 +421,6 @@ export default function Review() {icon={ClipboardList}iconColor="text-white"title="Actions"- actions={(- <>- <select- aria-label="Filter review items by status"- value={filter}- onChange={(e) => setFilter(e.target.value)}- className="bg-port-card border border-port-border rounded-lg px-3 py-2 text-sm text-gray-300"- >- <option value="pending">Pending</option>- <option value="completed">Completed</option>- <option value="dismissed">Dismissed</option>- <option value="all">All</option>- </select>- {pendingCount > 0 && (- <>- {genericCompletableCount > 0 && (- <button- onClick={handleCompleteAll}- className="px-3 py-2 text-sm bg-port-success/10 hover:bg-port-success/20 border border-port-success/30 rounded-lg text-port-success transition-colors"- title="Mark all general pending items as completed"- >- Complete All- </button>- )}- <button- onClick={handleMarkAllRead}- className="px-3 py-2 text-sm bg-port-border/50 hover:bg-port-border rounded-lg text-gray-300 transition-colors"- title="Dismiss all pending items"- >- Dismiss All- </button>- </>- )}- </>- )}/><div className="flex-1 min-h-0 overflow-auto p-4 md:p-6 space-y-3"><TabPills@@ -555,6 +520,46 @@ export default function Review() {{/* Legacy Review list — only shown when the canonical projection isempty, so old stored records remain usable without duplicating theActions rows. */}+ {showLegacyReviewSurface && (+ <section aria-labelledby="stored-review-items-heading" className="bg-port-card border border-port-border rounded-xl p-4 space-y-3">+ <div className="flex flex-wrap items-center justify-between gap-3">+ <h2 id="stored-review-items-heading" className="text-sm font-semibold text-white">Stored review items</h2>+ <div className="flex flex-wrap items-center gap-2">+ <select+ aria-label="Filter review items by status"+ value={filter}+ onChange={(e) => setFilter(e.target.value)}+ className="bg-port-card border border-port-border rounded-lg px-3 py-2 text-sm text-gray-300"+ >+ <option value="pending">Pending</option>+ <option value="completed">Completed</option>+ <option value="dismissed">Dismissed</option>+ <option value="all">All</option>+ </select>+ {pendingCount > 0 && (+ <>+ {genericCompletableCount > 0 && (+ <button+ onClick={handleCompleteAll}+ className="px-3 py-2 text-sm bg-port-success/10 hover:bg-port-success/20 border border-port-success/30 rounded-lg text-port-success transition-colors"+ title="Mark all general pending items as completed"+ >+ Complete All+ </button>+ )}+ <button+ onClick={handleMarkAllRead}+ className="px-3 py-2 text-sm bg-port-border/50 hover:bg-port-border rounded-lg text-gray-300 transition-colors"+ title="Dismiss all pending items"+ >+ Dismiss All+ </button>+ </>+ )}+ </div>+ </div>+ </section>+ )}{showLegacyReviewSurface && topActionItems.length > 0 && (<section className="bg-port-card border border-port-border rounded-xl p-4 space-y-3"><div className="flex items-center justify-between gap-3">diff --git a/client/src/pages/Review.test.jsx b/client/src/pages/Review.test.jsxindex 5552c3c58e..7650664320 100644--- a/client/src/pages/Review.test.jsx+++ b/client/src/pages/Review.test.jsx@@ -425,6 +425,50 @@ describe('Review Hub queue-card triage (#3282)', () => {});describe('Actions commitments workspace (#7739)', () => {+ it('keeps stored-item filters and bulk actions out of the canonical queue header', async () => {+ const canonicalItem = {+ id: 'health:required-example', source: 'health', sourceLabel: 'Health anomalies',+ title: 'Required health action', summary: 'Review this action',+ operations: [{ id: 'complete', label: 'Mark resolved', available: true }],+ };+ api.getReviewQueue.mockResolvedValueOnce({ partial: false, sources: {}, items: [canonicalItem] });++ render(<Review />);++ expect(await screen.findByText(canonicalItem.title)).toBeInTheDocument();+ expect(screen.queryByLabelText('Filter review items by status')).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Complete All' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Dismiss All' })).not.toBeInTheDocument();+ expect(screen.queryByRole('heading', { name: 'Stored review items' })).not.toBeInTheDocument();+ });++ it('keeps stored-item controls inside the named legacy fallback section', async () => {+ render(<Review />);++ const heading = await screen.findByRole('heading', { name: 'Stored review items' });+ const section = heading.closest('section');+ expect(section).toContainElement(screen.getByLabelText('Filter review items by status'));+ expect(section).toContainElement(screen.getByRole('button', { name: 'Complete All' }));+ expect(section).toContainElement(screen.getByRole('button', { name: 'Dismiss All' }));+ });++ it('hides stored-item controls when the canonical queue is degraded or partial', async () => {+ const degradedQueue = {+ partial: true,+ sources: { health: { label: 'Health anomalies', error: 'source unavailable' } },+ items: [],+ };+ api.getReviewQueue.mockResolvedValueOnce(degradedQueue);++ render(<Review />);++ expect(await screen.findByText(/This bounded view may omit additional actions/)).toBeInTheDocument();+ expect(screen.queryByLabelText('Filter review items by status')).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Complete All' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Dismiss All' })).not.toBeInTheDocument();+ expect(screen.queryByRole('heading', { name: 'Stored review items' })).not.toBeInTheDocument();+ });+it('renders the canonical Actions workspace while stored review items are pending', async () => {let resolveLegacyItems;api.getReviewItems.mockReturnValueOnce(new Promise((resolve) => { resolveLegacyItems = resolve; }));