From 776ce2a1c7957d76009a0882979033b8eb82a663 Mon Sep 17 00:00:00 2001 From: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 20:06:08 +0000 Subject: [PATCH] fix(#3482): resolve SonarQube MINOR issues in homepage workspace Fix two SonarQube issues in the dynamic-home-page plugin: - S4325 (useHomePageCardTitle.ts): Remove unnecessary type assertion `as keyof typeof t` which resolved to function object keys (string | number | symbol), not translation keys. Replaced direct `t()` call with existing `getTranslatedTextWithFallback` helper that handles the type assertion internally. - S7735 (OnboardingSection.tsx): Replace negated ternary condition `!profileLoading ? : null` with the positive form `profileLoading ? null : `. Closes #3482 --- .../src/components/OnboardingSection/OnboardingSection.tsx | 4 ++-- .../dynamic-home-page/src/utils/useHomePageCardTitle.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/workspaces/homepage/plugins/dynamic-home-page/src/components/OnboardingSection/OnboardingSection.tsx b/workspaces/homepage/plugins/dynamic-home-page/src/components/OnboardingSection/OnboardingSection.tsx index e090febe2a..8051104149 100644 --- a/workspaces/homepage/plugins/dynamic-home-page/src/components/OnboardingSection/OnboardingSection.tsx +++ b/workspaces/homepage/plugins/dynamic-home-page/src/components/OnboardingSection/OnboardingSection.tsx @@ -83,11 +83,11 @@ export function useOnboardingSection() { return name; }; - const greetingLine = !profileLoading ? ( + const greetingLine = profileLoading ? null : ( {`${greeting}, ${profileDisplayName() || t('onboarding.guest')}!`} - ) : null; + ); const body = ( diff --git a/workspaces/homepage/plugins/dynamic-home-page/src/utils/useHomePageCardTitle.ts b/workspaces/homepage/plugins/dynamic-home-page/src/utils/useHomePageCardTitle.ts index 1b6251c1d7..d1ab83815b 100644 --- a/workspaces/homepage/plugins/dynamic-home-page/src/utils/useHomePageCardTitle.ts +++ b/workspaces/homepage/plugins/dynamic-home-page/src/utils/useHomePageCardTitle.ts @@ -32,6 +32,8 @@ export function useHomePageCardTitle( t, props.titleKey ?? defaultTitleKey, props.title, - ) ?? t(defaultTitleKey as keyof typeof t) + ) ?? + getTranslatedTextWithFallback(t, defaultTitleKey, undefined) ?? + defaultTitleKey ); }