From 0850c0f6c270682c16480ee5be7eb5a3e7e564e0 Mon Sep 17 00:00:00 2001 From: manager Date: Wed, 19 Aug 2026 10:39:26 +0000 Subject: [PATCH] fix(uxcore): address PR #181 review comments - OffsecBiasView: conditional classNames via the cn() helper instead of raw template strings, per AGENTS.md convention. - rating.ts: geo payload typed as TUserGeo instead of an explicit any. - OngoingLayout.module.scss: submit-error color reuses the shared error red as a named variable instead of a fresh hardcoded literal. Fourth review note (OffSec bias-schema sign-off) needs no code change: the content and its dev-only gating were explicitly approved by Wolf. Co-Authored-By: Claude Fable 5 --- src/uxcore/api/rating.ts | 8 +++++++- .../OffsecBiasView/OffsecBiasView.tsx | 19 +++++++++++-------- .../OngoingLayout/OngoingLayout.module.scss | 6 +++++- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/uxcore/api/rating.ts b/src/uxcore/api/rating.ts index 72a0dff..84471aa 100644 --- a/src/uxcore/api/rating.ts +++ b/src/uxcore/api/rating.ts @@ -5,7 +5,13 @@ export const rateRequest = async ( ) => { // Geo enrichment is best-effort: a failed /api/user lookup must not // abort the vote itself. - let userData: any = {}; + type TUserGeo = { + country?: string; + region?: string; + city?: string; + ip?: string; + }; + let userData: TUserGeo = {}; try { userData = await fetch('/api/user').then(data => data.json()); } catch { diff --git a/src/uxcore/components/OffsecBiasView/OffsecBiasView.tsx b/src/uxcore/components/OffsecBiasView/OffsecBiasView.tsx index 19c4330..87f2359 100644 --- a/src/uxcore/components/OffsecBiasView/OffsecBiasView.tsx +++ b/src/uxcore/components/OffsecBiasView/OffsecBiasView.tsx @@ -1,4 +1,5 @@ import { OffsecBiasCard, OffsecBiasContent } from '@uxcore/data/biasOffsec'; +import cn from 'classnames'; import KemmioCredit from './KemmioCredit'; @@ -231,9 +232,9 @@ const CardBody = ({ card }: { card: OffsecBiasCard }) => { {card.items.map((item, i) => (
{item.flagged && } @@ -296,7 +297,7 @@ const OffsecBiasView = ({ content }: OffsecBiasViewProps) => {
{before.tag} -
+
@@ -306,13 +307,15 @@ const OffsecBiasView = ({ content }: OffsecBiasViewProps) => {
- + {after.tag}
diff --git a/src/uxcore/layouts/OngoingLayout/OngoingLayout.module.scss b/src/uxcore/layouts/OngoingLayout/OngoingLayout.module.scss index afe077d..3c9d325 100644 --- a/src/uxcore/layouts/OngoingLayout/OngoingLayout.module.scss +++ b/src/uxcore/layouts/OngoingLayout/OngoingLayout.module.scss @@ -1,4 +1,6 @@ $white: #fafafa; +// Error red shared with the UXCP DecisionTable error surface. +$error-red: #fb1717; .ongoing { background-color: $white; @@ -254,7 +256,9 @@ $white: #fafafa; .submitError { text-align: center; - color: #fb1717; + // Same error red the UXCP DecisionTable error surface uses — reuse, not + // a new invented color. + color: $error-red; font-size: 16px; line-height: 150%; margin-top: 16px;