Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 0 additions & 22 deletions .github/social-preview-brand.svg

This file was deleted.

Binary file modified .github/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/desktop/build/icon-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/desktop/build/icon.icns
Binary file not shown.
29 changes: 20 additions & 9 deletions apps/desktop/build/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions apps/desktop/src/electron-version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,17 @@ describe("desktop Electron runtime", () => {
expect(readFileSync(iconUrl).subarray(0, 4).toString("ascii")).toBe("icns");
});

it("uses a full-size centered Clash C desktop icon source", () => {
it("uses a full-size centered desktop icon source", () => {
const iconSvg = readFileSync(
new URL("../build/icon.svg", import.meta.url),
"utf8",
);

expect(iconSvg).toContain('viewBox="0 0 1024 1024"');
expect(iconSvg).toContain('rx="216"');
expect(iconSvg).toContain('aria-label="Clash C app icon"');
expect(iconSvg).toContain('stroke="#FF6B50"');
expect(iconSvg).not.toMatch(/<ellipse|agent|face/i);
expect(iconSvg).toContain(
"translate(512 512) scale(0.86) translate(-636 -601)",
);
});

it("injects the desktop runtime mode into the renderer", () => {
Expand Down
43 changes: 43 additions & 0 deletions apps/web/app/agent-logo-contract.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";

const repoRoot = join(import.meta.dirname, "../../..");

const readRepoFile = (path: string) =>
readFileSync(join(repoRoot, path), "utf8");

describe("Clash agent logo contract", () => {
it("uses the chatbot avatar for the packaged desktop application", () => {
const source = readRepoFile("apps/desktop/build/icon.svg");

expect(source).toContain('aria-label="Clash app icon"');
expect(source.match(/<ellipse/g)).toHaveLength(2);
expect(source).toContain('stroke="#171412"');
expect(source).toContain('fill="#FF6B50"');
expect(source).not.toContain("Clash C app icon");
});

it("uses the chatbot avatar across browser and product logo surfaces", () => {
const favicon = readRepoFile("apps/web/public/favicon.svg");
const mark = readRepoFile("apps/web/public/brand/logo-mark.svg");
const html = readRepoFile("apps/web/index.html");
const consumers = [
"apps/web/app/root.tsx",
"apps/web/app/routes/login.tsx",
"packages/web-ui/src/components/ProjectsClient.tsx",
"packages/web-ui/src/components/SettingsClient.tsx",
"packages/web-ui/src/components/TopNavigation.tsx",
]
.map(readRepoFile)
.join("\n");

expect(favicon).toBe(mark);
expect(mark.match(/<ellipse/g)).toHaveLength(2);
expect(mark).toContain("#FF6B50");
expect(html).toContain('href="/favicon.svg"');
expect(html).not.toContain('href="/favicon-c.svg"');
expect(consumers).toContain("/brand/logo-mark.svg");
expect(consumers).not.toContain("/brand/logo-c");
});
});
67 changes: 0 additions & 67 deletions apps/web/app/brand-assets.test.ts

This file was deleted.

18 changes: 0 additions & 18 deletions apps/web/app/root-route-primitives.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ describe("root route primitives", () => {
expect(sitemap).not.toContain("/login");
});

it("publishes cache-busted Clash C install icons", () => {
const html = readFileSync(
new URL("../index.html", import.meta.url),
"utf8",
);
const webManifest = JSON.parse(
readFileSync(new URL("../public/site.webmanifest", import.meta.url), "utf8"),
) as { icons?: Array<{ src?: string }> };

expect(html).toContain('href="/favicon-c.svg"');
expect(html).toContain('href="/apple-touch-icon-c.png"');
expect(webManifest.icons?.map((icon) => icon.src)).toEqual([
"/icon-c-192.png",
"/icon-c-512.png",
"/maskable-icon-c-512.png",
]);
});

it("keeps the desktop runtime callout legible in dark mode", () => {
const css = readFileSync(new URL("./globals.css", import.meta.url), "utf8");

Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function ErrorBoundary() {

<section className="relative w-full max-w-xl">
<div className="mb-8 flex items-center gap-3">
<img src="/brand/logo-c-error.svg" alt="Clash" className="h-11 w-11" />
<img src="/brand/logo-mark-error.svg" alt="Clash" className="h-11 w-11" />
<div>
<p className="text-xs font-semibold uppercase tracking-[0.18em] text-brand">Route paused</p>
<h1 className="font-display text-3xl font-bold tracking-tight sm:text-4xl">
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ export default function LoginRoute() {
>
<span className="relative block h-10 w-10">
<img
src="/brand/logo-c.svg"
src="/brand/logo-mark.svg"
alt=""
className="h-10 w-10 object-contain dark:hidden"
draggable={false}
/>
<img
src="/brand/logo-c.svg"
src="/brand/logo-mark-dark.svg"
alt=""
className="hidden h-10 w-10 object-contain dark:block"
draggable={false}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/theme-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ describe("application theme contract", () => {
expect(css).toMatch(
/\.dark \.clash-copilot-launcher \.clash-agent-motion__pen\s*\{[\s\S]*?fill: #ff6b50/,
);
expect(topNavigation).toContain('/brand/logo-c.svg');
expect(topNavigation).toContain('/brand/logo-mark-dark.svg');
expect(topNavigation).not.toContain("dark:grayscale");
});

Expand Down Expand Up @@ -333,7 +333,7 @@ describe("application theme contract", () => {
expect(login).toContain("dark:text-neutral-50");
expect(login).toContain("dark:text-neutral-100");
expect(login).toContain("dark:placeholder:text-neutral-500");
expect(login).toContain('/brand/logo-c.svg');
expect(login).toContain('/brand/logo-mark-dark.svg');
});

it("exposes Appearance as a real persisted settings section", () => {
Expand Down
5 changes: 2 additions & 3 deletions apps/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon-c.svg" />
<link rel="alternate icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-c.png" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="canonical" href="https://clash.video/" />
<meta
Expand Down
15 changes: 0 additions & 15 deletions apps/web/public/_headers
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,18 @@
/favicon.svg
Cache-Control: public, max-age=86400

/favicon-c.svg
Cache-Control: public, max-age=86400

/apple-touch-icon.png
Cache-Control: public, max-age=86400

/apple-touch-icon-c.png
Cache-Control: public, max-age=86400

/icon-192.png
Cache-Control: public, max-age=86400

/icon-c-192.png
Cache-Control: public, max-age=86400

/icon-512.png
Cache-Control: public, max-age=86400

/icon-c-512.png
Cache-Control: public, max-age=86400

/maskable-icon-512.png
Cache-Control: public, max-age=86400

/maskable-icon-c-512.png
Cache-Control: public, max-age=86400

/og-image.png
Cache-Control: public, max-age=86400

Expand Down
Binary file removed apps/web/public/apple-touch-icon-c.png
Binary file not shown.
Binary file modified apps/web/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions apps/web/public/brand/logo-c-animated.svg

This file was deleted.

10 changes: 0 additions & 10 deletions apps/web/public/brand/logo-c-error.svg

This file was deleted.

10 changes: 0 additions & 10 deletions apps/web/public/brand/logo-c.svg

This file was deleted.

35 changes: 28 additions & 7 deletions apps/web/public/brand/logo-lockup-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading