← Back to Pull requests

fix(subject): 收藏统计在窄屏下缩写为 k, 避免被收藏按钮切掉 #3649

Open
unknown opened this pull request with 150 lines diff across 1 files
View on GitHub
unknown unknown commented on Oct 21, 2026 15:54 UTC
Author

详情页窄屏头部里收藏统计与收藏按钮同排, 统计文本只有 weight(1f) 给出的剩余宽度,
且 Text 原先只有 maxLines = 1 而没有 overflow 策略, 宽度不足时文字直接被按钮边界 切掉, 表现为「...收藏 / ...在看 / ...抛弃」被遮住。

CollectionData 现在用 TextMeasurer 量出完整文本宽度, 与父 Row 给出的可用宽度比较, 只有确实放不下时才缩写数字:

  • 1000 及以下不变;

  • 1000 到 10000 之间保留一位小数并省略末尾的 .0 (1555 显示 1.5k, 9000 显示 9k);

  • 10000 及以上只取整数部分 (10000 显示 10k, 35555 显示 35k)。
  • 缩写不做四舍五入, 结果不会大于实际值; 宽屏仍显示精确数字。同时补上 Ellipsis,
    极端宽度下不再直接裁切。

    新增 SubjectCollectionCountFormatTest 覆盖缩写规则, SubjectCollectionDataLayoutTest 覆盖窄宽度缩写、宽宽度保留原值、千以内不缩写。

    本地 CI 等价验证 (Windows, en_US):

  • desktopTest 9607 tests / testAndroidHostTest 3437 tests, 0 失败

  • lint: 24 warnings, 0 errors, 无本次改动相关项

  • 桌面发布版可打包 (Ani.exe)

  • Debug APK 可安装: me.him188.ani.debug2 / CN=Android Debug / arm64-v8a
  • 实机截图(OnePlus Ace 3V Android 16):
    修复前(“抛弃”字样被遮挡):
    <img width="1240" height="2772" alt="Screenshot_2026-10-21-22-06-57-93_f29b583f042deaa4fcfd9489b70192f0" src="https://github.com/user-attachments/assets/a96dd141-be2f-469f-8f2c-04c53668f1b9" />
    修复后:
    <img width="1240" height="2772" alt="Screenshot_2026-10-21-23-15-36-81_720eea5177259a29ab4c9e3d29f240ec" src="https://github.com/user-attachments/assets/4c9c1825-f927-4b06-aca3-489de4aff616" />

    Co-Developer:DeepSeek v4.1f 1017

    Diff: 150 lines (+112 / -38) across 1 files Reviewer: Him188 Review duration: 57848m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 150 lines diff across 1 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.300
    Real PR Conversation Timeline
    1 comments
    "Review active on #3649"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40% (MEDIUM) · Higher = larger blast radius
    40%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.1% · Safe to merge
    22.1%