Skip to content
Merged
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
18 changes: 18 additions & 0 deletions client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from "../shared/config";

const client = createClient<typeof app>();
const DEFAULT_DOCUMENT_TITLE = "Codex Artifacts";
const KNOWN_EMAILS_KEY = "codex-artifacts:known-emails";
const EXPIRATION_OPTIONS = [
{ label: "1 hour", value: "3600" },
Expand Down Expand Up @@ -598,6 +599,17 @@ function ArtifactFrame({ requestedSlug }: { requestedSlug?: string }) {
const accessBootstrap = useAccessBootstrap();
const [accessState, setAccessState] = useState<"idle" | "accepting" | "accepted" | "denied">("idle");
const [copied, setCopied] = useState(false);

useEffect(() => {
document.title = artifact
? `${artifact.title} · ${DEFAULT_DOCUMENT_TITLE}`
: DEFAULT_DOCUMENT_TITLE;

return () => {
document.title = DEFAULT_DOCUMENT_TITLE;
};
}, [artifact?.title]);

const downloadUrl = useMemo(() => {
if (!artifact) return "";
return URL.createObjectURL(new Blob([artifact.html], { type: "text/html;charset=utf-8" }));
Expand Down Expand Up @@ -734,6 +746,12 @@ function AppContent() {
location.pathname.startsWith("/a/") ||
(location.pathname === "/" && Boolean(requestedSlug));

useEffect(() => {
if (!isArtifactRoute) {
document.title = DEFAULT_DOCUMENT_TITLE;
}
}, [isArtifactRoute]);

return (
<div className="min-h-screen bg-slate-950 text-slate-100 selection:bg-cyan-300 selection:text-slate-950">
<div className="pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_top_left,rgba(34,211,238,0.08),transparent_30%),radial-gradient(circle_at_85%_10%,rgba(59,130,246,0.08),transparent_28%)]" />
Expand Down