فهرست منبع

feat(web): 判断格分数改竖排(每个维度一行)

compactScoreItemsList 拆出逐项;VideoDecisionCell 用 .score-lines 竖排渲染总分/相关性/平台/适老性,
不再单行 · 拼接换行。compactScoreItemsText(抽屉用)保留拼接版。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sam Lee 2 هفته پیش
والد
کامیت
0207d779ac
3فایلهای تغییر یافته به همراه26 افزوده شده و 4 حذف شده
  1. 12 0
      web2/app/globals.css
  2. 7 1
      web2/features/LedgerPage.tsx
  3. 7 3
      web2/lib/flow-ledger/business.ts

+ 12 - 0
web2/app/globals.css

@@ -763,6 +763,18 @@ a:focus-visible {
   min-width: 0;
   min-width: 0;
 }
 }
 
 
+.score-lines {
+  display: flex;
+  flex-direction: column;
+  gap: 2px;
+}
+
+.score-lines strong {
+  font-size: 12.5px;
+  font-weight: 600;
+  line-height: 1.4;
+}
+
 .source-detail-list {
 .source-detail-list {
   display: grid;
   display: grid;
   gap: 3px;
   gap: 3px;

+ 7 - 1
web2/features/LedgerPage.tsx

@@ -10,6 +10,7 @@ import { TechnicalRetryDetails } from "@/components/TechnicalRetryDetails";
 import {
 import {
   assetDetailText,
   assetDetailText,
   assetSummaryText,
   assetSummaryText,
+  compactScoreItemsList,
   compactScoreItemsText,
   compactScoreItemsText,
   displayScoreLabel,
   displayScoreLabel,
   metricLabel,
   metricLabel,
@@ -282,7 +283,12 @@ function VideoDecisionCell({ video }: { video: VideoRef | null }) {
           <span className="muted">{technicalRetryShortText(video)}</span>
           <span className="muted">{technicalRetryShortText(video)}</span>
         ) : null}
         ) : null}
         {video.decisionAction === "TECHNICAL_RETRY_REQUIRED" ? <TechnicalRetryDetails detail={video.technicalRetryDetail} compact /> : null}
         {video.decisionAction === "TECHNICAL_RETRY_REQUIRED" ? <TechnicalRetryDetails detail={video.technicalRetryDetail} compact /> : null}
-        <strong>{compactScoreItemsText(video.scoreItems)}</strong>
+        <div className="score-lines">
+          {compactScoreItemsList(video.scoreItems).map((line) => (
+            <strong key={line}>{line}</strong>
+          )) }
+          {compactScoreItemsList(video.scoreItems).length ? null : <strong>暂无评分</strong>}
+        </div>
       </div>
       </div>
     </td>
     </td>
   );
   );

+ 7 - 3
web2/lib/flow-ledger/business.ts

@@ -156,7 +156,7 @@ export function scoreItemsText(items: ScoreItem[]): string {
   return visible.slice(0, 3).map((item) => `${displayScoreLabel(item.label)} ${item.scoreLabel}`).join(" · ");
   return visible.slice(0, 3).map((item) => `${displayScoreLabel(item.label)} ${item.scoreLabel}`).join(" · ");
 }
 }
 
 
-export function compactScoreItemsText(items: ScoreItem[]): string {
+export function compactScoreItemsList(items: ScoreItem[]): string[] {
   // 总分 + 各加权维度(group=main:相关性/平台/抖音的适老性),不再截断到 3 项。
   // 总分 + 各加权维度(group=main:相关性/平台/抖音的适老性),不再截断到 3 项。
   const wanted = items.filter(
   const wanted = items.filter(
     (item) =>
     (item) =>
@@ -164,8 +164,12 @@ export function compactScoreItemsText(items: ScoreItem[]): string {
       item.scoreLabel !== "暂无评分" &&
       item.scoreLabel !== "暂无评分" &&
       (displayScoreLabel(item.label) === "总分" || item.group === "main")
       (displayScoreLabel(item.label) === "总分" || item.group === "main")
   );
   );
-  if (!wanted.length) return "暂无评分";
-  return wanted.map((item) => `${compactScoreLabel(item.label)} ${item.scoreLabel.replace(/\s*分$/, "")}`).join(" · ");
+  return wanted.map((item) => `${compactScoreLabel(item.label)} ${item.scoreLabel.replace(/\s*分$/, "")}`);
+}
+
+export function compactScoreItemsText(items: ScoreItem[]): string {
+  const list = compactScoreItemsList(items);
+  return list.length ? list.join(" · ") : "暂无评分";
 }
 }
 
 
 export function scoreItemRows(items: ScoreItem[]): ScoreItem[] {
 export function scoreItemRows(items: ScoreItem[]): ScoreItem[] {