Skip to content

Your team of AI agents, on your Mac, Windows or Linux. Agents that talk in channels, write code, review each other and use your tools, on the Claude Code, Codex, OpenCode or Pi you already have. Anything that touches the real world waits for your yes.

Keep the thread panel inside its bounds, and add a way back to the end (#107)

Cleiton Salvagnif5b409712309
diff --git a/src/renderer/src/components/Conversation.tsx b/src/renderer/src/components/Conversation.tsx
index 5efe806..91ab8e3 100644
--- a/src/renderer/src/components/Conversation.tsx
+++ b/src/renderer/src/components/Conversation.tsx
@@ -192,6 +192,7 @@ const NO_REPLIES: Message[] = []
export function MessageList({ messages: all, conversationId, empty, focus, threads, lead }: { messages: Message[]; conversationId: string; empty?: boolean; focus?: string; threads?: boolean; lead?: ReactNode }): ReactNode {
const ref = useRef<HTMLDivElement>(null)
const stick = useRef(true)
+ const [farFromBottom, setFarFromBottom] = useState(false)
const { messages, replies } = useMemo(() => {
if (!threads) return { messages: all, replies: undefined }
const replies = new Map<string, Message[]>()
@@ -224,6 +225,7 @@ export function MessageList({ messages: all, conversationId, empty, focus, threa
useEffect(() => {
if (!lead) stick.current = true
+ setFarFromBottom(false)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [conversationId])
@@ -279,7 +281,9 @@ export function MessageList({ messages: all, conversationId, empty, focus, threa
ref={ref}
onScroll={(e) => {
const el = e.currentTarget
- stick.current = el.scrollHeight - el.scrollTop - el.clientHeight < 60
+ const fromBottom = el.scrollHeight - el.scrollTop - el.clientHeight
+ stick.current = fromBottom < 60
+ setFarFromBottom(fromBottom > el.clientHeight / 2)
}}
>
{lead}
@@ -295,6 +299,13 @@ export function MessageList({ messages: all, conversationId, empty, focus, threa
m.author.kind !== 'routine'
return <MessageRow key={m.id} message={m} grouped={grouped} replies={replies && (replies.get(m.id) ?? NO_REPLIES)} />
})}
+ {farFromBottom && (
+ <div className="messages__jump">
+ <button className="messages__jump-btn" title={L('Ir para o fim', 'Go to the end')} aria-label={L('Ir para o fim da conversa', 'Go to the end of the conversation')} onClick={() => ref.current?.scrollTo({ top: ref.current.scrollHeight, behavior: 'smooth' })}>
+ <Icon name="down" size={15} />
+ </button>
+ </div>
+ )}
</div>
)
}
diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.css
index f6b3fff..4a21a55 100644
--- a/src/renderer/src/styles.css
+++ b/src/renderer/src/styles.css
@@ -262,6 +262,9 @@ h3 {
border: 3px solid transparent;
background-clip: content-box;
}
+::-webkit-scrollbar-corner {
+ background: transparent;
+}
/* ---------- layout ---------- */
.app {
@@ -926,6 +929,31 @@ h3 {
overflow-y: auto;
padding: 24px 0 12px;
}
+/* "Go to the end": rides the bottom of the list while you read further up. */
+.messages__jump {
+ position: sticky;
+ bottom: 12px;
+ height: 0;
+ display: flex;
+ justify-content: center;
+}
+.messages__jump-btn {
+ width: 32px;
+ height: 32px;
+ display: grid;
+ place-items: center;
+ transform: translateY(-100%);
+ border-radius: 50%;
+ background: var(--panel);
+ color: var(--text-2);
+ box-shadow: var(--shadow-panel);
+ transition: var(--transition-ui);
+ --pop-y: 0;
+ animation: pop var(--dur-base) var(--ease-out);
+}
+.messages__jump-btn:hover {
+ color: var(--text);
+}
.messages--empty {
display: grid;
place-items: center;
@@ -2493,6 +2521,7 @@ h3 {
/* A router's note: what it did, and why, quietly, on one line. */
.system-line__why {
+ flex: 1 1 0; /* the headline wraps only when it doesn't fit alone; the why takes what's left, or nothing */
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
@@ -2503,7 +2532,7 @@ h3 {
content: '· ';
}
.system-line > p {
- flex-shrink: 0;
+ min-width: 0;
}
.system-line > .muted {
margin-left: auto;