From b95ad77eeeac9b0f20e3563321a39a2288d5de0f Mon Sep 17 00:00:00 2001 From: iamnbutler Date: Fri, 23 Oct 2026 08:33:44 -0400 Subject: [PATCH 1/2] fix(app): let the details summary expand and reread the pull request when the window regains focus --- apps/app/src/channel.tsx | 4 +- .../session-details/session-details.tsx | 52 +++++++++++++++++-- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/apps/app/src/channel.tsx b/apps/app/src/channel.tsx index 9e5ffebe..f68dd54a 100644 --- a/apps/app/src/channel.tsx +++ b/apps/app/src/channel.tsx @@ -197,7 +197,7 @@ const pulls = new Map(); /** * The newest pull request from the chat's branch, read again while its channel is shown, since the * chat surfaces failed checks with the details sidebar closed. Opening a pull request doesn't move - * the head, so a run ending reads it again too. + * the head, so a run ending reads it again too, as does the window regaining focus. */ function usePull( repo: string | undefined, @@ -221,9 +221,11 @@ function usePull( ); void read(); const timer = setInterval(read, settling ? SETTLING : PULL); + window.addEventListener("focus", read); return () => { active = false; clearInterval(timer); + window.removeEventListener("focus", read); }; }, [repo, branch, head, busy, settling]); return key ? pulls.get(key) : undefined; diff --git a/packages/ui/src/components/session-details/session-details.tsx b/packages/ui/src/components/session-details/session-details.tsx index b110ee5a..d698f9ee 100644 --- a/packages/ui/src/components/session-details/session-details.tsx +++ b/packages/ui/src/components/session-details/session-details.tsx @@ -1,4 +1,11 @@ -import { type ComponentType, type ReactNode, useId, useState } from "react"; +import { + type ComponentType, + type ReactNode, + useId, + useLayoutEffect, + useRef, + useState, +} from "react"; import { IconBranch, @@ -246,6 +253,45 @@ function CreatePr({ creating, onCreate, onDraft }: { ); } +/** Clamped to four lines, with Show more only while the text doesn't fit. */ +function Summary({ text }: { text: string }) { + const [open, setOpen] = useState(false); + const [long, setLong] = useState(false); + const ref = useRef(null); + useLayoutEffect(() => { + const node = ref.current; + if (!node || open) return; + const measure = () => setLong(node.scrollHeight > node.clientHeight); + measure(); + const observer = new ResizeObserver(measure); + observer.observe(node); + return () => observer.disconnect(); + }, [text, open]); + return ( + <> +

+ {text} +

+ {(long || open) && ( + + )} + + ); +} + function Pull({ pull }: { pull: DetailsPull }) { const [Icon, color] = PULL_ICONS[pull.state]; const failed = pull.checks.some((check) => check.state === "failed"); @@ -316,9 +362,7 @@ export function SessionDetailsView( -

- {summary || "No summary yet."} -

+ {(changes || branch || pull !== undefined) && ( From 5e1145cb5fcc53b4de2362f8169940aca2b1dac6 Mon Sep 17 00:00:00 2001 From: iamnbutler Date: Fri, 23 Oct 2026 08:33:58 -0400 Subject: [PATCH 2/2] chore: confirm the usePull note --- ...M53CAJNHYEWYBZVCK2RXYEES-the-pull-request-is-read-whi.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.lane/memory/apps/app/src/channel.tsx/01M53CAJNHYEWYBZVCK2RXYEES-the-pull-request-is-read-whi.md b/.lane/memory/apps/app/src/channel.tsx/01M53CAJNHYEWYBZVCK2RXYEES-the-pull-request-is-read-whi.md index 0cbd1203..594d7295 100644 --- a/.lane/memory/apps/app/src/channel.tsx/01M53CAJNHYEWYBZVCK2RXYEES-the-pull-request-is-read-whi.md +++ b/.lane/memory/apps/app/src/channel.tsx/01M53CAJNHYEWYBZVCK2RXYEES-the-pull-request-is-read-whi.md @@ -4,9 +4,9 @@ anchor: function usePull created: 2026-10-16T22:11:37Z norm: '1' sig: a9da5d18c3817c7c -body_hash: 745f3ff60655c30b -raw_hash: e2e769d80fa9b661 -vouched: 2026-10-22T16:53:07Z +body_hash: 64fb1617a63f2e44 +raw_hash: e9ed5de066837849 +vouched: 2026-10-23T12:33:55Z lines: 191-218 ---