Skip to content

feat(frontend): add dynamic page titles for workspace and session pages#878

Open
mprpic wants to merge 1 commit intomainfrom
page-title
Open

feat(frontend): add dynamic page titles for workspace and session pages#878
mprpic wants to merge 1 commit intomainfrom
page-title

Conversation

@mprpic
Copy link
Contributor

@mprpic mprpic commented Mar 10, 2026

Replaces #861

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0e80ea19-b0cb-4baa-8abf-64c56771dd79

📥 Commits

Reviewing files that changed from the base of the PR and between 95eb360 and ac5e93d.

📒 Files selected for processing (6)
  • components/frontend/src/app/integrations/page.tsx
  • components/frontend/src/app/projects/[name]/layout.tsx
  • components/frontend/src/app/projects/[name]/page.tsx
  • components/frontend/src/app/projects/[name]/sessions/[sessionName]/layout.tsx
  • components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx
  • components/frontend/src/app/projects/layout.tsx

Walkthrough

Adds metadata exports and simple layout components across integrations and projects routes, and client-side effects that update document titles for project and session pages. Five files were added or modified to include metadata or render children and to set page titles after hydration.

Changes

Cohort / File(s) Summary
Integrations page
components/frontend/src/app/integrations/page.tsx
Added a metadata export (Metadata type import) with title "Integrations · Ambient Code Platform".
Projects top-level layout
components/frontend/src/app/projects/layout.tsx
Added metadata export with title "Workspaces · Ambient Code Platform" and default WorkspacesLayout that returns children.
Project workspace layout
components/frontend/src/app/projects/[name]/layout.tsx
Added default WorkspaceLayout that returns children.
Session layout
components/frontend/src/app/projects/[name]/sessions/[sessionName]/layout.tsx
Added default SessionLayout that returns children.
Project page title effect
components/frontend/src/app/projects/[name]/page.tsx
Added client-side effect to update document.title to " · Ambient Code Platform" after hydration when project data/name changes.
Session page title effect
components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsx
Added client-side effect to update document.title to " · Ambient Code Platform" after hydration when session displayName/sessionName changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: adding dynamic page titles for workspace and session pages through metadata exports and useEffect hooks.
Description check ✅ Passed The description provides a reference to a replaced PR, which contextualizes the change though it lacks detailed explanation of the work itself.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch page-title

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify
Copy link

mergify bot commented Mar 10, 2026

🧪 CI Insights

Here's what we observed from your CI run for 95eb360.

🟢 All jobs passed!

But CI Insights is watching 👀

@ambient-code ambient-code bot added this to the Merge Queue milestone Mar 10, 2026
@ambient-code ambient-code bot modified the milestone: Merge Queue Mar 11, 2026
@ambient-code
Copy link
Contributor

ambient-code bot commented Mar 11, 2026

Review Queue — Not Ready to Merge

christianvogt reviewed the PR and identified a substantive issue with the implementation. The session page titles are using technical session names (like 'session-17734238534') instead of user-friendly display names, making browser tabs unhelpful. This is an unresolved design flaw that defeats the purpose of the PR.

To unblock: Update the session layout to use the session's display name instead of the technical session name for the page title.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Martin Prpič <mprpic@redhat.com>
Comment on lines +254 to +260
// Update page title with display name when available
useEffect(() => {
const title = session?.spec?.displayName || sessionName;
if (title) {
document.title = `${title} · Ambient Code Platform`;
}
}, [session?.spec?.displayName, sessionName]);
Copy link

@christianvogt christianvogt Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the next.js way is to use metadata, why not just make the request to obtain the session name in the metadata function?

What I originally did was use the react title component which I think is a better approach vs a useEffect. While it may not make a difference here, if nested components want to add a title, on unmount it would restore the parent value.

@ambient-code ambient-code bot modified the milestones: Merge Queue, Review Queue Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants