fix(frontend): expand empty-state watermark to full cell and tint monochrome project icons by project color — #351 (QA verte)
Cause: the empty-state watermark filled only 92% of a centered box and kept residual palette colors from host emoji fonts, non-compliant with the monochrome-first project icon rule (#351 user capture). Fix: illustration spans the cell with 6px/4px insets and an unclipped glyph at min(88cqw, 88cqh); emoji painted as monochrome silhouettes via transparent fill + zero-offset text-shadow tint (--project-illustration-tint) derived from accessibleProjectAccent when a project color exists, neutral muted fallback otherwise; empty label anchored bottom-center and hidden first on constrained containers (@container 280px width / 240px height); overlay priorities, composer and z-layering untouched. QA verte reconfirmée par Git: npm test -- CustomAgentChatView.test.tsx 80/80, git diff --check; QA: ProjectSettingsPanel 12/12, typecheck, build OK (warning Vite chunk >500 kB préexistant). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -212,16 +212,19 @@ describe("CustomAgentChatView", () => {
|
||||
const watermark = await screen.findByTestId("project-icon-watermark");
|
||||
expect(watermark.style.pointerEvents).toBe("none");
|
||||
expect(watermark.getAttribute("aria-hidden")).toBe("true");
|
||||
expect((watermark.firstElementChild as HTMLElement | null)?.style.width).toBe("92%");
|
||||
expect((watermark.firstElementChild as HTMLElement | null)?.style.height).toBe("92%");
|
||||
expect(watermark.className).toContain("project-cell-illustration");
|
||||
expect((watermark.firstElementChild as HTMLElement | null)?.style.width).toBe("100%");
|
||||
expect((watermark.firstElementChild as HTMLElement | null)?.style.height).toBe("100%");
|
||||
expect((watermark.firstElementChild as HTMLElement | null)?.className).toContain("project-cell-illustration__glyph");
|
||||
expect(watermark.textContent).toBe("🐍\uFE0E");
|
||||
expect(watermark.dataset.colorMode).toBe("monochrome");
|
||||
expect(watermark.style.getPropertyValue("--project-illustration-tint")).toBe("var(--color-muted, #9aa7b4)");
|
||||
publishProjectIconChanged({ projectId: "project-1", icon: { set: "emoji", name: "star" } });
|
||||
await waitFor(() => expect(watermark.textContent).toBe("⭐\uFE0E"));
|
||||
publishProjectThemeChanged({ projectId: "project-1", themeColor: "#7c3aed" });
|
||||
await waitFor(() => {
|
||||
expect(watermark.dataset.colorMode).toBe("project");
|
||||
expect(watermark.style.color).toBe("rgb(124, 58, 237)");
|
||||
expect(watermark.style.getPropertyValue("--project-illustration-tint")).toBe("#945DF0");
|
||||
});
|
||||
expect(screen.getByTestId("custom-agent-chat-scroll").className).toContain("z-10");
|
||||
expect(screen.getByTestId("custom-agent-chat-composer").className).toContain("bg-raised/40");
|
||||
|
||||
@ -15,6 +15,7 @@ import {
|
||||
useRef,
|
||||
useState,
|
||||
type ClipboardEvent,
|
||||
type CSSProperties,
|
||||
type KeyboardEvent,
|
||||
type MouseEvent as ReactMouseEvent,
|
||||
type RefObject,
|
||||
@ -45,7 +46,11 @@ import {
|
||||
} from "@/features/projects/projectCliInteractionActivity";
|
||||
import { Button, EntryTimestamp, Spinner, cn, normalizeTimestamp } from "@/shared";
|
||||
import { onProjectIconChanged, ProjectIcon } from "@/features/projects/projectIcons";
|
||||
import { onProjectThemeChanged, validThemeColor } from "@/features/projects/projectTheme";
|
||||
import {
|
||||
accessibleProjectAccent,
|
||||
onProjectThemeChanged,
|
||||
validThemeColor,
|
||||
} from "@/features/projects/projectTheme";
|
||||
import type {
|
||||
ChatAttachmentInput,
|
||||
ChatDraftScope,
|
||||
@ -2504,26 +2509,28 @@ export function CustomAgentChatView({
|
||||
<div
|
||||
ref={chatRootRef}
|
||||
data-testid="custom-agent-chat-view"
|
||||
className="relative z-0 flex h-full min-h-0 flex-col overflow-hidden bg-surface text-content"
|
||||
className="custom-agent-chat-view relative z-0 flex h-full min-h-0 flex-col overflow-hidden bg-surface text-content"
|
||||
>
|
||||
<div
|
||||
data-testid="project-icon-watermark"
|
||||
data-color-mode={projectThemeColor ? "project" : "monochrome"}
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 z-0 flex items-center justify-center overflow-hidden text-content opacity-[0.055]"
|
||||
className="project-cell-illustration pointer-events-none absolute z-0 flex items-center justify-center overflow-hidden"
|
||||
style={{
|
||||
pointerEvents: "none",
|
||||
containerType: "size",
|
||||
color: projectThemeColor ?? undefined,
|
||||
}}
|
||||
"--project-illustration-tint": projectThemeColor
|
||||
? accessibleProjectAccent(projectThemeColor)
|
||||
: "var(--color-muted, #9aa7b4)",
|
||||
} as CSSProperties}
|
||||
>
|
||||
<ProjectIcon
|
||||
icon={projectIcon}
|
||||
fallbackLabel={projectFallbackLabel}
|
||||
surface="watermark"
|
||||
size="92%"
|
||||
size="100%"
|
||||
decorative
|
||||
style={{ fontSize: "min(34cqw, 34cqh)", maxWidth: "92cqh", maxHeight: "92cqw" }}
|
||||
className="project-cell-illustration__glyph"
|
||||
style={{ fontSize: "min(88cqw, 88cqh)" }}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@ -2727,7 +2734,7 @@ export function CustomAgentChatView({
|
||||
</div>
|
||||
</div>
|
||||
) : displayTurns.length === 0 ? (
|
||||
<p className="m-auto text-xs text-muted">
|
||||
<p className="project-cell-empty-label text-xs text-muted">
|
||||
{t("custom.empty")}
|
||||
</p>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user