Skip to content

Commit ac5e93d

Browse files
mprpicclaude
andcommitted
feat(frontend): add dynamic page titles for workspace and session pages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Prpič <mprpic@redhat.com>
1 parent 3f8f78b commit ac5e93d

6 files changed

Lines changed: 46 additions & 0 deletions

File tree

components/frontend/src/app/integrations/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import type { Metadata } from 'next'
12
import React from 'react'
23
import IntegrationsClient from '@/app/integrations/IntegrationsClient'
34

5+
export const metadata: Metadata = {
6+
title: 'Integrations · Ambient Code Platform',
7+
}
8+
49
export const dynamic = 'force-dynamic'
510
export const revalidate = 0
611

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function WorkspaceLayout({
2+
children,
3+
}: {
4+
children: React.ReactNode;
5+
}) {
6+
return children;
7+
}

components/frontend/src/app/projects/[name]/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ export default function ProjectDetailsPage() {
9999
const initialSection = (searchParams.get('section') as Section) || 'sessions';
100100
const [activeSection, setActiveSection] = useState<Section>(initialSection);
101101

102+
// Update page title with display name when available
103+
useEffect(() => {
104+
const title = project?.displayName || projectName;
105+
document.title = `${title} · Ambient Code Platform`;
106+
}, [project?.displayName, projectName]);
107+
102108
// Update active section when query parameter changes
103109
useEffect(() => {
104110
const sectionParam = searchParams.get('section') as Section;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function SessionLayout({
2+
children,
3+
}: {
4+
children: React.ReactNode;
5+
}) {
6+
return children;
7+
}

components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ export default function ProjectSessionDetailPage({
251251
return undefined;
252252
}, [capabilities?.framework, runnerTypes]);
253253

254+
// Update page title with display name when available
255+
useEffect(() => {
256+
const title = session?.spec?.displayName || sessionName;
257+
if (title) {
258+
document.title = `${title} · Ambient Code Platform`;
259+
}
260+
}, [session?.spec?.displayName, sessionName]);
261+
254262
// Track the current Langfuse trace ID for feedback association
255263
const [langfuseTraceId, setLangfuseTraceId] = useState<string | null>(null);
256264

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { Metadata } from "next";
2+
3+
export const metadata: Metadata = {
4+
title: "Workspaces · Ambient Code Platform",
5+
};
6+
7+
export default function WorkspacesLayout({
8+
children,
9+
}: {
10+
children: React.ReactNode;
11+
}) {
12+
return children;
13+
}

0 commit comments

Comments
 (0)