chore: 添加了登陆后页面标题自定义配置项#1720
Conversation
Greptile SummaryThis PR adds a configurable browser page title setting for authenticated users and fixes the sign-in page so logged-in users are redirected away automatically.
Confidence Score: 4/5Safe to merge after fixing the missing sign-up redirect and the TypeScript null type mismatch. Two concrete defects exist in the changed code: the frontend/src/routes/(auth)/sign-up.tsx (missing beforeLoad guard) and frontend/src/features/system/data/system.ts (UpdateBrandSettingsInput.title type) Important Files Changed
Sequence DiagramsequenceDiagram
participant Browser
participant Router as TanStack Router
participant RootLayout as Root Layout
participant GQL as GraphQL API
Browser->>Router: Visit sign-in page
Router->>Router: beforeLoad check
alt Logged in
Router-->>Browser: Redirect to home
else Not logged in
Router-->>Browser: Render sign-in form
end
Browser->>Router: Login succeeds
Router->>RootLayout: Mount DocumentTitleSync
RootLayout->>GQL: Query brandSettings title
GQL-->>RootLayout: Return title value
RootLayout->>Browser: Set document.title
Browser->>GQL: Update brand title setting
GQL-->>Browser: Confirm success
Browser->>GQL: Re-fetch brandSettings
GQL-->>Browser: New title value
Browser->>Browser: Update document.title
Reviews (2): Last reviewed commit: "Update frontend/src/features/system/comp..." | Re-trigger Greptile |
| } | ||
| } | ||
|
|
||
| if input.Title != nil { | ||
| err := r.systemService.SetTitle(ctx, *input.Title) | ||
| if err != nil { | ||
| return false, fmt.Errorf("failed to update title setting: %w", err) | ||
| } | ||
| } |
There was a problem hiding this comment.
Title cannot be cleared once set
This follows the same nil = "not provided" pattern as brandName, but there is no path for the user to reset the title to the default. On the frontend, the empty-string case maps to undefined which is omitted from the request, leaving input.Title as nil here and bypassing SetTitle entirely. To support clearing, the frontend should send "" (not undefined) when the field is emptied, and the resolver should call SetTitle(ctx, "") for a non-nil empty pointer — which the DB layer already handles correctly because an empty value returns "" and the frontend falls back to 'AxonHub'.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
| export interface UpdateBrandSettingsInput { | ||
| brandName?: string; | ||
| brandLogo?: string; | ||
| title?: string; | ||
| } |
There was a problem hiding this comment.
null not allowed by UpdateBrandSettingsInput.title in strict mode
brand-settings.tsx passes null when the title field is emptied, but title in this interface is typed as string | undefined. With "strict": true enabled in tsconfig.app.json, null is not assignable to string | undefined and will produce a TypeScript compilation error. The interface needs to explicitly allow null to reflect what the frontend sends and what the GraphQL schema accepts.
| export interface UpdateBrandSettingsInput { | |
| brandName?: string; | |
| brandLogo?: string; | |
| title?: string; | |
| } | |
| export interface UpdateBrandSettingsInput { | |
| brandName?: string; | |
| brandLogo?: string; | |
| title?: string | null; | |
| } |
…ge title config, request filter preservation, structured response items Upstream commits merged: - fix: model settings dialog overflow (looplj#1716) - chore: custom page title config after login (looplj#1720) - feat: preserve request log filters on detail navigation (looplj#1723) - feat(llm): support responses websocket sessions (looplj#1730) - chore: add claude-opus-4-7 to claudecode DefaultModels (looplj#1733) - fix(channels): show real i18n label for single-variant types (looplj#1734) - fix(llm): accept structured response item arguments (looplj#1728) Resolved 4 import-path conflicts (looplj -> ldm2060) and adapted session scope integration in auth middleware. Fixed Windows flaky WebSocket test for platform-specific socket error messages. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: 修复了多图输入情况下转发失效的问题 * chore: 添加了登陆后页面标题自定义配置项 * Update frontend/src/features/system/components/brand-settings.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
本次 PR 共处理了以下两个问题:
参考效果