From cf1f4b5dbcb4244e58e73707e9008e570374709e Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Sat, 4 Jul 2026 15:44:41 +0100 Subject: [PATCH] Work panel: accept PRs from any agent, pop the GitHub stack in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The panel's PR link scan matched only the chat's default agent, so a pull request posted by a second agent added to the chat never surfaced — the drawer stayed on "No current branch". The scan now matches any managed agent (plus the configured default). When the PR info arrives, the card + CI monitor stack enters with a slight scale + opacity pop (keyed by PR href, so a newer PR re-runs it; disabled under prefers-reduced-motion). Co-Authored-By: Claude Fable 5 --- .../src/features/chats/ui/ChatWorkPanel.tsx | 147 +++++++++--------- desktop/src/features/chats/ui/ChatsScreen.tsx | 28 +++- .../src/shared/styles/globals/animations.css | 25 +++ 3 files changed, 122 insertions(+), 78 deletions(-) diff --git a/desktop/src/features/chats/ui/ChatWorkPanel.tsx b/desktop/src/features/chats/ui/ChatWorkPanel.tsx index 5d7a7fe373..baf841c359 100644 --- a/desktop/src/features/chats/ui/ChatWorkPanel.tsx +++ b/desktop/src/features/chats/ui/ChatWorkPanel.tsx @@ -119,79 +119,84 @@ export function ChatWorkPanel({ /> {preview ? ( - - ) : null} - {preview ? ( -
- - - - - - {openThreads} open comment{openThreads === 1 ? "" : "s"} - - - -
- {checks && checks.runs.length > 0 ? ( -
    - {dedupeRunKeys(checks.runs).map(({ key, run }) => ( -
  • - - - {run.name} - -
  • - ))} -
- ) : ( - - No checks reported yet. + +
+ + + - )} - -
+ + + {openThreads} open comment{openThreads === 1 ? "" : "s"} + + + +
+ {checks && checks.runs.length > 0 ? ( +
    + {dedupeRunKeys(checks.runs).map(({ key, run }) => ( +
  • + + + {run.name} + +
  • + ))} +
+ ) : ( + + No checks reported yet. + + )} + +
+ ) : null} diff --git a/desktop/src/features/chats/ui/ChatsScreen.tsx b/desktop/src/features/chats/ui/ChatsScreen.tsx index 4f8eb68678..4317c766af 100644 --- a/desktop/src/features/chats/ui/ChatsScreen.tsx +++ b/desktop/src/features/chats/ui/ChatsScreen.tsx @@ -310,17 +310,26 @@ export function ChatsScreen({ ); const archiveChatMutation = useArchiveChatMutation(); - // Latest PR link the chat's agent posted — drives the header toggle and - // the top-right work module in the conversation. + // Latest PR link ANY agent in the chat posted — drives the header toggle + // and the top-right work module. Matching only the default agent missed + // PRs from additional agents added to the chat. const agentPullRequestHref = React.useMemo(() => { - const agentPubkey = metadata?.defaultAgentPubkey ?? defaultAgent?.pubkey; - if (!agentPubkey) { + const agentKeys = new Set( + (managedAgentsQuery.data ?? []).map((agent) => + normalizePubkey(agent.pubkey), + ), + ); + const configuredAgent = + metadata?.defaultAgentPubkey ?? defaultAgent?.pubkey; + if (configuredAgent) { + agentKeys.add(normalizePubkey(configuredAgent)); + } + if (agentKeys.size === 0) { return null; } - const agentKey = normalizePubkey(agentPubkey); for (let index = messages.length - 1; index >= 0; index--) { const message = messages[index]; - if (normalizePubkey(message.pubkey) !== agentKey) { + if (!agentKeys.has(normalizePubkey(message.pubkey))) { continue; } const preview = extractSupportedLinkPreviews(message.content).find( @@ -331,7 +340,12 @@ export function ChatsScreen({ } } return null; - }, [defaultAgent?.pubkey, messages, metadata?.defaultAgentPubkey]); + }, [ + defaultAgent?.pubkey, + managedAgentsQuery.data, + messages, + metadata?.defaultAgentPubkey, + ]); // null = auto: open once the agent has produced a PR, closed otherwise. // A click stores an explicit preference for the current chat. const [workPanelPreference, setWorkPanelPreference] = React.useState< diff --git a/desktop/src/shared/styles/globals/animations.css b/desktop/src/shared/styles/globals/animations.css index 1befca1fd4..6c7daa537b 100644 --- a/desktop/src/shared/styles/globals/animations.css +++ b/desktop/src/shared/styles/globals/animations.css @@ -263,6 +263,31 @@ } } +/* Work-panel content arriving (the agent posted a PR): a gentle pop — + slight scale + fade, matching the message entrance feel. */ +@keyframes buzz-work-card-in { + from { + opacity: 0; + transform: scale(0.96); + } + + to { + opacity: 1; + transform: scale(1); + } +} + +.buzz-work-card-in { + animation: buzz-work-card-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both; + transform-origin: top center; +} + +@media (prefers-reduced-motion: reduce) { + .buzz-work-card-in { + animation: none; + } +} + .buzz-poof-layer { inset: 0; overflow: hidden;