Refine tool call summaries and scrolling (#2069)
* feat(app): refine tool call summaries and scrolling Keep summary groups stable from the first tool call, preserve live activity feedback, and scroll expanded groups to the latest entry. Consolidate web scrollbar styling around the native browser mechanism. * refactor(app): reuse tool call height constant * fix(app): preserve tool call summary state * fix(app): refresh web tool groups on expand * fix(app): preserve grouped tool errors
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export function installWebScrollbarStyles(): () => void {
|
||||
return () => {};
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import {
|
||||
WEB_SCROLLBAR_SIZE_PX,
|
||||
webScrollbarColor,
|
||||
webScrollbarThumbColor,
|
||||
WEB_SCROLLBAR_WIDTH,
|
||||
} from "@/styles/web-scrollbar";
|
||||
|
||||
const STYLE_ID = "paseo-web-scrollbar-styles";
|
||||
|
||||
export function installWebScrollbarStyles(): () => void {
|
||||
const existingStyle = document.getElementById(STYLE_ID);
|
||||
if (existingStyle) return () => {};
|
||||
|
||||
const style = document.createElement("style");
|
||||
style.id = STYLE_ID;
|
||||
style.textContent = `
|
||||
* {
|
||||
scrollbar-color: ${webScrollbarColor("var(--colors-scrollbar-handle)")};
|
||||
scrollbar-width: ${WEB_SCROLLBAR_WIDTH};
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar {
|
||||
width: ${WEB_SCROLLBAR_SIZE_PX}px;
|
||||
height: ${WEB_SCROLLBAR_SIZE_PX}px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track,
|
||||
*::-webkit-scrollbar-corner {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
border: 2px solid transparent;
|
||||
border-radius: 999px;
|
||||
background: ${webScrollbarThumbColor("var(--colors-scrollbar-handle)")};
|
||||
background-clip: content-box;
|
||||
}
|
||||
`;
|
||||
document.head.append(style);
|
||||
|
||||
return () => style.remove();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export const WEB_SCROLLBAR_WIDTH = "thin";
|
||||
export const WEB_SCROLLBAR_SIZE_PX = 8;
|
||||
|
||||
export function webScrollbarThumbColor(handleColor: string): string {
|
||||
return `color-mix(in srgb, ${handleColor} 62%, transparent)`;
|
||||
}
|
||||
|
||||
export function webScrollbarColor(handleColor: string): string {
|
||||
return `${webScrollbarThumbColor(handleColor)} transparent`;
|
||||
}
|
||||
Reference in New Issue
Block a user