设置 Web 页面标题
This commit is contained in:
@@ -74,6 +74,14 @@ function CommitPageInner() {
|
|||||||
}
|
}
|
||||||
}, [hasValidFolderId, normalizedFolderId])
|
}, [hasValidFolderId, normalizedFolderId])
|
||||||
|
|
||||||
|
const pageTitle = folder
|
||||||
|
? `${t("title")} · ${folder.name}`
|
||||||
|
: t("title")
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = `${pageTitle} - codeg`
|
||||||
|
}, [pageTitle])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
||||||
<AppTitleBar
|
<AppTitleBar
|
||||||
|
|||||||
@@ -50,6 +50,17 @@ import {
|
|||||||
} from "@/components/ui/resizable"
|
} from "@/components/ui/resizable"
|
||||||
import type { AgentType } from "@/lib/types"
|
import type { AgentType } from "@/lib/types"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
|
import { useFolderContext } from "@/contexts/folder-context"
|
||||||
|
|
||||||
|
function FolderDocumentTitle() {
|
||||||
|
const { folder } = useFolderContext()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = folder ? `${folder.name} - codeg` : "codeg"
|
||||||
|
}, [folder])
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
const TOAST_DURATION_MS = 15000
|
const TOAST_DURATION_MS = 15000
|
||||||
const WORKSPACE_PANEL_GROUP_ID = "workspace-panel-group"
|
const WORKSPACE_PANEL_GROUP_ID = "workspace-panel-group"
|
||||||
@@ -663,6 +674,7 @@ function FolderLayoutInner({ children }: { children: React.ReactNode }) {
|
|||||||
initialConversationId={conversationId ? Number(conversationId) : null}
|
initialConversationId={conversationId ? Number(conversationId) : null}
|
||||||
initialAgentType={agentType}
|
initialAgentType={agentType}
|
||||||
>
|
>
|
||||||
|
<FolderDocumentTitle />
|
||||||
<AlertProvider>
|
<AlertProvider>
|
||||||
<GitCredentialProvider>
|
<GitCredentialProvider>
|
||||||
<TaskProvider>
|
<TaskProvider>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { useRouter } from "next/navigation"
|
import { useRouter } from "next/navigation"
|
||||||
import { isDesktop } from "@/lib/platform"
|
import { isDesktop } from "@/lib/platform"
|
||||||
|
|
||||||
@@ -10,6 +10,10 @@ export default function LoginPage() {
|
|||||||
const [error, setError] = useState("")
|
const [error, setError] = useState("")
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = "Login - codeg"
|
||||||
|
}, [])
|
||||||
|
|
||||||
// Desktop users skip login entirely
|
// Desktop users skip login entirely
|
||||||
if (isDesktop()) {
|
if (isDesktop()) {
|
||||||
router.replace("/welcome")
|
router.replace("/welcome")
|
||||||
|
|||||||
@@ -76,6 +76,14 @@ function MergePageInner() {
|
|||||||
}
|
}
|
||||||
}, [hasValidFolderId, normalizedFolderId])
|
}, [hasValidFolderId, normalizedFolderId])
|
||||||
|
|
||||||
|
const pageTitle = folder
|
||||||
|
? `${t("title")} · ${folder.name}`
|
||||||
|
: t("title")
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = `${pageTitle} - codeg`
|
||||||
|
}, [pageTitle])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
||||||
<AppTitleBar
|
<AppTitleBar
|
||||||
|
|||||||
@@ -74,6 +74,14 @@ function PushPageInner() {
|
|||||||
}
|
}
|
||||||
}, [hasValidFolderId, normalizedFolderId])
|
}, [hasValidFolderId, normalizedFolderId])
|
||||||
|
|
||||||
|
const pageTitle = folder
|
||||||
|
? `${t("title")} · ${folder.name}`
|
||||||
|
: t("title")
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = `${pageTitle} - codeg`
|
||||||
|
}, [pageTitle])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
||||||
<AppTitleBar
|
<AppTitleBar
|
||||||
|
|||||||
@@ -64,6 +64,14 @@ function StashPageInner() {
|
|||||||
}
|
}
|
||||||
}, [hasValidFolderId, normalizedFolderId])
|
}, [hasValidFolderId, normalizedFolderId])
|
||||||
|
|
||||||
|
const pageTitle = folder
|
||||||
|
? `${t("title")} · ${folder.name}`
|
||||||
|
: t("title")
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = `${pageTitle} - codeg`
|
||||||
|
}, [pageTitle])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
<div className="flex h-screen flex-col overflow-hidden bg-background text-foreground">
|
||||||
<AppTitleBar
|
<AppTitleBar
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
|
import { useEffect } from "react"
|
||||||
|
import { useTranslations } from "next-intl"
|
||||||
import { WelcomeScreen } from "@/components/welcome/welcome-screen"
|
import { WelcomeScreen } from "@/components/welcome/welcome-screen"
|
||||||
|
|
||||||
export default function WelcomePage() {
|
export default function WelcomePage() {
|
||||||
|
const t = useTranslations("WelcomePage")
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = `${t("title")} - codeg`
|
||||||
|
}, [t])
|
||||||
|
|
||||||
return <WelcomeScreen />
|
return <WelcomeScreen />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { useCallback, type ComponentType, type ReactNode } from "react"
|
import { useCallback, useEffect, type ComponentType, type ReactNode } from "react"
|
||||||
import {
|
import {
|
||||||
Bot,
|
Bot,
|
||||||
BookOpenText,
|
BookOpenText,
|
||||||
@@ -99,6 +99,10 @@ export function SettingsShell({ children }: SettingsShellProps) {
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const normalizedPathname = normalizePath(pathname)
|
const normalizedPathname = normalizePath(pathname)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = `${t("title")} - codeg`
|
||||||
|
}, [t])
|
||||||
|
|
||||||
const navigateTo = useCallback(
|
const navigateTo = useCallback(
|
||||||
(href: string) => {
|
(href: string) => {
|
||||||
if (typeof window === "undefined") return
|
if (typeof window === "undefined") return
|
||||||
|
|||||||
Reference in New Issue
Block a user