mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-06 06:27:42 +00:00
feat: update document title based on selected project (#448)
Show dynamic browser tab title based on selected project's name, post-fixed with "CloudCLI UI" when a project is selected, improving navigation across tabs.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useEffect } from 'react';
|
||||
import type { TFunction } from 'i18next';
|
||||
import type { LoadingProgress, Project, ProjectSession, SessionProvider } from '../../../../types/app';
|
||||
import type {
|
||||
@@ -103,6 +104,15 @@ export default function SidebarProjectList({
|
||||
/>
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
let baseTitle = 'CloudCLI UI';
|
||||
const displayName = selectedProject?.displayName?.trim();
|
||||
if (displayName) {
|
||||
baseTitle = `${displayName} - ${baseTitle}`;
|
||||
}
|
||||
document.title = baseTitle;
|
||||
}, [selectedProject]);
|
||||
|
||||
const showProjects = !isLoading && projects.length > 0 && filteredProjects.length > 0;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user