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: clarify daily recommendation scope (#9765)

Adam Eivy4cc01f150c4e
diff --git a/client/src/components/ActionQueuePreview.jsx b/client/src/components/ActionQueuePreview.jsx
index 3479af5138..5a73f74795 100644
--- a/client/src/components/ActionQueuePreview.jsx
+++ b/client/src/components/ActionQueuePreview.jsx
@@ -6,7 +6,7 @@ import { formatCount } from '../utils/formatters';
export const actionSelectionLink = (id) => `/review/${encodeURIComponent(id)}?view=today`;
/** The same canonical rows and failure contract in every compact surface. */
-export default function ActionQueuePreview({ title = 'Actions', sources, queue, onSelect, compact = false }) {
+export default function ActionQueuePreview({ title = 'Actions', sources, queue, onSelect, compact = false, scopeDescription }) {
const live = useActionQueue();
const { data, loading, error } = queue || live;
const heading = useId();
@@ -29,15 +29,16 @@ export default function ActionQueuePreview({ title = 'Actions', sources, queue,
<section className={compact ? '@container p-4' : '@container bg-port-card border border-port-border rounded-xl p-4'} aria-labelledby={heading}>
<div className="flex flex-wrap items-center justify-between gap-2 mb-3">
<h2 id={heading} className="text-sm font-semibold text-port-text">{title}</h2>
- {data && <span className="text-xs text-port-warning">{lowerBound ? 'At least ' : ''}{formatCount(required.length)} required</span>}
+ {data && <span className="text-xs text-port-warning">{lowerBound ? 'At least ' : ''}{formatCount(required.length)} {scopeDescription ? 'required in this view' : 'required'}</span>}
</div>
+ {scopeDescription && <p className="text-xs text-port-text-muted mb-3">{scopeDescription}</p>}
{loading && !data && <p role="status" className="text-sm text-port-text-muted">Loading actions…</p>}
{error && <p role="alert" className="text-sm text-port-warning">{data ? 'Actions could not refresh. Showing the last known actions.' : 'Actions unavailable.'} <button type="button" onClick={live.refetch} className="underline min-h-[44px]">Retry</button></p>}
{unavailable.length > 0 && <p role="status" className="text-xs text-port-warning mb-2">Could not load {sourceNames(unavailable)}. <button type="button" onClick={live.refetch} className="underline min-h-[44px]">Retry</button> <Link to="/review?view=today" onClick={onSelect} className="underline">View source details</Link></p>}
{limited.length > 0 && <p className="text-xs text-port-text-muted mb-2">Showing a limited preview of {sourceNames(limited)}. Open Actions for source details.</p>}
{unknownPartial && <p role="status" className="text-xs text-port-text-muted mb-2">Action counts are incomplete. Open Actions for source details.</p>}
{morePages && <p className="text-xs text-port-text-muted mb-2">More actions are available in Open Actions.</p>}
- {data && !lowerBound && items.length === 0 && <p className="text-sm text-port-text-muted">All caught up!</p>}
+ {data && !lowerBound && items.length === 0 && <p className="text-sm text-port-text-muted">{scopeDescription ? 'No recommendations in this view.' : 'All caught up!'}</p>}
{groups.map((group) => group.items.length > 0 && (
<div key={group.label} className="mb-3">
<h4 className="text-xs text-port-text-muted mb-1">{group.label}</h4>
@@ -53,7 +54,7 @@ export default function ActionQueuePreview({ title = 'Actions', sources, queue,
</ul>
</div>
))}
- <Link to="/review?view=today" onClick={onSelect} className="inline-flex items-center min-h-[44px] text-sm text-port-accent">Open Actions</Link>
+ <Link to="/review?view=today" onClick={onSelect} className="inline-flex items-center min-h-[44px] text-sm text-port-accent">{scopeDescription ? 'View all actions' : 'Open Actions'}</Link>
</section>
);
}
diff --git a/client/src/components/ActionQueuePreview.test.jsx b/client/src/components/ActionQueuePreview.test.jsx
index 066f3488a1..77f56b64ec 100644
--- a/client/src/components/ActionQueuePreview.test.jsx
+++ b/client/src/components/ActionQueuePreview.test.jsx
@@ -14,8 +14,9 @@ vi.mock('../services/api', () => ({ getReviewQueue: mock.getReviewQueue }));
vi.mock('../services/socket', () => ({ default: { on: mock.on, off: mock.off } }));
const required = { id: 'health:disk', source: 'health', required: true, title: 'Disk needs attention', reason: 'Free space is low' };
+const requiredThread = { id: 'thread:follow-up', source: 'thread', required: true, title: 'Thread needs follow-up', reason: 'A reply is waiting' };
const optional = { id: 'product:daily-post', source: 'product', required: false, isRecommendation: true, title: 'Daily POST', reason: 'Practice today' };
-const envelope = (items = [required, optional], partial = false) => ({ items, partial, sources: {} });
+const envelope = (items = [required, requiredThread, optional], partial = false) => ({ items, partial, sources: {} });
function Surfaces() {
const [history, setHistory] = useState([{ id: 'event-1', title: 'An event', read: false, timestamp: '2026-01-01' }]);
@@ -38,9 +39,15 @@ afterEach(cleanup);
describe('canonical action previews', () => {
it('shares IDs and required counts across the bell and saved widgets; history controls cannot complete actions', async () => {
show();
- const bell = await screen.findByRole('button', { name: 'Notifications (1 required actions)' });
- const daily = screen.getByRole('region', { name: "Today's actions" });
- expect(within(daily).getByRole('heading', { name: "Today's actions", level: 2 })).toBeInTheDocument();
+ const bell = await screen.findByRole('button', { name: 'Notifications (2 required actions)' });
+ const daily = screen.getByRole('region', { name: 'Daily recommendations' });
+ expect(within(daily).getByRole('heading', { name: 'Daily recommendations', level: 2 })).toBeInTheDocument();
+ expect(within(daily).getByText('Product recommendations only. Required actions from other sources are not shown here.')).toBeInTheDocument();
+ expect(within(daily).getByText('0 required in this view')).toBeInTheDocument();
+ expect(within(daily).queryByText('Disk needs attention')).not.toBeInTheDocument();
+ expect(within(daily).queryByText('Thread needs follow-up')).not.toBeInTheDocument();
+ expect(within(daily).getByText('Optional recommendations')).toBeInTheDocument();
+ expect(within(daily).getByRole('link', { name: 'View all actions' })).toHaveAttribute('href', '/review?view=today');
fireEvent.click(bell);
const panel = screen.getByRole('region', { name: 'Notifications' });
expect(mock.getReviewQueue).toHaveBeenCalledTimes(1);
@@ -48,10 +55,11 @@ describe('canonical action previews', () => {
expect(link).toHaveAttribute('href', '/review/health%3Adisk?view=today');
expect(link.closest('li')).toHaveAttribute('data-action-id', 'health:disk');
}
+ expect(screen.getAllByRole('link', { name: /Thread needs follow-up/ })).toHaveLength(2);
expect(screen.getAllByRole('link', { name: /Disk needs attention/ })).toHaveLength(3);
expect(screen.getAllByRole('link', { name: /Daily POST/ })).toHaveLength(4);
fireEvent.click(within(panel).getByRole('button', { name: 'Mark all notifications as read' }));
- expect(bell).toHaveAccessibleName('Notifications (1 required actions)');
+ expect(bell).toHaveAccessibleName('Notifications (2 required actions)');
fireEvent.click(within(panel).getByRole('button', { name: 'Clear all notifications' }));
expect(within(panel).getByText('No notifications')).toBeInTheDocument();
expect(within(panel).getByRole('link', { name: /Disk needs attention/ })).toBeInTheDocument();
@@ -86,8 +94,8 @@ describe('canonical action previews', () => {
} });
show();
fireEvent.click(await screen.findByRole('button', { name: /Notifications/ }));
- const daily = screen.getByRole('region', { name: "Today's actions" });
- expect(within(daily).getByText('All caught up!')).toBeInTheDocument();
+ const daily = screen.getByRole('region', { name: 'Daily recommendations' });
+ expect(within(daily).getByText('No recommendations in this view.')).toBeInTheDocument();
expect(within(daily).queryByText(/limited preview|unavailable|incomplete/)).not.toBeInTheDocument();
const notices = screen.getAllByText(/Showing a limited preview of Stored review obligations/);
expect(notices).toHaveLength(2);
@@ -105,7 +113,7 @@ describe('canonical action previews', () => {
const notice = await screen.findByText(/Could not load Stored review obligations/);
expect(within(notice).getByRole('button', { name: 'Retry' })).toBeInTheDocument();
expect(within(notice).getByRole('link', { name: 'View source details' })).toHaveAttribute('href', '/review?view=today');
- expect(within(screen.getByRole('region', { name: "Today's actions" })).getByText('All caught up!')).toBeInTheDocument();
+ expect(within(screen.getByRole('region', { name: 'Daily recommendations' })).getByText('No recommendations in this view.')).toBeInTheDocument();
});
it('drops an older response when completion invalidates a pending read', async () => {
@@ -115,7 +123,8 @@ describe('canonical action previews', () => {
mock.getReviewQueue.mockResolvedValue(envelope([]));
act(() => mock.on.mock.calls.find(([event]) => event === 'review:queue:changed')[1]());
await act(async () => finish(envelope()));
- await waitFor(() => expect(screen.getAllByText('All caught up!')).toHaveLength(3));
+ await waitFor(() => expect(screen.getAllByText('All caught up!')).toHaveLength(2));
+ expect(screen.getByText('No recommendations in this view.')).toBeInTheDocument();
expect(screen.queryByText('Disk needs attention')).not.toBeInTheDocument();
});
});
diff --git a/client/src/components/DailyActionsWidget.jsx b/client/src/components/DailyActionsWidget.jsx
index b77eaa3657..fb69e004b8 100644
--- a/client/src/components/DailyActionsWidget.jsx
+++ b/client/src/components/DailyActionsWidget.jsx
@@ -2,5 +2,9 @@ import ActionQueuePreview from './ActionQueuePreview';
// Saved daily-actions layouts remain a filtered product recommendation view.
export default function DailyActionsWidget() {
- return <ActionQueuePreview title="Today's actions" sources={['product']} />;
+ return <ActionQueuePreview
+ title="Daily recommendations"
+ sources={['product']}
+ scopeDescription="Product recommendations only. Required actions from other sources are not shown here."
+ />;
}