-
Notifications
You must be signed in to change notification settings - Fork 17
Implement dynamic titles and updated icons (favicon/header) for the console #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds a theme-aware Logo component, a useDocumentTitle hook, HTML metadata and favicon updates, replaces an inline logo with the external Logo in the navbar, and re-exports the new Logo and hooks via barrel files. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@console/workspaces/libs/views/src/hooks/useDocumentTitle.ts`:
- Around line 19-48: The hook currently uses baseTitleRef to capture
document.title but nested uses can read an already-modified title and cleanup
resets incorrectly; update useDocumentTitle to capture and restore the previous
title per hook instance: add a prevTitleRef (e.g., prevTitleRef.current =
document.title) on mount before changing document.title, use a module-level
initialBaseTitle (or keep baseTitleRef as the single cached original) so
baseTitleRef only stores the very first original title (document.title ||
baseTitleFallback) and never the modified one, update document.title to
`${title} | ${baseTitleRef.current}` and in the cleanup restore
prevTitleRef.current (not baseTitleRef.current) so nested components revert to
their immediate previous title.
🧹 Nitpick comments (2)
console/workspaces/libs/views/src/component/MainLayout/subcomponents/NavBarToolbar.tsx (2)
105-122: Redundant outer Box wrapper withgap: 1.5.The outer
Box(lines 105-111) specifiesgap: 1.5but contains only a single child element (the innerBox). Thegapproperty has no effect with one child. Consider simplifying by removing the outer wrapper.♻️ Suggested simplification
- <Box - sx={{ - display: 'flex', - alignItems: 'center', - gap: 1.5, - }} - > - <Box - sx={{ - width: theme.spacing(24), - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - }} - > - <Logo /> - </Box> - </Box> + <Box + sx={{ + width: theme.spacing(24), + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + }} + > + <Logo /> + </Box>
34-35: Missing blank line between import and interface declaration.There should be a blank line separating the import statements from the interface declaration for better readability.
♻️ Suggested fix
import { Logo } from '../../Logo/Logo'; + export interface NavBarToolbarProps {
Purpose
This pull request introduces several improvements to the web application's branding, user interface, and usability. The most significant changes include the addition of a new
Logocomponent with a scalable SVG logo, enhancements to the document title handling for improved accessibility and SEO, and updates to the main layout to reflect the new branding. Additionally, the HTML metadata has been expanded for better social sharing and discoverability.Branding and UI Enhancements:
Logocomponent as an SVG, which adapts to the color scheme and replaces the previous placeholder logo in the navigation bar. (console/workspaces/libs/views/src/component/Logo/Logo.tsx,console/workspaces/libs/views/src/component/Logo/index.ts,console/workspaces/libs/views/src/component/MainLayout/subcomponents/NavBarToolbar.tsx, [1] [2] [3] [4]console/apps/webapp/index.html, console/apps/webapp/index.htmlL5-R23)Usability Improvements:
useDocumentTitleReact hook to dynamically set the document title based on the current page, and integrated it into thePageLayoutcomponent for consistent title updates. (console/workspaces/libs/views/src/hooks/useDocumentTitle.ts,console/workspaces/libs/views/src/component/PageLayout/PageLayout.tsx, [1] [2] [3]Logocomponent anduseDocumentTitlehook from the sharedviewslibrary for use throughout the application. (console/workspaces/libs/views/src/component/index.ts,console/workspaces/libs/views/src/hooks/index.ts,console/workspaces/libs/views/src/index.ts, [1] [2] [3]Issue: #276
Goals
Approach
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning
Summary by CodeRabbit
New Features
UI/Style Updates