From cd85419d1da6e187c451e2bdc6803b90f547b48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 23:08:44 -0400 Subject: [PATCH] oauth/inbox: use native ordered list; explicit severity fallback (P2-45, P2-48) --- src/renderer/components/inbox/Inbox.tsx | 4 +- .../components/inbox/inbox-helpers.tsx | 5 ++ .../settings/dialogs/OAuthPromptDialog.tsx | 51 ++++++++----------- 3 files changed, 28 insertions(+), 32 deletions(-) diff --git a/src/renderer/components/inbox/Inbox.tsx b/src/renderer/components/inbox/Inbox.tsx index 6c6796cb..ee23c85d 100644 --- a/src/renderer/components/inbox/Inbox.tsx +++ b/src/renderer/components/inbox/Inbox.tsx @@ -9,7 +9,7 @@ import { import type { InboxItem, InboxItemType, SectionId } from "@shared/types"; import { timeAgo } from "../../lib/formatters"; import { useT } from "../../i18n"; -import { typeConfig, severityColors } from "./inbox-helpers"; +import { typeConfig, severityBorderClass } from "./inbox-helpers"; interface InboxProps { items: InboxItem[]; @@ -115,7 +115,7 @@ export function Inbox({ items, onNavigate }: InboxProps) { initial={{ opacity: 0, y: -8 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, x: 20 }} - className={`group flex items-center gap-3 rounded-lg border border-l-[3px] border-border bg-card px-4 py-3 transition duration-150 hover:border-border hover:shadow-md hover:-translate-y-px ${severityColors[item.severity] ?? ""}`} + className={`group flex items-center gap-3 rounded-lg border border-l-[3px] border-border bg-card px-4 py-3 transition duration-150 hover:border-border hover:shadow-md hover:-translate-y-px ${severityBorderClass(item.severity)}`} >
= { low: "border-l-[color:var(--border)]", }; +export function severityBorderClass(severity: string | null | undefined): string { + if (!severity) return "border-l-[color:var(--border)]"; + return severityColors[severity] ?? "border-l-[color:var(--border)]"; +} + export function CompactMetric({ label, value, tone = "default", subtitle }: { label: string; value: string | number; diff --git a/src/renderer/components/settings/dialogs/OAuthPromptDialog.tsx b/src/renderer/components/settings/dialogs/OAuthPromptDialog.tsx index 7b7ec2d8..fef5d7f0 100644 --- a/src/renderer/components/settings/dialogs/OAuthPromptDialog.tsx +++ b/src/renderer/components/settings/dialogs/OAuthPromptDialog.tsx @@ -102,37 +102,28 @@ export function OAuthPromptDialog() {
{isManualCode ? ( -
-
    -
  1. - 1 - - {pending.authUrl ? ( - <> - Open{" "} - - the authorization page - {" "} - and click Authorize. - - ) : ( - <>Complete authorization in the browser window that opened. - )} - -
  2. -
  3. - 2 - Copy the authorization code shown on the confirmation page. -
  4. -
  5. - 3 - Paste it below and press Submit. +
    +
      +
    1. + {pending.authUrl ? ( + <> + Open{" "} + + the authorization page + {" "} + and click Authorize. + + ) : ( + <>Complete authorization in the browser window that opened. + )}
    2. +
    3. Copy the authorization code shown on the confirmation page.
    4. +
    5. Paste it below and press Submit.
    ) : (