Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(chat): keep jump control neutral

Louis Beaumont41837a425940
diff --git a/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.test.tsx b/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.test.tsx
index 19b83d7ad..36ef86b6a 100644
--- a/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.test.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.test.tsx
@@ -13,7 +13,6 @@ function renderJump(overrides: Partial<ComponentProps<typeof ChatJumpToLatest>>
<ChatJumpToLatest
hasMessages
scrolledUp
- live={false}
onJump={onJump}
{...overrides}
/>,
@@ -47,25 +46,14 @@ describe("ChatJumpToLatest", () => {
expect(button.className).toContain("rounded-none");
expect(button.className).toContain("shadow-none");
expect(button.className).not.toContain("transition-opacity");
- expect(button).toHaveAttribute("data-live", "false");
fireEvent.click(button);
expect(onJump).toHaveBeenCalledOnce();
});
- it("marks phosphor only while a turn is live and the user is above the latest", () => {
- const { rerender } = renderJump({ live: true, scrolledUp: true });
- expect(screen.getByTestId("chat-jump-to-latest")).toHaveAttribute("data-live", "true");
- expect(screen.getByTestId("chat-jump-to-latest").className).toContain("border-phosphor");
-
- rerender(
- <ChatJumpToLatest
- hasMessages
- scrolledUp={false}
- live
- onJump={vi.fn()}
- />,
- );
- expect(screen.getByTestId("chat-jump-to-latest")).toHaveAttribute("data-live", "false");
- expect(screen.getByTestId("chat-jump-to-latest").className).not.toContain("border-phosphor");
+ it("uses a neutral color because jumping is navigation, not execution", () => {
+ renderJump();
+ const button = screen.getByTestId("chat-jump-to-latest");
+ expect(button.className).toContain("border-foreground/50");
+ expect(button.className).not.toContain("phosphor");
});
});
diff --git a/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.tsx b/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.tsx
index 30b3b16e8..cfe71ac97 100644
--- a/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/standalone/chat-jump-to-latest.tsx
@@ -9,28 +9,23 @@ import { cn } from "@/lib/utils";
export interface ChatJumpToLatestProps {
hasMessages: boolean;
scrolledUp: boolean;
- /** True while a turn is still running. Phosphor is live execution only. */
- live: boolean;
onJump: () => void;
}
export function ChatJumpToLatest({
hasMessages,
scrolledUp,
- live,
onJump,
}: ChatJumpToLatestProps) {
if (!hasMessages) return null;
const visible = scrolledUp;
- const liveVisible = live && visible;
return (
<div className="pointer-events-none absolute inset-x-0 top-0 z-20 h-0">
<button
type="button"
data-testid="chat-jump-to-latest"
- data-live={liveVisible ? "true" : "false"}
aria-label="Jump to latest"
aria-hidden={!visible}
tabIndex={visible ? 0 : -1}
@@ -39,9 +34,7 @@ export function ChatJumpToLatest({
"absolute left-1/2 bottom-2 flex h-8 w-8 -translate-x-1/2 items-center justify-center rounded-none border bg-background text-foreground shadow-none",
"hover:bg-foreground hover:text-background",
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground",
- liveVisible
- ? "border-phosphor text-phosphor hover:bg-phosphor hover:text-phosphor-ink"
- : "border-foreground/50",
+ "border-foreground/50",
visible ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0",
)}
>
diff --git a/apps/screenpipe-app-tauri/components/chat/standalone/composer-types.ts b/apps/screenpipe-app-tauri/components/chat/standalone/composer-types.ts
index 60a65e5a3..1a9d7c221 100644
--- a/apps/screenpipe-app-tauri/components/chat/standalone/composer-types.ts
+++ b/apps/screenpipe-app-tauri/components/chat/standalone/composer-types.ts
@@ -192,7 +192,6 @@ export interface ComposerConnectBannerProps {
export interface ComposerJumpToLatestProps {
hasMessages: boolean;
scrolledUp: boolean;
- live: boolean;
onJump: () => void;
}
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 1a04f888a..f9c5a0600 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -2204,7 +2204,6 @@ export function StandaloneChat({
jumpToLatest={{
hasMessages: messages.length > 0,
scrolledUp: isUserScrolledUp,
- live: isLoading || isStreaming,
onJump: scrollToBottom,
}}
prefill={{
diff --git a/apps/screenpipe-app-tauri/e2e/specs/chat-jump-to-latest.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/chat-jump-to-latest.spec.ts
index ce4d25be5..1ade41957 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/chat-jump-to-latest.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/chat-jump-to-latest.spec.ts
@@ -34,7 +34,6 @@ type JumpMetrics = {
composerTop: number;
ariaHidden: string | null;
ariaLabel: string | null;
- live: string | null;
label: string;
};
@@ -151,7 +150,6 @@ async function readJumpMetrics(): Promise<JumpMetrics | null> {
composerTop: composerRect?.top ?? rect.bottom,
ariaHidden: button.getAttribute("aria-hidden"),
ariaLabel: button.getAttribute("aria-label"),
- live: button.getAttribute("data-live"),
label: (button.textContent ?? "").replace(/\s+/g, " ").trim(),
};
})) as JumpMetrics | null;
@@ -234,7 +232,6 @@ describe("chat jump to latest", function () {
const atBottom = await waitForJumpState(false);
expect(atBottom.label).toBe("");
expect(atBottom.ariaLabel).toBe("Jump to latest");
- expect(atBottom.live).toBe("false");
expect(atBottom.borderRadius).toBe("0px");
expect(await $('[data-testid="chat-new-content"]').isExisting()).toBe(false);
await saveScreenshot("chat-jump-to-latest-at-bottom");
@@ -249,7 +246,6 @@ describe("chat jump to latest", function () {
const composerGap = scrolledUp.composerTop - scrolledUp.bottom;
expect(composerGap).toBeGreaterThanOrEqual(4);
expect(composerGap).toBeLessThanOrEqual(16);
- expect(scrolledUp.live).toBe("false");
await saveScreenshot("chat-jump-to-latest-scrolled-up");
const jump = await $('[data-testid="chat-jump-to-latest"]');