U-2②: 前端逐區 refine 接上 #81 後端契約 + 修 main 紅燈(移除舊契約路由測試)#82
Merged
Conversation
/app 視覺站的逐區微調原送舊形狀 {infographic, sectionId} 並讀 data.data,
與 #81 實際落地的 POST /api/refine-section(收/回單一 section)對不上,逐區
微調實際打不通。改成與 sibling 單頁微調 /api/refine 同形狀:送 section、
讀 data.section、patch 回 result.data.sections[idx]。純前端一檔,vite build 通過。
docs/PRODUCT_READINESS.md U-2 標 [x](①②③到齊)。
https://claude.ai/code/session_011KcsjSFoGvB92odmj4VtKK
#81 把 /api/refine-section 路由改採「收/回單一 section」契約並加 tests/test_infocards_refine.py 覆蓋,但遺留 test_infocards_infographic.py ::TestRefineSection 的兩個路由測試仍送舊形狀 {infographic, sectionId} → 回 422, 使 main CI 紅。移除這兩個過時路由測試(端到端覆蓋已在 test_infocards_refine.py), 保留其餘 infographic_service 函式單元測試。 https://claude.ai/code/session_011KcsjSFoGvB92odmj4VtKK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做什麼
完成 U-2 的 ②前端區域選擇 / 逐區 refine UI,把
/app視覺站的逐區微調真正接通 #81 的後端端點;並修好main目前的紅燈(#81 遺留的舊契約路由測試)。frontend/edustudio/app.jsx:refineSection從舊形狀{ infographic, sectionId }→讀data.data改成與 U-2①: 後端資訊圖卡逐區 refine 端點移植 #81 落地契約一致的{ section: sections[idx], instruction, regenerateImage }→讀data.section→splice 回result.data.sections[idx](比照 sibling 單頁微調refineSlide)。tests/test_infocards_infographic.py:移除TestRefineSection的兩個舊契約路由測試(送{infographic, sectionId}→ 422)。docs/PRODUCT_READINESS.md:U-2 標[x](①②③到齊)。mainCI 是紅的(#81 不完整遷移)/api/refine-section有兩套平行實作:core/infocards/infographic_service.refine_infographic_section(data, section_id, …)test_infocards_infographic.py::TestRefineSectioncore/infocards/refine_service.refine_infographic_section(section, …)test_infocards_refine.py#81 把路由從 A 換成 B、加了 B 的測試,但沒更新前端(仍打 A → 打不通)也沒移除 A 的路由測試(仍送舊形狀 → 422)→
main紅。本 PR 把前端與測試對齊到現行路由 B,讓main重新轉綠、逐區 refine 端到端可用。怎麼測
test_infocards_infographic.py + test_infocards_refine.py31 passed;本機全套 2705 passed(剩 3 個為容器缺 Noto CJK 字型的 QR/theme 像素假象,CI 裝字型為權威)。npm run build(vite v6/node22)編譯通過;CIfrontend-app-build/frontend-typecheck皆綠。Reviewer 決策點(劉老師)
infographic_service.refine_infographic_section+build_refine_section_prompt)目前只剩自己的單元測試在用、production 已不呼叫=孤兒重複實作。是否要整併掉只留 B?另注意 A 有、B 沒有的行為:A 在「清空 imagePrompt」時會一併移除舊圖(test_clearing_prompt_drops_image),B 不會 drop 舊圖——若要保留此行為需補進 B。建議另開 cleanup PR,先聽你決定。https://claude.ai/code/session_011KcsjSFoGvB92odmj4VtKK