← Back to Pull requests

fix(contest): expand grade appeals inline and show reply states #431

Open
unknown opened this pull request with 215 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 06, 2026 03:40 UTC
Author

問題與變更

申訴管理原本需要逐筆按「查看申訴」開啟對話,列表也沒有使用者頭像或能區分待回覆方的狀態。這次讓整筆列表可直接展開,查看原始題目、作答、評語與對話,並在原處回覆、結案或前往批改。

  • 移除逐筆「查看申訴」與多餘的「重新整理申訴」,保留頁面原有 Reset。展開/收合、同時開啟多筆與 Reset 均保留未送出草稿;網路刷新失敗也保留草稿,權限失效則清除私密快取。

  • 列表、留言者與目前登入者顯示實際 profile 頭像,無圖或載入失敗才使用預設頭像。

  • 最新留言來自考生時顯示「等待教師回覆」,來自教師/管理者時顯示「等待考生回覆」;已結案優先。首次展開、回覆、結案與 Reset 同步列表和對話的狀態。

  • API 新增頭像與 waiting_for 欄位,維持既有 open/closed 與權限範圍,無 migration。快速重複送出只建立一則留言,多筆展開使用唯一輸入框 ID。
  • 本 PR 從 dev 獨立建立,只包含申訴調整與驗證截圖;沒有納入考試工作區 PR #430 或主要工作樹的其他未提交變更。

    驗證

  • 前端 Vitest:19 passed(申訴列表、既有 dialog、Avatar、AdminOverview)。

  • 後端不使用資料庫的 pytest:16 passed;使用唯讀掛載本分支的一次性 backend 容器。

  • Playwright:4 passed,涵蓋 desktop、tablet、390px 手機深色、展開/收合、草稿、頭像、重複送出、回覆狀態、結案與 Reset。

  • Typecheck、ESLint(0 errors;既有 warnings)、naming、architecture、repository exports、Carbon strict --all 均通過。

  • 獨立程式審查後已修正首次展開狀態同步與 Reset 草稿/對話更新,沒有剩餘阻擋。

  • 需要資料庫的完整申訴整合測試留給 CI;新增了回覆/結案/重開與頭像的整合測試,未宣稱已在本機執行。
  • 畫面截圖

    截圖來自本分支的真實 UI 元件,API 使用合成測試資料,沒有真實學生內容。可用 npm run test:workbench-browser -- grade-appeals.spec.ts --reporter=line 重現。

    桌面:直接展開,回覆後顯示等待考生回覆

    <img src="https://raw.githubusercontent.com/quan0715/QJudge/e8c9b4a37213322270d93acdc58de64db5ad3e20/docs/verification/grade-appeals-ui-20261106/desktop-expanded-replied.png" alt="桌面申訴列表直接展開並顯示等待考生回覆" width="960" />

    桌面:結案狀態與原有 Reset

    <img src="https://raw.githubusercontent.com/quan0715/QJudge/e8c9b4a37213322270d93acdc58de64db5ad3e20/docs/verification/grade-appeals-ui-20261106/desktop-closed-list.png" alt="桌面申訴結案狀態與原有 Reset" width="960" />

    手機深色:展開內容與回覆欄

    <img src="https://raw.githubusercontent.com/quan0715/QJudge/e8c9b4a37213322270d93acdc58de64db5ad3e20/docs/verification/grade-appeals-ui-20261106/mobile-dark-expanded.png" alt="390px 手機深色申訴展開內容與回覆欄" width="390" />

    Diff: 215 lines (+161 / -54) across 2 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 0m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.37) × (1 − Review Confidence (0.13)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 215 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 13% · Reviewer familiarity: 35%
    12%
    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.322
    Real PR Conversation Timeline
    1 comments
    "Review active on #431"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 12.5% 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: 36.6% (MEDIUM) · Higher = larger blast radius
    36.6%
    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: 12.5% · Lower = rushed or shallow review
    12.5%
    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: 32% · Safe to merge
    32%