дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
feat(agents): Drop Jump to Bottom from the conversation
Цей коміт міститься в:
1 джерело
1117dc4907
коміт
c0179d3309
3 files changed
+1
-29
No files matched your search
@@ -96,7 +96,7 @@
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* The conversation plus what floats over it (find bar, Jump to Bottom). */
|
||||
/* The conversation with its find bar. */
|
||||
.streamArea {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
@@ -157,16 +157,6 @@
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.jumpToBottom {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
bottom: 12px;
|
||||
background: var(--bg-popup);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 50%;
|
||||
box-shadow: var(--shadow-tooltip);
|
||||
}
|
||||
|
||||
.findBar {
|
||||
flex: none;
|
||||
display: flex;
|
||||
|
||||
@@ -164,22 +164,14 @@ interface StreamProps {
|
||||
}
|
||||
|
||||
function Stream({ task, entries, finding, findFocus, onCloseFind }: StreamProps) {
|
||||
const tx = useTx();
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const stick = useRef(true);
|
||||
const [atBottom, setAtBottom] = useState(true);
|
||||
useLayoutEffect(() => {
|
||||
const el = ref.current;
|
||||
if (el && stick.current) el.scrollTop = el.scrollHeight;
|
||||
});
|
||||
const waiting = entries?.some((e) => e.type === "permission" && !e.chosen);
|
||||
const lastUser = entries?.findLast((e): e is UserEntry => e.type === "user");
|
||||
const toBottom = () => {
|
||||
const el = ref.current;
|
||||
if (!el) return;
|
||||
stick.current = true;
|
||||
el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
|
||||
};
|
||||
return (
|
||||
<div className={styles.streamArea}>
|
||||
{finding && <FindBar streamRef={ref} focus={findFocus} onClose={onCloseFind} />}
|
||||
@@ -191,7 +183,6 @@ function Stream({ task, entries, finding, findFocus, onCloseFind }: StreamProps)
|
||||
onScroll={(e) => {
|
||||
const el = e.currentTarget;
|
||||
stick.current = el.scrollHeight - el.scrollTop - el.clientHeight < 40;
|
||||
setAtBottom(stick.current);
|
||||
}}
|
||||
// Copy, plus Quote for a selection: replies to it in the composer.
|
||||
onContextMenu={(e) => {
|
||||
@@ -218,14 +209,6 @@ function Stream({ task, entries, finding, findFocus, onCloseFind }: StreamProps)
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!atBottom && (
|
||||
<IconButton
|
||||
icon="arrow-down"
|
||||
title={tx("Jump to Bottom")}
|
||||
className={styles.jumpToBottom}
|
||||
onClick={toBottom}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4192,7 +4192,6 @@
|
||||
"Cannot load agent tasks": "无法加载智能体任务",
|
||||
"Opening {name}…": "正在打开 {name}…",
|
||||
"Copy Code": "复制代码",
|
||||
"Jump to Bottom": "跳到底部",
|
||||
"Quote": "引用",
|
||||
"Find in Conversation": "在对话中查找",
|
||||
"Find in conversation": "在对话中查找",
|
||||
|
||||
Reference in new issue
Заблокувати користувача