Honor configured favicon path in Console (app_favicon_path) - #10566
Conversation
📝 WalkthroughWalkthroughChangesThe Console favicon is now sourced from runtime UI configuration, resolved against theme assets when needed, and rendered dynamically through Runtime favicon configuration
Suggested reviewers: 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/console/src/app.tsx (1)
194-226: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPreserve the optional favicon type.
appFaviconPathis optional inUIConfigInterface, so this selector can returnundefined. Type it asstring | undefined, and annotate theuseMemocallback accordingly to match the runtime guard and the explicit-annotation guideline.Proposed fix
- const appFaviconPath: string = useSelector((state: AppState) => state?.config?.ui?.appFaviconPath); + const appFaviconPath: string | undefined = useSelector( + (state: AppState): string | undefined => state?.config?.ui?.appFaviconPath + ); - const faviconHref: string | undefined = useMemo(() => { + const faviconHref: string | undefined = useMemo<string | undefined>( + (): string | undefined => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/console/src/app.tsx` around lines 194 - 226, Update the appFaviconPath selector in the App component to use the optional type string | undefined, and annotate the faviconHref useMemo callback with the corresponding string | undefined return type. Preserve the existing runtime guard and favicon resolution logic.Sources: Coding guidelines, MCP tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@apps/console/src/app.tsx`:
- Around line 194-226: Update the appFaviconPath selector in the App component
to use the optional type string | undefined, and annotate the faviconHref
useMemo callback with the corresponding string | undefined return type. Preserve
the existing runtime guard and favicon resolution logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: e4a58e02-0f38-40c7-84bb-62540e6dfe59
📒 Files selected for processing (5)
.changeset/tall-favicons-honor.mdapps/console/src/app.tsxapps/console/src/home.jspfeatures/admin.core.v1/configs/app.tsfeatures/admin.core.v1/models/config.ts
💤 Files with no reviewable changes (1)
- apps/console/src/home.jsp
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10566 +/- ##
========================================
Coverage 72.91% 72.91%
========================================
Files 470 470
Lines 71383 71389 +6
Branches 240 448 +208
========================================
+ Hits 52047 52053 +6
+ Misses 19225 19043 -182
- Partials 111 293 +182 🚀 New features to boost your workflow:
|
Root cause
The Console's favicon
<link>was a build-time default hardcoded inapps/console/src/home.jspand never read the runtimeconsole.ui.app_favicon_pathconfiguration, so a configured custom favicon was ignored.Fix
appFaviconPathfrom the runtime app config into the config reducer (admin.core.v1).apps/console/src/app.tsx. Absolute/data URLs are used as-is; relative/default paths are resolved under the theme asset prefix (clientOrigin/appBasefromAppUtils).<link>fromhome.jspso react-helmet is the single source of truth.Related Issue
wso2/product-is#28078