Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/issue-evidence/10722-uiux-deep-qa-sweep/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Deep UI/UX QA sweep — chat, launcher, home, notifications, state (2026-07-01)

Adversarially-verified QA of the develop chat/launcher/home surfaces: 6 parallel
deep reviewers + per-finding refutation agents (20 findings confirmed, several
refuted), the full `packages/ui` vitest battery, and all boot-free real-Chromium
e2e runners. This bundle carries the post-fix captures for the batch landed with
it (see the commit message for the full finding list).

## What was run (all real, local, headless Chromium + jsdom)

- `packages/ui` vitest battery: shell + pages + state + widgets + conversations
+ chat — **1908 tests, all green** (12 initial timeouts reproduced as pure
machine-load flakes: 127/127 green when re-run isolated).
- Boot-free e2e runners (real Chromium, real input, screenshots + webm):
chatux-gesture, chat-sheet (51 screenshots), conversation-swipe, bottombar,
chat-ambient, chat-sheet-frame-glitch, launcher, background, tutorial,
view-lifecycle, ftu-home, home-screen — **all passing after this batch**.
- Two runner failures root-caused to STALE HARNESSES (not product bugs), fixed:
chat-sheet keyboard velocity race; launcher fixture eaten by the #10800
seeded dock (23 undocked tiles ≤ 1 page).

## Artifacts

| file | proves |
|------|--------|
| `home-desktop-postfix.png` | home dashboard, desktop viewport, post-fix |
| `home-mobile-postfix.png` | home dashboard, mobile viewport, post-fix |
| `launcher-mobile-dock-postfix.png` | seeded chat+settings dock + paged grid |
| `launcher-walkthrough-postfix.webm` | real-input launcher walkthrough: launch, edit-mode, page swipe (telemetry 0→2) |
| `home-launcher-flow-postfix.webm` | home→launcher rail flow incl. developer page |
| `chat-sheet-keyboard-postfix.png` | chat sheet at FULL with keyboard open (the fixed assertion) |

Companion per-view captures regenerate deterministically via
`bun run packages/ui/src/components/**/__e2e__/run-*.mjs`.

## Full-app audit (post-fix, this branch)

`bun run --cwd packages/app audit:app` — **349/349 view×viewport combos passed;
broken=0, needs-work=0, needs-eyeball=212, good=136, minimalism-budget-failures=0**
(the audit walks every builtin + plugin view at mobile-portrait, mobile-landscape,
desktop-landscape, and ipad-portrait). Curated captures:

| file | view |
|------|------|
| `audit-chat-desktop.png` / `audit-chat-mobile.png` | chat view, desktop + mobile |
| `audit-settings-desktop.png` / `audit-settings-mobile.png` | settings view (incl. new Background section entry) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
26 changes: 20 additions & 6 deletions packages/ui/src/components/chat/widgets/notifications.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import type { AgentNotification } from "@elizaos/core";
import { Bell } from "lucide-react";
import { categoryIcon } from "../../../state/notifications/category-icon";
import { useNotifications } from "../../../state/notifications/notification-store";
import {
isSafeDeepLink,
navigateDeepLink,
} from "../../../state/notifications/navigate-deep-link";
import {
markNotificationRead,
useNotifications,
} from "../../../state/notifications/notification-store";
import { rankHomeNotifications } from "../../../widgets/home-priority";
import type { WidgetProps } from "../../../widgets/types";
import { HomeWidgetCard, useWidgetNavigation } from "./home-widget-card";
Expand Down Expand Up @@ -78,11 +85,18 @@ export function NotificationsWidget(props: WidgetProps) {
tone={urgent ? "danger" : top.priority === "high" ? "warn" : "default"}
testId="widget-notifications"
ariaLabel={`Notifications: ${unreadCount} unread, latest ${top.title}. Open inbox.`}
onActivate={() =>
top.deepLink
? nav.openView(top.deepLink, "inbox")
: nav.openView("/inbox", "inbox")
}
onActivate={() => {
// Mirror NotificationCenter's row behavior exactly: mark read, then
// navigate through the scheme-checked deep-link helper (deepLink is
// producer/LLM-influenceable — raw pushState both broke https links
// and skipped the safety allowlist). Unsafe/missing → inbox.
if (!top.readAt) void markNotificationRead(top.id);
if (top.deepLink && isSafeDeepLink(top.deepLink)) {
navigateDeepLink(top.deepLink);
} else {
nav.openView("/inbox", "inbox");
}
}}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
// @vitest-environment jsdom

// Touch tap-vs-scroll discrimination for the composite ChatMessage's
// tap-to-reveal action rail (copy/edit/play/delete). On non-hover devices the
// whole <article> toggles the rail on touchend; without move-slop tracking a
// flick-scroll over the transcript toggled the rail on whichever message the
// finger started on. The fix mirrors the shell ThreadLine: finger travel past
// the slop (TAP_REVEAL_MOVE_CANCEL_PX) cancels the toggle, and an active
// (non-collapsed) text selection suppresses it so ending a highlight drag
// never also flips the rail.

import { cleanup, fireEvent, render, screen } from "@testing-library/react";
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";

import { ChatMessage } from "./chat-message";
import type { ChatMessageData } from "./chat-types";

beforeAll(() => {
// Simulate a touch-only device: the hover media query must NOT match so the
// tap-to-reveal path (not mouse hover) drives the action rail. Installed
// before the first render because ChatMessage caches the MediaQueryList.
window.matchMedia = vi.fn().mockImplementation((query: string) => ({
matches: false,
media: query,
onchange: null,
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
addListener: vi.fn(),
removeListener: vi.fn(),
dispatchEvent: vi.fn(),
}));
});

afterEach(() => {
window.getSelection()?.removeAllRanges();
cleanup();
});

function makeMessage(
overrides: Partial<ChatMessageData> = {},
): ChatMessageData {
return {
id: "msg-1",
role: "assistant",
text: "Here are your latest balances.",
...overrides,
};
}

function getArticle(): HTMLElement {
return screen.getByTestId("chat-message");
}

/**
* The rail's visibility is carried by an opacity class on the wrapper around
* ChatMessageActions (opacity-100 shown, opacity-0 hidden) — walk up from the
* always-rendered Copy button to read it.
*/
function railVisible(): boolean {
let el: HTMLElement | null = screen.getByLabelText("Copy message");
while (el) {
if (el.classList.contains("opacity-100")) return true;
if (el.classList.contains("opacity-0")) return false;
el = el.parentElement;
}
throw new Error("action-rail visibility wrapper not found");
}

function touchPoint(clientX: number, clientY: number) {
return { clientX, clientY };
}

describe("ChatMessage tap-to-reveal vs transcript scroll", () => {
it("a clean tap toggles the action rail on and off", () => {
render(<ChatMessage message={makeMessage()} onCopy={vi.fn()} />);
const article = getArticle();
expect(railVisible()).toBe(false);

// Tap with negligible travel (within the slop) reveals the rail.
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(52, 103)] });
expect(railVisible()).toBe(true);

// A second clean tap hides it again.
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(50, 100)] });
expect(railVisible()).toBe(false);
});

it("a scroll-like touch (travel past the slop) does NOT toggle the rail", () => {
render(<ChatMessage message={makeMessage()} onCopy={vi.fn()} />);
const article = getArticle();

// Vertical flick — the transcript scroll gesture.
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(50, 180)] });
expect(railVisible()).toBe(false);

// Horizontal drag past the slop is not a tap either.
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(90, 100)] });
expect(railVisible()).toBe(false);

// Once revealed by a clean tap, a scroll must not hide it either.
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(50, 100)] });
expect(railVisible()).toBe(true);
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(50, 20)] });
expect(railVisible()).toBe(true);
});

it("an active text selection suppresses the toggle; clearing it restores taps", () => {
render(<ChatMessage message={makeMessage()} onCopy={vi.fn()} />);
const article = getArticle();

// Highlight the bubble text (a non-collapsed selection), as a finished
// press-drag-select leaves behind.
const bubbleText = screen.getByText("Here are your latest balances.");
const range = document.createRange();
range.selectNodeContents(bubbleText);
const selection = window.getSelection();
if (!selection) throw new Error("jsdom selection unavailable");
selection.removeAllRanges();
selection.addRange(range);
expect(selection.isCollapsed).toBe(false);

// The tap that ends the highlight must not also flip the rail.
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(50, 100)] });
expect(railVisible()).toBe(false);

// With the selection cleared, tapping works again.
selection.removeAllRanges();
fireEvent.touchStart(article, { touches: [touchPoint(50, 100)] });
fireEvent.touchEnd(article, { changedTouches: [touchPoint(50, 100)] });
expect(railVisible()).toBe(true);
});
});
33 changes: 33 additions & 0 deletions packages/ui/src/components/composites/chat/chat-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export interface ChatMessageProps {
}

const HOVER_MEDIA_QUERY = "(hover: hover) and (pointer: fine)";
// Tap-to-reveal move slop: finger travel past this between touchstart and
// touchend means the gesture was a transcript scroll, not a tap, so it must
// not toggle the action rail (mirrors the shell ThreadLine's
// COPY_MOVE_CANCEL_PX).
const TAP_REVEAL_MOVE_CANCEL_PX = 10;
const hoverSupportListeners = new Set<() => void>();
let hoverMediaQuery: MediaQueryList | null = null;
let hoverMediaQueryUnsubscribe: (() => void) | null = null;
Expand Down Expand Up @@ -323,6 +328,7 @@ export const ChatMessage = memo(function ChatMessage({
const [savingEdit, setSavingEdit] = useState(false);
const articleRef = useRef<HTMLElement | null>(null);
const editTextareaRef = useRef<HTMLTextAreaElement | null>(null);
const tapStartRef = useRef<{ x: number; y: number } | null>(null);
const isUser = message.role === "user";
const isRightAligned = isUser ? userMessagesOnRight : !userMessagesOnRight;
const canEdit =
Expand Down Expand Up @@ -421,13 +427,39 @@ export const ChatMessage = memo(function ChatMessage({
}
}, [draftText, message.id, message.text, onEdit]);

const handleTapStart = useCallback((event: TouchEvent<HTMLElement>) => {
const touch = event.touches[0];
tapStartRef.current = touch ? { x: touch.clientX, y: touch.clientY } : null;
}, []);

const handleTapReveal = useCallback(
(event: TouchEvent<HTMLElement>) => {
const tapStart = tapStartRef.current;
tapStartRef.current = null;
if (supportsHover || isEditing) return;
const target = event.target as HTMLElement | null;
if (target?.closest("button, a, textarea, input")) {
return;
}
// Scroll, not tap: finger travel past the slop means the touch was a
// transcript flick, so it must not toggle the rail on whichever message
// it happened to start on (mirrors the shell ThreadLine).
const touch = event.changedTouches[0];
if (
tapStart &&
touch &&
(Math.abs(touch.clientX - tapStart.x) > TAP_REVEAL_MOVE_CANCEL_PX ||
Math.abs(touch.clientY - tapStart.y) > TAP_REVEAL_MOVE_CANCEL_PX)
) {
return;
}
// Never hijack a text selection: a tap that ends a highlight drag must
// not also toggle the rail (the bubble text stays selectable to copy).
const selection =
typeof window !== "undefined" ? window.getSelection() : null;
if (selection && !selection.isCollapsed) {
return;
}
setShowActions((prev) => !prev);
},
[isEditing, supportsHover],
Expand Down Expand Up @@ -510,6 +542,7 @@ export const ChatMessage = memo(function ChatMessage({
data-role={message.role}
onMouseEnter={supportsHover ? () => setShowActions(true) : undefined}
onMouseLeave={supportsHover ? () => setShowActions(false) : undefined}
onTouchStart={handleTapStart}
onTouchEnd={handleTapReveal}
aria-label={`${
isUser && showSenderHeader
Expand Down
18 changes: 8 additions & 10 deletions packages/ui/src/components/conversations/ConversationsSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ export function ConversationsSidebar({

const handleNewChat = () => {
setState("activeInboxChat", null);
// Mirror handleRowSelect's conversation branch: an active terminal session
// otherwise keeps rendering over the fresh conversation (ChatView prefers
// the terminal branch), making "New chat" look dead.
setState("activeTerminalSessionId", null);
setTab("chat");
void handleNewConversation();
onClose?.();
Expand Down Expand Up @@ -804,16 +808,10 @@ export function ConversationsSidebar({
collapseButtonAriaLabel={t("aria.closePanel")}
expandButtonAriaLabel={t("aria.expandChatsPanel")}
collapsedRailAction={
showNewTerminalAction ? (
<SidebarCollapsedActionButton
aria-label={t("conversations.newTerminal", {
defaultValue: "New terminal",
})}
onClick={() => void spawnShell()}
>
<Plus className="h-4 w-4" />
</SidebarCollapsedActionButton>
) : showNewChatAction ? (
// Chat-first: the single collapsed-rail "+" always starts a new
// CHAT. New terminal stays reachable from the expanded terminal
// section header — a shell session is never the primary affordance.
showNewChatAction ? (
<SidebarCollapsedActionButton
aria-label={t("conversations.newChat")}
onClick={handleNewChat}
Expand Down
Loading
Loading