From 7e700c4c99319f9bd0f1a09345f5eb9e76ab6dac Mon Sep 17 00:00:00 2001 From: d-robotics Date: Wed, 14 Oct 2026 22:06:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9D=20Claim=20ticket=2007=20(revie?= =?UTF-8?q?w=20opinion=20target=20interaction)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issues/07-review-opinion-target-interaction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scratch/rework-ux-adjust-20261014/issues/07-review-opinion-target-interaction.md b/.scratch/rework-ux-adjust-20261014/issues/07-review-opinion-target-interaction.md index a5b7c3d3..347eaaa8 100644 --- a/.scratch/rework-ux-adjust-20261014/issues/07-review-opinion-target-interaction.md +++ b/.scratch/rework-ux-adjust-20261014/issues/07-review-opinion-target-interaction.md @@ -1,6 +1,6 @@ # Ticket 07: 审核意见目标交互重做 + 四面模式头调整 -Status: ready(依赖 06 合入后开工) +Status: claimed(2026-10-14,worktree local-data/worktrees/rua-07 @ codex/rua-07,基线 4b00fba3) Priority: P1(第二轮增补,用户 2026-10-14 晚拍板) Spec: D5(修订版)、D9、US26/US27 From 7df73dbc7315e1d247bf24c6e857d5f28c462158 Mon Sep 17 00:00:00 2001 From: d-robotics Date: Wed, 14 Oct 2026 22:17:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=A8=20Rework=20review=20opinion=20tar?= =?UTF-8?q?get=20interaction:=20Ctrl+Arrows=20switch=20targets,=20F=20writ?= =?UTF-8?q?es=20directly,=20unified=20four-face=20help=20(D5/D9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CaptureAnnotationWorkbench.tsx | 9 +- src/components/FinalAcceptanceWorkspace.tsx | 8 +- src/components/ReviewProblemPanel.tsx | 55 +------ src/components/review-viewing.ts | 14 +- src/hooks/useReviewDraft.ts | 145 ++++++++--------- src/lib/review-navigation.js | 103 +++++++----- src/lib/review-shortcuts.js | 19 ++- src/pages/AnnotationOperations.tsx | 8 +- tests/frontend/review-shortcuts.test.mjs | 9 +- .../review-target-interaction.test.mjs | 148 ++++++++++++++++++ .../scope-cycle-inline-editor.test.mjs | 73 ++------- 11 files changed, 337 insertions(+), 254 deletions(-) create mode 100644 tests/frontend/review-target-interaction.test.mjs diff --git a/src/components/CaptureAnnotationWorkbench.tsx b/src/components/CaptureAnnotationWorkbench.tsx index b4ad3dab..dc8995f8 100644 --- a/src/components/CaptureAnnotationWorkbench.tsx +++ b/src/components/CaptureAnnotationWorkbench.tsx @@ -367,7 +367,7 @@ export function CaptureAnnotationWorkbench({ onReviewController, onReviewProblem, onReviewSave, - onReviewProblemNavigate, + onReviewTargetSwitch, onReviewReworkNavigate, onReviewReworkVerdict, onReviewTimestampJump, @@ -3123,8 +3123,9 @@ export function CaptureAnnotationWorkbench({ const position = reviewController.pauseAndLocate(); if (position) onReviewProblem?.(position); } else if (command === "save-note") onReviewSave?.(); - else if (command === "previous-problem" || command === "next-problem") - onReviewProblemNavigate?.(command === "previous-problem" ? -1 : 1); + else if (command === "previous-target" || command === "next-target") + // 票 07(D5 修订版):Ctrl/⌘+↑/↓ 切换写意见的目标档(页面侧解析三档与锚点)。 + onReviewTargetSwitch?.(command === "previous-target" ? -1 : 1); else if (command === "jump-timestamp-problem") onReviewTimestampJump?.(); else if (command === "next-rework-opinion" || command === "previous-rework-opinion") // 返修接收视图 J/K:定位由页面绑 ReviewViewingController 原语(票 08)。 @@ -4165,7 +4166,7 @@ export function CaptureAnnotationWorkbench({ disabled={reviewWriteLocked} onClick={() => { if (reviewProblemPanel) { - onReviewProblem?.({ ...reviewPosition, actionId: null }); + onReviewProblem?.({ ...reviewPosition, actionId: null }, "slice"); return; } const note = parsedQAComments.find( diff --git a/src/components/FinalAcceptanceWorkspace.tsx b/src/components/FinalAcceptanceWorkspace.tsx index 8cec2049..cc6e8065 100644 --- a/src/components/FinalAcceptanceWorkspace.tsx +++ b/src/components/FinalAcceptanceWorkspace.tsx @@ -89,7 +89,7 @@ export function FinalAcceptanceWorkspace({ onReviewController, onReviewProblem, onReviewSave, - onReviewProblemNavigate, + onReviewTargetSwitch, onReviewTimestampJump, onReviewProblemEdit, onReviewProblemDelete, @@ -551,8 +551,8 @@ export function FinalAcceptanceWorkspace({ const position = finalController.pauseAndLocate(); if (position) onReviewProblem?.(position); } else if (command === "save-note") onReviewSave?.(); - else if (command === "previous-problem" || command === "next-problem") - onReviewProblemNavigate?.(command === "previous-problem" ? -1 : 1); + else if (command === "previous-target" || command === "next-target") + onReviewTargetSwitch?.(command === "previous-target" ? -1 : 1); else if (command === "jump-timestamp-problem") onReviewTimestampJump?.(); else if (command === "edit-problem") onReviewProblemEdit?.(); else if (command === "delete-problem") onReviewProblemDelete?.(); @@ -670,7 +670,7 @@ export function FinalAcceptanceWorkspace({ onReviewPositionChange={mappedPosition} onReviewProblem={(position) => onReviewProblem?.(mapReviewPosition(position))} onReviewSave={onReviewSave} - onReviewProblemNavigate={onReviewProblemNavigate} + onReviewTargetSwitch={onReviewTargetSwitch} onReviewTimestampJump={onReviewTimestampJump} onReviewProblemEdit={onReviewProblemEdit} onReviewProblemDelete={onReviewProblemDelete} diff --git a/src/components/ReviewProblemPanel.tsx b/src/components/ReviewProblemPanel.tsx index a6757801..b2f807b7 100644 --- a/src/components/ReviewProblemPanel.tsx +++ b/src/components/ReviewProblemPanel.tsx @@ -11,19 +11,16 @@ type Props = { focusedProblemId?: string | null; }; const names = { task: "整体意见", slice: "当前切片意见", action: "当前动作意见", timestamp: "时间点意见" }; -const scopes = { task: "整体", slice: "切片", action: "动作", timestamp: "时间点" }; +// 票 07(D5 修订版):常驻编辑区的目标档位标签——切到哪档显示哪档。 +const targetTierNames = { slice: "当前切片", action: "当前动作", timestamp: "当前时间点" }; export function ReviewProblemPanel({ review, label, writeLocked = false, focusedProblemId = null }: Props) { const locked = writeLocked || !review.writable || review.loading || !review.draft; - const scopeRef = useRef(null), - clearRef = useRef(null); - useLayoutEffect(() => { - scopeRef.current?.querySelector('[aria-checked="true"]')?.focus(); - }, [review.scopePicker]); + const clearRef = useRef(null); useLayoutEffect(() => { if (review.confirmClear) clearRef.current?.querySelector("[data-cancel]")?.focus(); }, [review.confirmClear]); - // D5(票 05):编辑器常驻内联——无打开编辑器时绑定默认作用域(按当前目标自动匹配)。 - const resident = review.editor || review.scopePicker || review.confirmClear || locked ? null : review.residentEditor; + // 票 07:编辑器常驻内联,绑定当前所选目标档(未选按画面默认);无弹层。 + const resident = review.editor || review.confirmClear || locked ? null : review.residentEditor; return (
review.selectScope(card.scope, true)} ref={cardFocused ? (node) => node?.scrollIntoView({ block: "nearest" }) : undefined} @@ -112,49 +109,13 @@ export function ReviewProblemPanel({ review, label, writeLocked = false, focused
- {review.scopePicker && ( -
{ - if (e.nativeEvent.isComposing || e.keyCode === 229 || e.repeat) return; - e.stopPropagation(); - if (e.key === "ArrowUp" || e.key === "ArrowDown") { - e.preventDefault(); - review.moveScope(e.key === "ArrowUp" ? -1 : 1); - } else if (e.key === "Enter" || e.key === " ") { - e.preventDefault(); - review.confirmScope(); - } else if (e.key === "Escape") { - e.preventDefault(); - review.cancelScope(); - } - }} - > - {(review.scopeChoices ?? review.cards.map((c) => c.scope)).map((scope) => ( - - ))} -
- )} {review.editor ? ( <>

@@ -208,7 +169,7 @@ export function ReviewProblemPanel({ review, label, writeLocked = false, focused resident && ( <>

- 当前对象:{label(resident.target)} + 当前目标:{targetTierNames[resident.scope]} · {label(resident.target)}