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
feat([issue-13193]): make GitHub inbox suggestions buttons that do what they suggest
Adam Eivy306f78d08516
diff --git a/client/src/components/github/GitHubInboxTab.jsx b/client/src/components/github/GitHubInboxTab.jsxindex 9d4e21800c..6c32875366 100644--- a/client/src/components/github/GitHubInboxTab.jsx+++ b/client/src/components/github/GitHubInboxTab.jsx@@ -9,7 +9,7 @@ import OverflowMenu from '../ui/OverflowMenu';import GitHubThreadDrawer from './GitHubThreadDrawer';import GitHubDeploymentReview from './GitHubDeploymentReview';import GitHubAgentPinForm from './GitHubAgentPinForm';-import { AGENT_REFUSED_LABELS, DECISION_VIEW, TRUST_VIEW } from './githubTriageLabels';+import { AGENT_REFUSED_LABELS, DECISION_ACTIONS, DECISION_VIEW, TRUST_VIEW } from './githubTriageLabels';import socket from '../../services/socket';import LoadFailedState from '../ui/LoadFailedState';import PageSkeleton from '../ui/PageSkeleton';@@ -155,6 +155,14 @@ const agentFailedLink = ({ agentId, taskId }) => (agentId? `/cos/agents/${encodeURIComponent(agentId)}`: `/cos/tasks?task=${encodeURIComponent(taskId)}&source=user`);+const SUGGESTION_ICONS = { agent: Bot, done: Check, mute: BellOff };+// A suggestion button keeps its pill's color, so the row still reads the same.+const SUGGESTION_TONES = {+ accent: 'border-port-accent/40 bg-port-accent/10 text-port-accent',+ warning: 'border-port-warning/40 bg-port-warning/10 text-port-warning',+ muted: 'border-port-border bg-port-bg text-gray-200',+};+function NotificationRow({ notification, accountLabel, busy, onAction, onUpdated }) {const [reviewing, setReviewing] = useState(false);const [picking, setPicking] = useState(false);@@ -165,6 +173,9 @@ function NotificationRow({ notification, accountLabel, busy, onAction, onUpdated// Every open row offers the button; a refused lane disables it with its reason.const agent = handled ? null : notification.agent;const canResolve = Boolean(agent) && !agent.refused;+ const refusedId = `agent-refused-${notification.accountId}-${notification.threadId}`;+ const suggestionAction = handled ? null : DECISION_ACTIONS[notification.decision];+ const suggestion = suggestionAction ? { ...suggestionAction, icon: SUGGESTION_ICONS[suggestionAction.action] } : null;const startAgent = async (pin) => {if (await onAction(notification, 'agent', pin)) setPicking(false);};@@ -199,7 +210,17 @@ function NotificationRow({ notification, accountLabel, busy, onAction, onUpdated</p>)}<div className="mt-1.5 flex flex-wrap items-center gap-1.5">- {decision && <Pill tone={decision.tone}>{decision.label}</Pill>}+ {decision && (suggestion ? (+ <button+ type="button"+ disabled={busy || (suggestion.action === 'agent' && !canResolve)}+ onClick={() => (suggestion.action === 'agent' ? setPicking(true) : onAction(notification, suggestion.action))}+ aria-describedby={suggestion.action === 'agent' && agent?.refused ? refusedId : undefined}+ className={`inline-flex min-h-[36px] items-center gap-1 rounded-lg border px-2.5 py-1 text-xs font-medium hover:brightness-125 disabled:opacity-50 ${SUGGESTION_TONES[decision.tone] || SUGGESTION_TONES.muted}`}+ >+ <suggestion.icon size={12} aria-hidden="true" /> {suggestion.label}+ </button>+ ) : <Pill tone={decision.tone}>{decision.label}</Pill>)}{notification.yourRepo && <Pill tone="accent">Your repo</Pill>}{notification.repoPrivate && <Pill tone="muted">Private</Pill>}{trust && <Pill tone={trust.tone}>{trust.label}</Pill>}@@ -229,7 +250,7 @@ function NotificationRow({ notification, accountLabel, busy, onAction, onUpdated/>)}{agent?.refused && (- <p id={`agent-refused-${notification.accountId}-${notification.threadId}`} className="mt-1 text-xs text-gray-500">+ <p id={refusedId} className="mt-1 text-xs text-gray-500">{AGENT_REFUSED_LABELS[agent.refused] || agent.refused}</p>)}@@ -250,7 +271,7 @@ function NotificationRow({ notification, accountLabel, busy, onAction, onUpdatedtype="button"disabled={busy || !canResolve}onClick={() => setPicking(true)}- aria-describedby={agent.refused ? `agent-refused-${notification.accountId}-${notification.threadId}` : undefined}+ aria-describedby={agent.refused ? refusedId : undefined}className={`inline-flex min-h-[36px] items-center gap-1 rounded-lg px-3 py-1.5 text-xs font-medium disabled:opacity-50 ${canResolve? 'bg-port-accent text-white': 'border border-port-border text-gray-400'}`}diff --git a/client/src/components/github/githubTriageLabels.js b/client/src/components/github/githubTriageLabels.jsindex 7e96df676b..54c14c6bb4 100644--- a/client/src/components/github/githubTriageLabels.js+++ b/client/src/components/github/githubTriageLabels.js@@ -14,6 +14,18 @@ export const DECISION_VIEW = {'handed-off': { tone: 'success', label: 'Handed off' },};+// Suggestions that are also an action: the chip is a button that does it.+// `agent` opens Resolve with agent's picker (the thread's own lane decides+// Do:Review or Untrusted:Review); the rest apply that inbox action.+export const DECISION_ACTIONS = {+ 'suggest-review': { action: 'agent', label: 'Do:Review' },+ 'suggest-untrusted-review': { action: 'agent', label: 'Untrusted:Review' },+ 'suggest-done': { action: 'done', label: 'Mark done' },+ 'suggest-mark-read': { action: 'done', label: 'Mark done' },+ duplicate: { action: 'done', label: 'Mark done' },+ 'suggest-mute': { action: 'mute', label: 'Mute' },+};+export const TRUST_VIEW = {yours: { tone: 'success', label: 'You' },trusted: { tone: 'success', label: 'Trusted' },diff --git a/client/src/pages/GitHub.test.jsx b/client/src/pages/GitHub.test.jsxindex 39a6c2b42f..dc7a793d27 100644--- a/client/src/pages/GitHub.test.jsx+++ b/client/src/pages/GitHub.test.jsx@@ -452,6 +452,38 @@ describe('GitHub inbox tab', () => {expect(await screen.findByText('Your inbox is clear.')).toBeTruthy();});+ it('turns a suggestion into a button that does it, and leaves informational decisions as pills', async () => {+ mock.getGitHubNotifications.mockResolvedValue({+ notifications: [+ { ...NOTIFICATION, threadId: '201', title: 'Quiet thread', decision: 'suggest-mute', reason: 'subscribed' },+ { ...NOTIFICATION, threadId: '202', title: 'Outside PR', decision: 'suggest-untrusted-review', agent: { lane: 'pr-reviewer', refused: 'no-managed-app', pin: null } },+ { ...NOTIFICATION, threadId: '203', title: 'Red main', decision: 'surface', reason: 'ci_activity', subjectType: 'CheckSuite' },+ ],+ sync: {},+ });+ mock.applyGitHubNotificationAction.mockImplementation(async (_account, threadId) => ({ ...NOTIFICATION, threadId, state: 'muted' }));+ renderTab('inbox');+ fireEvent.click(await screen.findByRole('button', { name: 'Mute' }));+ expect(mock.applyGitHubNotificationAction).toHaveBeenCalledWith('github-com', '201', 'mute');+ // A suggestion whose lane is refused is a disabled button that says why.+ const review = screen.getByRole('button', { name: 'Untrusted:Review' });+ expect(review.disabled).toBe(true);+ expect(document.getElementById(review.getAttribute('aria-describedby'))).toBeTruthy();+ // "Worth a look" is information, not an action.+ expect(screen.getByText('Worth a look').closest('button')).toBeNull();+ await waitFor(() => expect(screen.queryByText('Quiet thread')).toBeNull());+ });++ it('opens the agent picker from a review suggestion', async () => {+ mock.getGitHubNotifications.mockResolvedValue({+ notifications: [{ ...NOTIFICATION, decision: 'suggest-review', agent: { lane: 'do-review', refused: null, pin: null } }],+ sync: {},+ });+ renderTab('inbox');+ fireEvent.click(await screen.findByRole('button', { name: 'Do:Review' }));+ expect(await screen.findByRole('button', { name: 'Start agent' })).toBeTruthy();+ });+it('marks a thread done and takes it out of the inbox', async () => {mock.applyGitHubNotificationAction.mockResolvedValue({ ...NOTIFICATION, state: 'done', unread: false });renderTab('inbox');@@ -470,7 +502,8 @@ describe('GitHub inbox tab', () => {renderTab('inbox');// The inbox mirrors GitHub's, so a folded duplicate is listed with its pill.expect(await screen.findByText('Folded CI notice')).toBeTruthy();- expect(screen.getByText('Duplicate')).toBeTruthy();+ // Its suggestion is the action itself.+ expect(screen.getAllByRole('button', { name: 'Mark done' }).length).toBe(1);fireEvent.click(screen.getByRole('button', { name: 'Mark 1 finished done' }));await waitFor(() => expect(mock.clearFinishedGitHubNotifications).toHaveBeenCalledWith(null));});@@ -566,7 +599,7 @@ describe('GitHub inbox triage', () => {sync: {},});renderTab('inbox');- expect(await screen.findByText('Suggest Untrusted:Review')).toBeTruthy();+ expect(await screen.findByRole('button', { name: 'Untrusted:Review' })).toBeTruthy();expect(screen.getByText('Outside')).toBeTruthy();fireEvent.click(screen.getByRole('button', { name: /^Suspect/ }));