rig-review 4.0.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/DESIGN.md +19 -0
- package/package.json +1 -1
- package/src/compare-html.ts +5 -5
- package/web/animation-inspection.ts +2 -0
- package/web/catalog-en.ts +18 -3
- package/web/catalog-ko.ts +39 -24
- package/web/compare-picked-tools.ts +1 -0
- package/web/compare.css +2 -4
- package/web/compare.html +1 -1
- package/web/compare.ts +2 -1
- package/web/inspection-persistence.ts +5 -3
- package/web/inspector-blocks.ts +112 -38
- package/web/interview-panel.ts +10 -3
- package/web/job-rig-screen.ts +3 -3
- package/web/job-session.ts +27 -57
- package/web/main.ts +167 -35
- package/web/part-selection.ts +5 -0
- package/web/parts-viewport-provider.ts +18 -8
- package/web/stage-comments.ts +16 -10
- package/web/styles.css +117 -39
- package/web/view-controls.ts +22 -11
- package/web/workspace-ui.ts +8 -6
package/web/catalog-ko.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export const koCatalog: Readonly<Record<string, string>> = {
|
|
2
|
+
'Question': '질문',
|
|
3
|
+
"Answer saved": "저장됨",
|
|
4
|
+
"Approve": "승인",
|
|
5
|
+
"Request changes": "수정 요청",
|
|
6
|
+
"Approve\u2026": "승인하기",
|
|
7
|
+
"Answer\u2026": "답하기",
|
|
8
|
+
"Review\u2026": "검토하기",
|
|
9
|
+
"Nothing is waiting for your answer.": "답변을 기다리는 요청이 없어요.",
|
|
10
|
+
"Add a comment where changes are needed.": "고칠 곳에 코멘트를 달아 주세요",
|
|
11
|
+
"Remove the flagged parts comments before approving.": "승인하려면 수정 요청한 파츠 코멘트를 먼저 지워 주세요.",
|
|
12
|
+
"Saved draft could not be restored. Your draft has not been deleted. Download or discard it before submitting.": "저장해 둔 초안을 불러오지 못했어요. 초안은 지워지지 않았어요. 내려받거나 버린 뒤에 제출해 주세요.",
|
|
13
|
+
"Saved draft downloaded \u00b7 not submitted": "저장해 둔 초안을 내려받았어요 · 아직 제출하지 않았어요",
|
|
2
14
|
"JOB_DIRECTION_MISSING": "JOB_DIRECTION_MISSING",
|
|
3
15
|
"job.refusal.JOB_DIRECTION_MISSING": "이 게시물에는 디렉션이 없습니다. 제작 도구에서 모델과 함께 디렉션 데이터를 게시해야 합니다.",
|
|
4
16
|
"JOB_PARTS_MISSING": "JOB_PARTS_MISSING",
|
|
@@ -23,6 +35,8 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
23
35
|
'rig review ': 'rig review ',
|
|
24
36
|
'Language ': '언어 ',
|
|
25
37
|
'More act actions': '작업 더 보기',
|
|
38
|
+
'More tabs': '탭 더 보기',
|
|
39
|
+
'Inspection': '검사',
|
|
26
40
|
'View switch': '뷰 전환',
|
|
27
41
|
'One CSS pixel per current pane coordinate unit; synchronized panes retain relative zoom.': '현재 뷰 좌표 단위당 CSS 픽셀 하나입니다. 동기화된 뷰는 상대 배율을 유지합니다.',
|
|
28
42
|
'1:1 · one CSS pixel per model coordinate unit.': '1:1 · 모델 좌표 단위당 CSS 픽셀 하나입니다.',
|
|
@@ -50,7 +64,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
50
64
|
"Review targets": "검토 대상",
|
|
51
65
|
"Inspection only": "살펴보기 전용",
|
|
52
66
|
"Review target": "검토 대상",
|
|
53
|
-
"Select a target. Drafts stay with their original source.": "대상을
|
|
67
|
+
"Select a target. Drafts stay with their original source.": "대상을 선택해 주세요. 초안은 원래 소스에 보관돼요.",
|
|
54
68
|
"FRONT_QUERY_REFUSED": "FRONT_QUERY_REFUSED",
|
|
55
69
|
"Korean": "한국어",
|
|
56
70
|
"WORKSPACE_BODY_LIMIT": "WORKSPACE_BODY_LIMIT",
|
|
@@ -92,34 +106,34 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
92
106
|
"INTERVIEW_OPTIONS_STALE": "INTERVIEW_OPTIONS_STALE: 프로젝트 또는 원본이 바뀌었어요. 검토를 다시 여세요.",
|
|
93
107
|
"INTERVIEW_CONTEXT_KIND_UNSUPPORTED": "INTERVIEW_CONTEXT_KIND_UNSUPPORTED: 지원하지 않는 선택지 문맥 유형입니다.",
|
|
94
108
|
"INTERVIEW_OPTIONS_SCENE_LEGACY": "INTERVIEW_OPTIONS_SCENE_LEGACY: 이전 규칙의 장면 문맥을 읽었습니다. 새 작업 전에 현재 문맥으로 선택지를 다시 준비하세요.",
|
|
95
|
-
"interview.historicalIssue": "INTERVIEW_OPTIONS_STALE: 이 과거 기록의 문맥을 검증할 수
|
|
109
|
+
"interview.historicalIssue": "INTERVIEW_OPTIONS_STALE: 이 과거 기록의 문맥을 검증할 수 없어요.",
|
|
96
110
|
"interview.joinedDraft": "초안 {0} · 프로젝트 {1} · 원본 {2}",
|
|
97
111
|
"interview.joined": "Create 버전 {0} · 프로젝트 SHA-256 {1} · 검토 SHA-256 {2}",
|
|
98
112
|
"interview.mismatch": "INTERVIEW_SOURCE_MISMATCH: 검토 대상이 지정한 Create 패키지와 일치하지 않아요.",
|
|
99
|
-
"interview.imageUnavailable": "INTERVIEW_IMAGE_INVALID: 바인딩된 이미지를 표시할 수
|
|
113
|
+
"interview.imageUnavailable": "INTERVIEW_IMAGE_INVALID: 바인딩된 이미지를 표시할 수 없어요.",
|
|
100
114
|
"interview.legacy": "기존 서술형 답변",
|
|
101
|
-
"interview.partsUnavailable": "보관된 초안 파츠 파일을 읽을 수
|
|
115
|
+
"interview.partsUnavailable": "보관된 초안 파츠 파일을 읽을 수 없어요.",
|
|
102
116
|
"interview.title": "Create 인터뷰",
|
|
103
117
|
"interview.language": "언어",
|
|
104
118
|
"interview.loading": "인터뷰를 불러오는 중…",
|
|
105
|
-
"interview.invalid": "이 세트에서
|
|
119
|
+
"interview.invalid": "이 세트에서 고를 수 없는 선택이에요.",
|
|
106
120
|
"interview.constraint": "허용되는 조합을 선택하세요.",
|
|
107
|
-
"interview.required": "Create에서 선택지 세트를 준비해야
|
|
108
|
-
"interview.invalidOptions": "선택지 세트가 유효하지
|
|
109
|
-
"interview.file": "보관된 선택지 파일을 읽을 수
|
|
121
|
+
"interview.required": "Create에서 선택지 세트를 준비해야 해요.",
|
|
122
|
+
"interview.invalidOptions": "선택지 세트가 유효하지 않아요.",
|
|
123
|
+
"interview.file": "보관된 선택지 파일을 읽을 수 없어요.",
|
|
110
124
|
"interview.stale": "프로젝트, 검토 패키지 또는 선택지의 근거가 바뀌었어요. 인터뷰를 다시 여세요.",
|
|
111
|
-
"interview.output": "선택 기록 출력 경로를
|
|
125
|
+
"interview.output": "선택 기록 출력 경로를 쓸 수 없거나 입력과 충돌해요.",
|
|
112
126
|
"interview.failed": "인터뷰 요청에 실패했습니다.",
|
|
113
127
|
"interview.empty": "이 프로젝트에 보관된 선택지 세트가 없습니다.",
|
|
114
128
|
"interview.question": "인터뷰 질문",
|
|
115
129
|
"interview.history": "이전 답변",
|
|
116
130
|
"interview.parts": "바인딩된 파츠",
|
|
117
131
|
"interview.source": "바인딩된 원본",
|
|
118
|
-
"interview.noParts": "이 세트에 바인딩된 분리 파츠가
|
|
132
|
+
"interview.noParts": "이 세트에 바인딩된 분리 파츠가 없어요.",
|
|
119
133
|
"interview.provenance": "작성자 {0} · {1}",
|
|
120
134
|
"interview.other": "원하는 선택을 설명하세요",
|
|
121
|
-
"interview.otherPending": "맞춤 세트가
|
|
122
|
-
"interview.autoPending": "에이전트가
|
|
135
|
+
"interview.otherPending": "맞춤 세트가 나오고 직접 고를 때까지 기타 응답은 보류돼요.",
|
|
136
|
+
"interview.autoPending": "에이전트가 그 결정을 기록할 때까지 자동 위임은 보류돼요.",
|
|
123
137
|
"job.plan.does": "할 일",
|
|
124
138
|
"job.plan.produces": "산출물",
|
|
125
139
|
"job.plan.bar": "기준",
|
|
@@ -142,7 +156,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
142
156
|
"interview.note": "메모 (선택 사항)",
|
|
143
157
|
"interview.save": "선택 기록 저장",
|
|
144
158
|
"interview.unsaved": "저장하지 않은 변경 사항이 있습니다.",
|
|
145
|
-
"interview.saved": "선택 기록을
|
|
159
|
+
"interview.saved": "선택 기록을 저장했어요.",
|
|
146
160
|
"interview.choose": "각 질문에서 하나씩 직접 선택한 뒤 저장하세요.",
|
|
147
161
|
"interview.readOnly": "읽기 전용입니다. 선택 기록을 저장하려면 실행 시 표시된 URL을 여세요.",
|
|
148
162
|
"interview.answered": "답변 {0} / {1}",
|
|
@@ -200,6 +214,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
200
214
|
"INTERVIEW_UNAVAILABLE: No interview is attached to this inspection.": "INTERVIEW_UNAVAILABLE: 이 검토에 연결된 인터뷰가 없어요.",
|
|
201
215
|
"DIRECTION_SOURCE_CHANGED: undeclared playback input": "DIRECTION_SOURCE_CHANGED: 선언되지 않은 재생 입력입니다.",
|
|
202
216
|
"DIRECTION_SOURCE_CHANGED: playback bytes differ from the bound SHA-256": "DIRECTION_SOURCE_CHANGED: 재생 입력의 SHA-256이 기록된 값과 다릅니다.",
|
|
217
|
+
"Take · {0} s": "테이크 · {0}초",
|
|
203
218
|
"direction.title": "연출 검사",
|
|
204
219
|
'direction.planes': '합성 레이어: {0}',
|
|
205
220
|
'direction.threePlanes': '배경 → 인물 → 전경',
|
|
@@ -2980,6 +2995,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
2980
2995
|
"{0} · folds: not run": "{0} · 접힘(folds): 실행 안 됨",
|
|
2981
2996
|
"{0} · key {1}": "{0} · 단축키 {1}",
|
|
2982
2997
|
"{0} · picture-px / top-left / y↓ · {1} frames{2}": "{0} · picture-px / 좌상단 / y↓ · {1}프레임{2}",
|
|
2998
|
+
"{0} · repeating": "{0} · 반복 재생 중",
|
|
2983
2999
|
"{0} · review F{1}": "{0} · 리뷰 F{1}",
|
|
2984
3000
|
"{0} · rig review": "{0} · 리그 리뷰",
|
|
2985
3001
|
"{0} · rig review compare": "{0} · 리그 리뷰 비교",
|
|
@@ -3212,7 +3228,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3212
3228
|
"Review this checkpoint.": "이 체크포인트를 검토해 주세요.",
|
|
3213
3229
|
"Approve this stage.": "이 단계를 승인해 주세요.",
|
|
3214
3230
|
"Review the reopened stage.": "다시 열린 단계를 검토해 주세요.",
|
|
3215
|
-
"Comments": "코멘트
|
|
3231
|
+
"Comments": "코멘트",
|
|
3216
3232
|
"Read only · Escape closes": "읽기 전용 · Escape로 닫기",
|
|
3217
3233
|
"Mark a point or region, then type. Enter saves · Escape cancels.": "점이나 영역을 표시한 뒤 입력하세요. Enter로 저장 · Escape로 취소.",
|
|
3218
3234
|
"Comment composer": "코멘트 작성기",
|
|
@@ -3427,7 +3443,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3427
3443
|
"This job was explicitly closed.": "이 작업은 명시적으로 종료되었습니다.",
|
|
3428
3444
|
"The next result could not be displayed. The previous result is still shown.": "다음 결과를 표시하지 못했습니다. 이전 결과를 계속 표시합니다.",
|
|
3429
3445
|
"The previous selection is unavailable in this result.": "이 결과에서 이전 선택 항목을 사용할 수 없습니다.",
|
|
3430
|
-
"Human action saved.": "사용자 작업을
|
|
3446
|
+
"Human action saved.": "사용자 작업을 저장했어요.",
|
|
3431
3447
|
"Updated from {0} to {1}.": "{0}에서 {1}(으)로 업데이트되었습니다.",
|
|
3432
3448
|
"Approved · Next step": "승인됨 · 다음 단계",
|
|
3433
3449
|
"Reviewing · {0} issues": "검수 중 · 이슈 {0}",
|
|
@@ -3443,7 +3459,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3443
3459
|
"job.retained": "이 초안은 {0}에 속합니다. 원래 소스에 연결된 채로 보관됩니다.",
|
|
3444
3460
|
"job.saveCheckpoint": "체크포인트 결과 저장",
|
|
3445
3461
|
"job.savePartsVerdict": "파츠 판정 저장",
|
|
3446
|
-
"job.saved": "사용자 작업을
|
|
3462
|
+
"job.saved": "사용자 작업을 저장했어요.",
|
|
3447
3463
|
"job.openPlanStep": "계획 단계 보기",
|
|
3448
3464
|
"job.openPlan": "계획 보기",
|
|
3449
3465
|
"job.signoff": "단계 승인 저장",
|
|
@@ -3493,7 +3509,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3493
3509
|
"job.submit.JOB_STILL_UNAVAILABLE": "보존된 리그 이미지를 사용할 수 없어요 — 현재 리그 리뷰를 다시 열고 제출해 주세요.",
|
|
3494
3510
|
"job.submit.JOB_STILL_OUTPUT_FAILED": "리그 이미지를 저장하지 못했어요 — 호스트 담당자에게 출력 위치 확인을 요청해 주세요.",
|
|
3495
3511
|
"Review was not submitted: {0}": "리뷰가 제출되지 않았어요: {0}",
|
|
3496
|
-
"JOB_CAPABILITY_REQUIRED": "
|
|
3512
|
+
"JOB_CAPABILITY_REQUIRED": "이 페이지의 접근 권한이 만료됐어요. 에이전트에게 작업을 다시 열어 달라고 요청해 주세요.",
|
|
3497
3513
|
"JOB_CLOSED": "JOB_CLOSED",
|
|
3498
3514
|
"JOB_CURSOR_INVALID": "JOB_CURSOR_INVALID",
|
|
3499
3515
|
"JOB_DISPLAY_MISMATCH": "JOB_DISPLAY_MISMATCH",
|
|
@@ -3554,12 +3570,11 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3554
3570
|
"PARTS_VERDICT_LEGACY_FORMAT": "PARTS_VERDICT_LEGACY_FORMAT",
|
|
3555
3571
|
"JOB_PANEL_UNKNOWN: {0}": "JOB_PANEL_UNKNOWN: {0}",
|
|
3556
3572
|
"STAGE_DRAFT_OPERATION: only applied mesh corrections belong to this inspection": "STAGE_DRAFT_OPERATION: 이 점검에서는 적용된 메시 보정만 지원합니다",
|
|
3557
|
-
"JOB_PANELS_INVALID": "JOB_PANELS_INVALID · 게시 데이터에 맞는 기본 패널 구성을
|
|
3573
|
+
"JOB_PANELS_INVALID": "JOB_PANELS_INVALID · 게시 데이터에 맞는 기본 패널 구성을 사용해요.",
|
|
3558
3574
|
"JOB_PANEL_UNKNOWN": "JOB_PANEL_UNKNOWN · 알 수 없는 컴포넌트 {0}.",
|
|
3559
|
-
"
|
|
3560
|
-
"
|
|
3561
|
-
"
|
|
3562
|
-
"JOB_PARTS_LEGACY_DRAFT": "JOB_PARTS_LEGACY_DRAFT · 이전 형식으로 저장됐어. 파츠별 판정과 메모는 읽기 전용이야.",
|
|
3575
|
+
"JOB_PANEL_OUTPUT_MISSING": "JOB_PANEL_OUTPUT_MISSING · 제출에 필요한 컴포넌트 출력이 없어요.",
|
|
3576
|
+
"JOB_PARTS_SIGNOFF_MISSING": "JOB_PARTS_SIGNOFF_MISSING · 파츠 검수 단계 서명 요청이 없어요.",
|
|
3577
|
+
"JOB_PARTS_LEGACY_DRAFT": "JOB_PARTS_LEGACY_DRAFT · 이전 형식으로 저장됐어요. 파츠별 판정과 메모는 읽기 전용이에요.",
|
|
3563
3578
|
"job.partsApprove": "파츠 승인 및 단계 서명",
|
|
3564
3579
|
"job.partsRequestFixes": "수정 요청 보내기 (이슈 {0})",
|
|
3565
3580
|
"job.partsRetrySignoff": "단계 서명 다시 보내기",
|
|
@@ -3569,7 +3584,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3569
3584
|
"job.parts.sent": "수정 요청 보냄 · 새 드래프트 대기 중",
|
|
3570
3585
|
"job.parts.approved": "파츠 단계 승인 완료 · 다음은 리깅 인터뷰",
|
|
3571
3586
|
"job.parts.retry-signoff": "파츠 판정 저장됨 · 단계 서명 재시도 필요",
|
|
3572
|
-
"PARTS_COMMENT_STALE_SOURCE": "PARTS_COMMENT_STALE_SOURCE · 이슈 출처와 원본 증거에 묶인 출처가
|
|
3587
|
+
"PARTS_COMMENT_STALE_SOURCE": "PARTS_COMMENT_STALE_SOURCE · 이슈 출처와 원본 증거에 묶인 출처가 달라요.",
|
|
3573
3588
|
"PARTS_WORKSPACE_NODE_REQUIRED: {0}": "PARTS_WORKSPACE_NODE_REQUIRED: 작업 공간 요소 {0}이(가) 필요합니다.",
|
|
3574
3589
|
"PARTS_WORKSPACE_NODE_REQUIRED: stage-comment": "PARTS_WORKSPACE_NODE_REQUIRED: 코멘트 버튼이 필요합니다.",
|
|
3575
3590
|
"PARTS_WORKSPACE_SLOT_REQUIRED": "PARTS_WORKSPACE_SLOT_REQUIRED · 작업 공간 슬롯이 필요합니다.",
|
|
@@ -3577,7 +3592,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3577
3592
|
"PARTS_WORKSPACE_DISPOSED": "PARTS_WORKSPACE_DISPOSED · 첫 화면을 그리기 전에 파츠 작업 공간이 닫혔습니다.",
|
|
3578
3593
|
"PARTS_JOINED_ISSUE_UNSUPPORTED": "PARTS_JOINED_ISSUE_UNSUPPORTED · 이슈는 상시 잡 리뷰 경로(/jobs/<jobId>/)에서 등록해 주세요. 연결된 점검 페이지에서는 이슈 없는 승인을 지원합니다.",
|
|
3579
3594
|
"Issues": "이슈",
|
|
3580
|
-
"No
|
|
3595
|
+
"No comments yet.": "아직 코멘트가 없어요.",
|
|
3581
3596
|
"Assembled parts": "조립된 파츠",
|
|
3582
3597
|
"{count} parts": "파츠 {count}개",
|
|
3583
3598
|
"PARTS_RIG_UNAVAILABLE: this parts subject has no compiled rig.": "PARTS_RIG_UNAVAILABLE: 이 파츠에는 컴파일된 리그가 없어요.",
|
|
@@ -428,6 +428,7 @@ export function mountComparePickedTools(host: ComparePickedToolsHost): ComparePi
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
function syncModeButtons(): void {
|
|
431
|
+
button('play').hidden = workspaceMode !== 'animate';
|
|
431
432
|
const expected = workspaceMode === 'setup' ? 'rig' : workspaceMode === 'animate' ? 'playback' : 'compare';
|
|
432
433
|
for (const btn of document.querySelectorAll<HTMLButtonElement>('.mode-switch [data-mode]')) {
|
|
433
434
|
btn.setAttribute('aria-pressed', String(btn.dataset.mode === expected));
|
package/web/compare.css
CHANGED
|
@@ -180,10 +180,8 @@ main{position:relative}.viewbar,.toolbar{anchor-name:--stage-comment-bar}#stage-
|
|
|
180
180
|
.applied-list li{font:9.5px/16px var(--font-mono);white-space:nowrap;flex:none}
|
|
181
181
|
#applied-status{margin:0;flex:0 1 auto;min-width:0;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
182
182
|
.inspector #inspector-playback{padding:3px 10px;box-sizing:border-box}
|
|
183
|
-
.
|
|
184
|
-
.
|
|
185
|
-
.animate-blocks-panel{min-width:0;min-height:0;height:100%;overflow-y:auto;overflow-x:hidden;padding:12px 15px;box-sizing:border-box;border-left:1px solid var(--border);overscroll-behavior:contain}
|
|
186
|
-
.inspector #inspector-playback .animate-blocks-panel>.block-row{top:-12px;margin:-12px -15px 8px;padding:4px 15px}
|
|
183
|
+
.animation-dock-panel{display:flex;flex-direction:column;gap:2px;min-width:0;min-height:0}
|
|
184
|
+
.inspector #inspector-playback>.block-row{top:-3px;margin:-3px -10px 8px;padding:4px 10px}
|
|
187
185
|
.inspector #inspector-playback .transport{padding:0;gap:5px;flex-wrap:nowrap;height:22px;min-height:22px;align-items:center}
|
|
188
186
|
.inspector #inspector-playback .transport select{padding:1px 5px;height:20px}
|
|
189
187
|
.inspector #inspector-playback .transport button{padding:1px 7px;height:20px;font-size:11px}
|
package/web/compare.html
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
<template data-workspace-header></template>
|
|
4
4
|
<div class="layout"><main><div class="toolbar"><template data-workspace-comment></template><span id="toolbar-mode-hint">Inspect A and B at the reference video time</span><template data-workspace-view-tools></template><template data-workspace-camera></template></div><!-- shared:stage-bars -->
|
|
5
5
|
<div id="stage-layout" class="stages"><section id="reference-pane" class="pane"><div class="pane-head"><strong>REFERENCE</strong><span id="reference-name"></span></div><div id="reference-viewport" class="reference-viewport"><video id="reference-video" preload="auto" playsinline muted></video><p id="reference-empty" class="empty">Loading reference video…</p></div><div class="pane-foot"><span id="reference-time">— s</span><label><input id="reference-audio" type="checkbox">Video audio</label></div></section><section id="a-pane" class="pane"><div class="pane-head"><strong class="side-label">A</strong><span id="a-title"></span></div><div id="a-viewport" class="rig-viewport"><div id="a-root" class="rig-root"></div><canvas id="a-overlay" class="rig-overlay" aria-label="A actual rig mesh and bone overlay"></canvas><!-- shared:stage-handles --><p id="a-empty" class="empty">Loading rig…</p></div><div class="pane-foot"><span id="a-time">— s</span><span id="a-frame">rate unknown</span><span id="a-renderer" aria-label="A last draw backend" title="DOM images for rigid parts; WebGL meshes when available, Canvas2D fallback.">Not rendered</span></div></section><section id="b-pane" class="pane"><div class="pane-head"><strong class="side-label">B</strong><span id="b-title"></span></div><div id="b-viewport" class="rig-viewport"><div id="b-root" class="rig-root"></div><canvas id="b-overlay" class="rig-overlay" aria-label="B actual rig mesh and bone overlay"></canvas><p id="b-empty" class="empty">Loading rig…</p></div><div class="pane-foot"><span id="b-time">— s</span><span id="b-frame">rate unknown</span><span id="b-renderer" aria-label="B last draw backend" title="DOM images for rigid parts; WebGL meshes when available, Canvas2D fallback.">Not rendered</span></div></section></div>
|
|
6
|
-
<section class="inspector" aria-label="Inspection controls"><div class="inspector-heading"><strong>INSPECTOR</strong><div role="tablist" aria-label="Inspector sections"><button role="tab" id="tab-view" data-inspector="view" aria-controls="inspector-view" aria-selected="true" tabindex="0">View</button><button role="tab" id="tab-rig" data-inspector="rig" aria-controls="inspector-rig" aria-selected="false" tabindex="-1">Rig</button><button role="tab" id="tab-playback" data-inspector="playback" aria-controls="inspector-playback" aria-selected="false" tabindex="-1">Playback</button><button role="tab" id="tab-feedback" data-inspector="feedback" aria-controls="inspector-feedback" aria-selected="false" tabindex="-1">Feedback</button></div><span class="hint">Local view controls · source files stay unchanged</span></div><div class="draft-notice"><span id="draft-state" role="status" aria-live="polite"></span><div id="draft-recovery"></div></div><div class="inspector-body"><!-- shared:applied-records --><section id="inspector-view" role="tabpanel" aria-labelledby="tab-view" data-inspector-panel="view"><div class="view-link-controls"><button id="copy-view" type="button">Copy view link</button><span class="hint">Numeric source region · opening this link restores a paused inspection</span></div><pre id="view-coordinates" class="numeric-view" aria-label="Current numeric inspection region"></pre><div class="inspection-controls" aria-label="Inspection display controls"><label>Appearance <select id="appearance"><option value="system">System</option><option value="dark">Dark</option><option value="light">Light</option></select></label><label><input id="idle-repeat" type="checkbox" checked>Repeat idle</label><span id="idle-state" class="hint" role="status">Idle preview unavailable</span><span id="control-state" class="hint" role="status"></span></div><p class="hint">Sync cameras links fit-relative zoom and viewport-relative pan across visible panes. Turn it off for independent Reference, A and B views. Toolbar zoom and Fit use the last active pane.</p></section><section id="inspector-rig" role="tabpanel" aria-labelledby="tab-rig" data-inspector-panel="rig" hidden><!-- shared:setup-block-row --><section id="selected-part" role="tabpanel" aria-labelledby="block-tab-selected-part" aria-label="Selected part" aria-live="polite"></section><div class="rig-layer-controls"><template data-workspace-layers></template><span id="layer-state" class="hint">No rig supplied</span></div><p id="rig-inspector-hint" class="hint">These controls show actual images, last-drawn mesh edges and named bone points. Both builds use the fixed animation named above. This inspector does not author geometry or motion.</p><!-- shared:setup-panels --></section><section id="inspector-playback" role="tabpanel" aria-labelledby="tab-playback" data-inspector-panel="playback" hidden
|
|
6
|
+
<section class="inspector" aria-label="Inspection controls"><div class="inspector-heading"><strong>INSPECTOR</strong><div role="tablist" aria-label="Inspector sections"><button role="tab" id="tab-view" data-inspector="view" aria-controls="inspector-view" aria-selected="true" tabindex="0">View</button><button role="tab" id="tab-rig" data-inspector="rig" aria-controls="inspector-rig" aria-selected="false" tabindex="-1">Rig</button><button role="tab" id="tab-playback" data-inspector="playback" aria-controls="inspector-playback" aria-selected="false" tabindex="-1">Playback</button><button role="tab" id="tab-feedback" data-inspector="feedback" aria-controls="inspector-feedback" aria-selected="false" tabindex="-1">Feedback</button></div><span class="hint">Local view controls · source files stay unchanged</span></div><div class="draft-notice"><span id="draft-state" role="status" aria-live="polite"></span><div id="draft-recovery"></div></div><div class="inspector-body"><!-- shared:applied-records --><section id="inspector-view" role="tabpanel" aria-labelledby="tab-view" data-inspector-panel="view"><div class="view-link-controls"><button id="copy-view" type="button">Copy view link</button><span class="hint">Numeric source region · opening this link restores a paused inspection</span></div><pre id="view-coordinates" class="numeric-view" aria-label="Current numeric inspection region"></pre><div class="inspection-controls" aria-label="Inspection display controls"><label>Appearance <select id="appearance"><option value="system">System</option><option value="dark">Dark</option><option value="light">Light</option></select></label><label><input id="idle-repeat" type="checkbox" checked>Repeat idle</label><span id="idle-state" class="hint" role="status">Idle preview unavailable</span><span id="control-state" class="hint" role="status"></span></div><p class="hint">Sync cameras links fit-relative zoom and viewport-relative pan across visible panes. Turn it off for independent Reference, A and B views. Toolbar zoom and Fit use the last active pane.</p></section><section id="inspector-rig" role="tabpanel" aria-labelledby="tab-rig" data-inspector-panel="rig" hidden><!-- shared:setup-block-row --><section id="selected-part" role="tabpanel" aria-labelledby="block-tab-selected-part" aria-label="Selected part" aria-live="polite"></section><div class="rig-layer-controls"><template data-workspace-layers></template><span id="layer-state" class="hint">No rig supplied</span></div><p id="rig-inspector-hint" class="hint">These controls show actual images, last-drawn mesh edges and named bone points. Both builds use the fixed animation named above. This inspector does not author geometry or motion.</p><!-- shared:setup-panels --></section><section id="inspector-playback" role="tabpanel" aria-labelledby="tab-playback" data-inspector-panel="playback" hidden><!-- shared:animate-block-row --><div id="animation-dock" class="animation-dock-panel" role="tabpanel" aria-labelledby="block-tab-animation-dock" aria-label="Animation timeline"><section id="transport" class="transport"><button id="play" aria-label="Play reference video and both rigs" disabled>▶</button><input id="scrub" type="range" min="0" max="1" step="0.0001" value="0" aria-label="Shared comparison time" disabled><output id="time">— / — s</output><label for="time-input" class="sr-only">Reference video time to inspect</label><input id="time-input" type="number" min="0" step="0.0001" placeholder="Seconds" disabled><button id="seek" disabled>Go to time</button><!-- shared:transport-strips --></section><section id="animation-inspection" aria-label="Read-only animation inspection"></section></div><section id="compare-transport-context"><div class="compare-info"><output id="sync-status">Presentation pending</output><span id="sync-warning"></span></div><div class="compare-info"><label for="frame-basis">Review frame</label><select id="frame-basis"><option value="a">A explicit samples</option><option value="b">B explicit samples</option></select><input id="frame-input" type="number" min="0" step="1" aria-label="Explicit producer frame" disabled><button id="frame-seek" type="button" disabled>Inspect frame</button><span id="frame-index-status">Loading reference timestamp index…</span></div><div class="compare-info"><span id="domain">Checking shared playback range…</span><span id="clock-source">Waiting for video time</span></div><details class="trace"><summary>Synchronization trace</summary><pre id="trace">No frame presented yet.</pre></details><p id="playback-inspector-hint" class="boundary">Motion is read only. The reference video FPS is not used to infer the pose frame clock.</p></section><!-- shared:animate-panels --></section><section id="inspector-feedback" role="tabpanel" aria-labelledby="tab-feedback" data-inspector-panel="feedback" hidden><div class="review-summary"><div class="eyebrow">COMPARE REVIEW</div><label for="status">Review status</label><select id="status"><option value="pending">Pending</option><option value="approved">Approved</option><option value="changes-requested">Changes requested</option></select><section class="provenance"><h2>Source provenance</h2><div id="provenance-brief"></div><details><summary>Both builds, versions and reference video hash</summary><pre id="provenance-full"></pre></details></section></div><section class="feedback-form"><h2>Frame-range feedback</h2><label for="side">Target build</label><select id="side"><option value="">Select A or B</option><option value="a">A</option><option value="b">B</option></select><div class="frame-range"><label>Start frame<input id="frame-start" type="number" min="0" step="1" inputmode="numeric"></label><label>End frame<input id="frame-end" type="number" min="0" step="1" inputmode="numeric"></label></div><p id="feedback-range-hint" class="hint">Select A or B to check frame bounds.</p><label for="target-kind">Target type</label><select id="target-kind"><option value="">Select</option><option value="bone">Bone</option><option value="slot">Slot</option><option value="rig">Entire rig</option></select><label for="target-name">Actual target name</label><input id="target-name" type="text" list="target-names" autocomplete="off"><datalist id="target-names"></datalist><p id="target-hint" class="hint">Select a target build and type.</p><label for="category">Category</label><select id="category"><option value="">Select</option><option value="defect">Defect</option><option value="quality">Quality</option></select><label for="summary">One-line summary</label><input id="summary" type="text" maxlength="1000" placeholder="What looks wrong, and over which frames?"><button id="add-feedback" class="block" disabled>Add feedback</button><p id="feedback-warnings" class="hint" role="status" hidden></p><div id="feedback-list"></div></section><details id="strip-panel" class="trace"><summary>Export frame strip</summary><p class="hint">Uses the feedback form start and end frames, inclusive. Exports Reference / A / B rows without changing inspection time.</p><label for="strip-scope">Export range</label><select id="strip-scope"><option value="interval">Entered start–end frames</option><option value="feedback">All feedback ranges</option></select><label for="strip-basis">Report defining the range frames</label><select id="strip-basis"><option value="">Select A or B as frame basis</option><option value="a">A report frameTimes</option><option value="b">B report frameTimes</option></select><label for="strip-format">Format</label><select id="strip-format"><option value="png">PNG strip</option><option value="json">JSON frames and provenance</option></select><p class="hint">The same frame number in A and B is not assumed to mean the same time. Batch export uses each feedback side as its frame basis. Without frameTimes, PNG is refused and JSON preserves time: null.</p><button id="strip-export" type="button" disabled>Download strip</button><p id="strip-status" class="hint" role="status" aria-live="polite">Loading comparison provenance…</p></details></section></div></section></main><aside id="parts-explorer" class="parts-explorer" aria-label="Parts explorer"><div class="parts-tools"><h2>PARTS</h2><button type="button" data-part-whole aria-pressed="true">Whole rig</button><label for="part-search">Find slot</label><input id="part-search" data-part-search type="search" autocomplete="off" placeholder="Exact slot name or text"><label class="part-solo"><input id="part-solo" data-part-solo type="checkbox" disabled>Solo selected slot</label><p data-part-status class="hint" role="status">Loading actual slots…</p></div><ul data-part-list aria-label="Actual rig slots"></ul><p class="hint">Select in context or enable Solo. Thumbnails are each slot's declared page region; a type icon stands in where the model declares none. Atlas pages are not part thumbnails.</p></aside>
|
|
7
7
|
</div><footer><span id="message" role="status" aria-live="polite">Loading comparison provenance from the server…</span><span>Source files remain unchanged.</span></footer><script type="module" src="main.js"></script></body></html>
|
package/web/compare.ts
CHANGED
|
@@ -48,6 +48,7 @@ function mountComparisonChrome(){
|
|
|
48
48
|
}
|
|
49
49
|
const controls=createViewControls({layout:'legacyCompareStep3'});
|
|
50
50
|
document.querySelector('[data-workspace-camera]')!.replaceWith(controls.zoomGroup!);
|
|
51
|
+
const play=document.getElementById('play')!;play.hidden=true;controls.zoomGroup!.before(play);
|
|
51
52
|
return shell;
|
|
52
53
|
}
|
|
53
54
|
const shell=mountComparisonChrome();
|
|
@@ -442,7 +443,7 @@ function bind(): void {
|
|
|
442
443
|
input('idle-repeat').onchange=()=>{renderIdle();if(canRepeatIdle())void playComparison().catch(error=>message(describe(error),true));};
|
|
443
444
|
el('inspector-feedback').addEventListener('focusin',()=>{idleHeld=true;const current=lastPresented?.time;stop();if(current!==undefined&&!seeking)void seekTo(current);});
|
|
444
445
|
bindInspector();
|
|
445
|
-
const transportBlock=document.querySelector<HTMLElement>('#
|
|
446
|
+
const transportBlock=document.querySelector<HTMLElement>('#inspector-playback [data-block-target="animation-dock"]');if(transportBlock)transportBlock.dataset.blockIncludes=[transportBlock.dataset.blockIncludes,'compare-transport-context'].filter(Boolean).join(' ');
|
|
446
447
|
pickedTools=mountComparePickedTools({data:()=>data,readOnly:()=>readOnly,players,assets,rigScales,layers,parts:()=>parts,time:()=>trace?.reference??presentation.snapshot().lastDrawn?.reference??0,duration:()=>domain?.end??0,playing:()=>!video.paused,pause:()=>{idleHeld=true;stop();},seekTo:seconds=>seekTo(seconds),api,route:access.route,swapSideRig,redrawOverlays,fit,syncLayout:()=>{renderPairLayout();const mode=pickedTools?.mode()??'compare',picked=pickedTools?.pickedSide()??'a';if(mode!=='compare'&&activeCamera!=='reference'&&activeCamera!==picked)activeCamera=picked;fit();},saveDraft:()=>{persistence?.save();},message,download,turnAdjustFor:side=>turnAdjusts[side]??null,syncFeedbackSide:side=>{if(select('side').value!==side&&!input('summary').value.trim()){select('side').value=side;renderFeedbackSelection();}}});
|
|
447
448
|
document.addEventListener('visibilitychange',()=>{if(document.hidden){suspendedPreview=!video.paused;stop();}else if(suspendedPreview&&!idleHeld){suspendedPreview=false;void playComparison().catch(error=>message(describe(error),true));}});
|
|
448
449
|
const observer = new ResizeObserver(fit); observer.observe(el('a-viewport')); observer.observe(el('b-viewport'));observer.observe(el('reference-viewport'));
|
|
@@ -344,6 +344,8 @@ export async function connectInspectionPersistence<T extends PersistenceSession>
|
|
|
344
344
|
if(!draft.reviewDirty&&(!sameBaseline||!recovered||draft.baseline!==baseline)){await store.clear();draft=null;recovered=null;}
|
|
345
345
|
}
|
|
346
346
|
const raw=store.recovery();
|
|
347
|
+
const restoreFailed=!!raw&&!draft;
|
|
348
|
+
if(restoreFailed){conflict=true;adapter.onConflict(true);status('Saved draft could not be restored. Your draft has not been deleted. Download or discard it before submitting.');}
|
|
347
349
|
if(draft){
|
|
348
350
|
conflict=!sameBaseline||!recovered;
|
|
349
351
|
if(!conflict&&recovered&&draft.reviewDirty){try{adapter.restoreSession(recovered,true);status('Restored local draft · not submitted');}catch(error){conflict=true;adapter.onConflict(true);status(`Local draft needs explicit recovery: ${error instanceof Error?error.message:String(error)}`);}}
|
|
@@ -353,9 +355,9 @@ export async function connectInspectionPersistence<T extends PersistenceSession>
|
|
|
353
355
|
}
|
|
354
356
|
try{adapter.restoreUI(draft.ui);}catch(error){status(`Saved panel selection unavailable: ${error instanceof Error?error.message:String(error)}`);}
|
|
355
357
|
}
|
|
356
|
-
if(raw&&(conflict||!draft))appendAction('Download saved local draft',()=>download(raw));
|
|
358
|
+
if(raw&&(conflict||!draft))appendAction('Download saved local draft',()=>{download(raw);if(restoreFailed){conflict=false;adapter.onConflict(false);clearNotices();status('Saved draft downloaded · not submitted');}});
|
|
357
359
|
if(conflict&&recovered)appendAction('Recover local draft as pending',()=>{try{adapter.restoreSession({...recovered,status:'pending'},true);conflict=false;adapter.onConflict(false);clearNotices();status('Recovered local draft as pending · not submitted');save();}catch(error){status(`Local draft recovery refused: ${error instanceof Error?error.message:String(error)}`);}});
|
|
358
|
-
if(conflict)appendAction('Discard conflicting local draft',async()=>{adapter.restoreSession(structuredClone(adapter.baseline),false);restoreInputs(initialInputs,viewInputIds);adapter.afterInputs();await store.clear();conflict=false;adapter.onConflict(false);clearNotices();status('Local draft discarded · current submitted review retained.');save();});
|
|
360
|
+
if(conflict&&!restoreFailed)appendAction('Discard conflicting local draft',async()=>{adapter.restoreSession(structuredClone(adapter.baseline),false);restoreInputs(initialInputs,viewInputIds);adapter.afterInputs();await store.clear();conflict=false;adapter.onConflict(false);clearNotices();status('Local draft discarded · current submitted review retained.');save();});
|
|
359
361
|
const selected=location.hash.startsWith('#review=')?explicit:draft?.bookmark;
|
|
360
362
|
let restored=location.hash.startsWith('#review=')||!!draft;
|
|
361
363
|
if(selected){try{await adapter.restoreBookmark(selected,new AbortController().signal);restored=true;}catch(error){status(`Inspection was not restored: ${error instanceof Error?error.message:String(error)}`);}}
|
|
@@ -363,7 +365,7 @@ export async function connectInspectionPersistence<T extends PersistenceSession>
|
|
|
363
365
|
const excluded=new Set(viewInputIds);if(conflict||!draft.reviewDirty){excluded.add('review-status');excluded.add('status');excluded.add('checkpoint-note');for(const key of Object.keys(draft.inputs))if(key.startsWith('radio:outcome:'))excluded.add(key);}
|
|
364
366
|
restoreInputs(draft.inputs,excluded);adapter.afterInputs();
|
|
365
367
|
}
|
|
366
|
-
if(raw&&!draft)appendAction('Discard unusable local draft',async()=>{await store.clear();clearNotices();status('Unusable local draft discarded for this review only.');save();});
|
|
368
|
+
if(raw&&!draft)appendAction('Discard unusable local draft',async()=>{await store.clear();conflict=false;adapter.onConflict(false);clearNotices();status('Unusable local draft discarded for this review only.');save();});
|
|
367
369
|
let writes=Promise.resolve();
|
|
368
370
|
restoring=false;
|
|
369
371
|
if(draft&&!conflict&&draft.baseline!==baseline)save();
|
package/web/inspector-blocks.ts
CHANGED
|
@@ -32,17 +32,29 @@ export interface InspectorBlocksOptions {
|
|
|
32
32
|
available?:readonly string[];
|
|
33
33
|
/** Called when a click or a key changes a section's active tab. */
|
|
34
34
|
changed?:()=>void;
|
|
35
|
-
/** The rig reuses its block rows in the heading, with one
|
|
35
|
+
/** The rig reuses its block rows in the heading, with one programmatic Comments selection. */
|
|
36
36
|
bottom?:{strip:HTMLElement;comment:HTMLButtonElement;panel:HTMLElement};
|
|
37
37
|
}
|
|
38
|
-
export interface InspectorBlocks {state():ActiveBlocks;restore(state:ActiveBlocks):void;select(section:string,id:string):void;activate(section:string):void;dispose():void}
|
|
38
|
+
export interface InspectorBlocks {state():ActiveBlocks;restore(state:ActiveBlocks):void;select(section:string,id:string):void;activate(section:string):void;register(tab:{id:string;panel:HTMLElement;label:string;position?:'first'|'last'}):()=>void;dispose():void}
|
|
39
39
|
|
|
40
40
|
interface Tab {button:HTMLButtonElement;id:string;panel:HTMLElement;included:HTMLElement[]}
|
|
41
41
|
const isRow=(node:Element)=>node.classList.contains('block-row');
|
|
42
|
+
function bindPopupMenu(id:string,items:()=>HTMLButtonElement[],cleanups:(()=>void)[],place?:(menu:HTMLElement)=>void):{button:HTMLButtonElement;menu:HTMLElement;close:(focus?:boolean)=>void} {
|
|
43
|
+
const button=actionButton('⋯',null),menu=panelMake('div',{id,hidden:true}),listen=(node:HTMLElement,type:string,fn:(event:Event)=>void)=>{node.addEventListener(type,fn);cleanups.push(()=>node.removeEventListener(type,fn));};
|
|
44
|
+
button.setAttribute('aria-haspopup','menu');button.setAttribute('aria-controls',id);button.setAttribute('aria-expanded','false');menu.setAttribute('role','menu');
|
|
45
|
+
const close=(focus=true)=>{menu.hidden=true;button.setAttribute('aria-expanded','false');if(focus)button.focus();};
|
|
46
|
+
const open=(last=false)=>{const visible=items();if(!visible.length)return;const list=visible.filter(item=>!item.disabled);menu.hidden=false;place?.(menu);button.setAttribute('aria-expanded','true');if(list.length)list[last?list.length-1:0]!.focus();else{menu.tabIndex=-1;menu.focus();}};
|
|
47
|
+
listen(button,'click',()=>menu.hidden?open():close());
|
|
48
|
+
listen(button,'keydown',event=>{const key=(event as KeyboardEvent).key;if(['ArrowDown','ArrowUp','Enter',' '].includes(key)){event.preventDefault();open(key==='ArrowUp');}else if(key==='Escape'){event.preventDefault();close();}});
|
|
49
|
+
listen(menu,'keydown',event=>{const key=(event as KeyboardEvent).key,list=items().filter(item=>!item.disabled);if(key==='Escape'){event.preventDefault();close();}else if(['ArrowDown','ArrowUp','Home','End'].includes(key)&&list.length){event.preventDefault();const index=list.indexOf(event.target as HTMLButtonElement);list[key==='Home'?0:key==='End'?list.length-1:(index+(key==='ArrowDown'?1:list.length-1))%list.length]!.focus();}});
|
|
50
|
+
listen(menu,'focusout',event=>{const target=(event as FocusEvent).relatedTarget;if(target!==button&&!menu.contains(target as Node|null))close(false);});
|
|
51
|
+
return {button,menu,close};
|
|
52
|
+
}
|
|
42
53
|
|
|
43
54
|
export function bindInspectorBlocks(options:InspectorBlocksOptions):InspectorBlocks {
|
|
44
|
-
const rows=new Map<string,InspectorTabs>(),ids=new Map<string,Set<string>>();
|
|
45
|
-
const definitions=new Map<string,{section:HTMLElement;row:HTMLElement;scrollRoot:HTMLElement;tabs:Tab[]}>(),saved:ActiveBlocks={};
|
|
55
|
+
const rows=new Map<string,InspectorTabs>(),ids=new Map<string,Set<string>>(),cleanups:(()=>void)[]=[];
|
|
56
|
+
const definitions=new Map<string,{section:HTMLElement;row:HTMLElement;scrollRoot:HTMLElement;tabs:Tab[];syncOverflow:()=>void}>(),saved:ActiveBlocks={};
|
|
57
|
+
const external=new Set<string>();
|
|
46
58
|
let active:string|undefined;
|
|
47
59
|
let disposedState:ActiveBlocks|undefined;
|
|
48
60
|
const state=()=>disposedState??Object.fromEntries([...rows].map(([name,row])=>[name,row.state()!]));
|
|
@@ -50,7 +62,7 @@ export function bindInspectorBlocks(options:InspectorBlocksOptions):InspectorBlo
|
|
|
50
62
|
const resolve=(name:string,id:string)=>id==='transport'&&!ids.get(name)?.has(id)?'motion-tools':id;
|
|
51
63
|
for(const section of options.sections){
|
|
52
64
|
const name=section.dataset.inspectorPanel??'';if(!name)continue;
|
|
53
|
-
// In Animate the row heads the
|
|
65
|
+
// In Animate the row heads the section directly and switches the whole panel body.
|
|
54
66
|
const children=[...section.children],directRow=children.find(isRow) as HTMLElement|undefined;
|
|
55
67
|
const scrollRoot=directRow?section:children.find(node=>[...node.children].some(isRow)) as HTMLElement|undefined;if(!scrollRoot)continue;
|
|
56
68
|
const row=directRow??[...scrollRoot.children].find(isRow) as HTMLElement;
|
|
@@ -64,7 +76,43 @@ export function bindInspectorBlocks(options:InspectorBlocksOptions):InspectorBlo
|
|
|
64
76
|
}
|
|
65
77
|
if(!tabs.length&&!options.bottom)continue;
|
|
66
78
|
if(options.bottom){
|
|
67
|
-
|
|
79
|
+
let syncOverflow=()=>{};
|
|
80
|
+
if(typeof (doc as Document).createElement==='function'&&tabs.length){
|
|
81
|
+
const placeOverflow=(menu:HTMLElement)=>{
|
|
82
|
+
if(typeof row.getBoundingClientRect!=='function')return;
|
|
83
|
+
const rect=row.getBoundingClientRect(),inspector=row.closest('.inspector'),main=section.closest('main')?.getBoundingClientRect(),bounds=inspector?.getBoundingClientRect();
|
|
84
|
+
// A collapsed inspector retains its heading, not a clipping body.
|
|
85
|
+
const clip=inspector?.getAttribute('data-collapsed')==='true'||!bounds?.height?main:bounds,above=Math.max(0,rect.top-Math.max(clip?.top??0,main?.top??0)-8),below=Math.max(0,Math.min(innerHeight,clip?.bottom??innerHeight,main?.bottom??innerHeight)-rect.bottom-8);
|
|
86
|
+
const up=below<Math.min(menu.scrollHeight,220)&&above>below,height=Math.min(220,up?above:below);menu.dataset.side=up?'above':'below';menu.style.maxHeight=height+'px';
|
|
87
|
+
// Keep the popup in viewport coordinates when native focus scrolls its items.
|
|
88
|
+
menu.style.position='fixed';menu.style.right=Math.max(0,innerWidth-rect.right)+'px';menu.style.top=(up?rect.top-4-Math.min(menu.scrollHeight,height):rect.bottom+4)+'px';menu.style.bottom='auto';
|
|
89
|
+
};
|
|
90
|
+
const items:HTMLButtonElement[]=[],more=bindPopupMenu('workspace-tabs-more-'+name,()=>{syncOverflow();return items.filter(item=>!item.hidden);},cleanups,placeOverflow);
|
|
91
|
+
more.button.className='workspace-tabs-more';more.button.hidden=true;more.menu.className='workspace-tabs-menu';
|
|
92
|
+
const updateItems=()=>{
|
|
93
|
+
for(const item of items.splice(0))item.remove();
|
|
94
|
+
for(const tab of tabs){
|
|
95
|
+
const item=actionButton(tab.button.textContent??'',()=>{more.close(false);rows.get(name)?.select(tab.id);syncOverflow();tab.button.focus();});
|
|
96
|
+
item.setAttribute('role','menuitem');item.dataset.blockMoreTarget=tab.id;item.tabIndex=-1;item.hidden=true;items.push(item);more.menu.append(item);
|
|
97
|
+
}
|
|
98
|
+
};updateItems();
|
|
99
|
+
row.append(more.button,more.menu);
|
|
100
|
+
syncOverflow=()=>{
|
|
101
|
+
if(items.length!==tabs.length)updateItems();
|
|
102
|
+
const label=tr('More tabs');more.button.setAttribute('aria-label',label);more.button.setAttribute('title',label);
|
|
103
|
+
for(const tab of tabs)tab.button.removeAttribute('data-tab-overflow');
|
|
104
|
+
if(row.hidden||!(row.clientWidth>0)){more.button.hidden=true;more.close(false);return;}
|
|
105
|
+
more.button.hidden=false;
|
|
106
|
+
const availableWidth=row.getBoundingClientRect?.().width??row.clientWidth,gap=4,moreWidth=(more.button.getBoundingClientRect?.().width??more.button.offsetWidth??28)+gap,widths=tabs.map(tab=>tab.button.getBoundingClientRect?.().width??tab.button.offsetWidth);
|
|
107
|
+
if(widths.reduce((sum,w,i)=>sum+w+(i>0?gap:0),0)<=availableWidth){more.button.hidden=true;more.close(false);return;}
|
|
108
|
+
const selectedIndex=tabs.findIndex(tab=>tab.button.getAttribute('aria-selected')==='true'),visible=new Set<number>();
|
|
109
|
+
let used=moreWidth+(selectedIndex>=0?widths[selectedIndex]!+gap:0);if(selectedIndex>=0)visible.add(selectedIndex);
|
|
110
|
+
for(let i=0;i<tabs.length;i++)if(i!==selectedIndex){if(used+widths[i]!+gap<=availableWidth){visible.add(i);used+=widths[i]!+gap;}}
|
|
111
|
+
for(const [i,tab]of tabs.entries()){const over=!visible.has(i);if(over)tab.button.setAttribute('data-tab-overflow','true');items[i]!.hidden=!over;items[i]!.disabled=tab.button.disabled;items[i]!.textContent=tab.button.textContent;const title=tab.button.getAttribute('title');if(title)items[i]!.setAttribute('title',title);else items[i]!.removeAttribute('title');}
|
|
112
|
+
if(!more.menu.hidden)placeOverflow(more.menu);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
definitions.set(name,{section,row,scrollRoot,tabs,syncOverflow});saved[name]=tabs.find(tab=>tab.button.getAttribute('aria-selected')==='true')?.id??tabs[0]?.id??'feedback';
|
|
68
116
|
row.hidden=true;options.bottom.strip.append(row);continue;
|
|
69
117
|
}
|
|
70
118
|
ids.set(name,new Set(tabs.map(tab=>tab.id)));
|
|
@@ -73,46 +121,84 @@ export function bindInspectorBlocks(options:InspectorBlocksOptions):InspectorBlo
|
|
|
73
121
|
panels:tabs.map(tab=>tab.panel),root:row,scrollRoot,initialize:true,
|
|
74
122
|
}));
|
|
75
123
|
}
|
|
124
|
+
const syncActiveOverflow=()=>{if(active)definitions.get(active)?.syncOverflow();};
|
|
125
|
+
if(options.bottom&& [...definitions.values()].some(d=>typeof (d.section.ownerDocument as Document).createElement==='function')){
|
|
126
|
+
cleanups.push(onLanguageChange(syncActiveOverflow));
|
|
127
|
+
if(typeof ResizeObserver==='function'){const ro=new ResizeObserver(syncActiveOverflow);ro.observe(options.bottom.strip);cleanups.push(()=>ro.disconnect());}
|
|
128
|
+
}
|
|
76
129
|
// Rebind the existing tab controller when the header mode changes. The shared Comments
|
|
77
130
|
// button/panel retain identity; each mode retains its own last selected block.
|
|
78
|
-
const activate=(name:string)=>{
|
|
131
|
+
const activate=(name:string,force=false)=>{
|
|
79
132
|
if(!options.bottom||!definitions.has(name))return;
|
|
80
|
-
if(active===name)return;
|
|
133
|
+
if(active===name&&!force)return;
|
|
81
134
|
if(active){saved[active]=rows.get(active)?.state()??saved[active]!;rows.get(active)?.dispose();rows.delete(active);definitions.get(active)!.row.hidden=true;}
|
|
82
|
-
active=name;const {section,row,scrollRoot,tabs}=definitions.get(name)!,bottom=options.bottom;
|
|
83
|
-
bottom.comment.dataset.blockTarget='feedback';
|
|
135
|
+
active=name;const {section,row,scrollRoot,tabs,syncOverflow}=definitions.get(name)!,bottom=options.bottom;
|
|
136
|
+
bottom.comment.dataset.blockTarget='feedback';bottom.comment.hidden=true;bottom.comment.remove();row.hidden=false;
|
|
84
137
|
const all=[...tabs,{button:bottom.comment,id:'feedback',panel:bottom.panel,included:[]}];
|
|
85
138
|
ids.set(name,new Set(all.map(tab=>tab.id)));
|
|
86
|
-
const sync=()=>{section.dataset.comments=String(rows.get(name)?.state()==='feedback');options.changed?.();};
|
|
139
|
+
const sync=()=>{section.dataset.comments=String(rows.get(name)?.state()==='feedback'||external.has(rows.get(name)?.state()??''));syncOverflow();options.changed?.();};
|
|
87
140
|
for(const tab of all)tab.button.setAttribute('aria-selected',String(tab.id===saved[name]));
|
|
88
141
|
rows.set(name,bindInspectorTabs(sync,()=>{},{tabs:all.map(tab=>({id:tab.id,button:tab.button,panels:[tab.panel],included:tab.included,attribute:'aria-selected'})),panels:all.map(tab=>tab.panel),root:row,scrollRoot,initialize:true}));
|
|
89
|
-
section.dataset.comments=String(saved[name]==='feedback');
|
|
142
|
+
section.dataset.comments=String(saved[name]==='feedback'||external.has(saved[name]!));
|
|
143
|
+
for(const tab of tabs)if(external.has(tab.id))tab.panel.setAttribute('aria-labelledby',tab.button.id);syncOverflow();
|
|
90
144
|
};
|
|
91
145
|
if(options.bottom)activate(options.sections[0]?.dataset.inspectorPanel??'');
|
|
92
146
|
return {
|
|
93
147
|
state:()=>({...saved,...state()}),activate,
|
|
94
|
-
|
|
148
|
+
register(tab){
|
|
149
|
+
if(!options.bottom||external.has(tab.id))return ()=>{};
|
|
150
|
+
external.add(tab.id);tab.panel.hidden=true;tab.panel.setAttribute('role','tabpanel');
|
|
151
|
+
const buttons:HTMLButtonElement[]=[];
|
|
152
|
+
for(const [name,definition]of definitions){
|
|
153
|
+
const button=actionButton(tr(tab.label),null);button.id='inspector-tab-'+name+'-'+tab.id;
|
|
154
|
+
button.dataset.blockTarget=tab.id;button.setAttribute('role','tab');button.setAttribute('aria-controls',tab.panel.id);button.setAttribute('aria-selected','false');button.tabIndex=-1;
|
|
155
|
+
definition.row.insertBefore(button,tab.position==='first'?definition.tabs[0]?.button??null:definition.row.querySelector('.workspace-tabs-more'));buttons.push(button);
|
|
156
|
+
const entry={button,id:tab.id,panel:tab.panel,included:[]};
|
|
157
|
+
if(tab.position==='first')definition.tabs.unshift(entry);else definition.tabs.push(entry);
|
|
158
|
+
}
|
|
159
|
+
const localize=onLanguageChange(()=>{for(const button of buttons)setSourceText(button,tab.label);syncActiveOverflow();});
|
|
160
|
+
if(active)activate(active,true);
|
|
161
|
+
let removed=false;
|
|
162
|
+
const remove=()=>{if(removed)return;removed=true;localize();external.delete(tab.id);
|
|
163
|
+
for(const [name,definition]of definitions){definition.tabs.splice(definition.tabs.findIndex(item=>item.id===tab.id),1);if(rows.get(name)?.state()===tab.id)rows.get(name)?.select(definition.tabs[0]?.id??'feedback');if(saved[name]===tab.id)saved[name]=definition.tabs[0]?.id??'feedback';}
|
|
164
|
+
for(const button of buttons)button.remove();tab.panel.hidden=true;if(active)activate(active,true);
|
|
165
|
+
};
|
|
166
|
+
cleanups.push(remove);return remove;
|
|
167
|
+
},
|
|
168
|
+
select:(name,id)=>{rows.get(name)?.select(resolve(name,id));definitions.get(name)?.syncOverflow();},
|
|
95
169
|
/** Restore saved tabs without touching the workspace's section scroll offset. */
|
|
96
|
-
restore(value){for(const [name,id]of Object.entries(value)){if(options.bottom){const definition=definitions.get(name);if(id==='feedback'||definition?.tabs.some(tab=>tab.id===resolve(name,id)))saved[name]=resolve(name,id);}rows.get(name)?.restore(resolve(name,id));}},
|
|
97
|
-
dispose(){disposedState=state();for(const row of rows.values())row.dispose();rows.clear();ids.clear();},
|
|
170
|
+
restore(value){for(const [name,id]of Object.entries(value)){if(options.bottom){const definition=definitions.get(name);if(id==='feedback'||definition?.tabs.some(tab=>tab.id===resolve(name,id)))saved[name]=resolve(name,id);}rows.get(name)?.restore(resolve(name,id));definitions.get(name)?.syncOverflow();}},
|
|
171
|
+
dispose(){disposedState=state();for(const cleanup of cleanups)cleanup();for(const row of rows.values())row.dispose();rows.clear();ids.clear();},
|
|
98
172
|
};
|
|
99
173
|
}
|
|
100
174
|
|
|
101
175
|
/** Compose the real rig acts into C6; all fields, submit nodes and their listeners retain identity. */
|
|
102
|
-
export function mountRigInspector(root:Document=document):BottomPanel&{actBar:ActBar;comments:{button:HTMLButtonElement;panel:HTMLElement}} {
|
|
176
|
+
export function mountRigInspector(root:Document=document,actHome?:HTMLElement):BottomPanel&{actBar:ActBar;answersRendered:boolean;syncActRow:()=>void;comments:{button:HTMLButtonElement;panel:HTMLElement}} {
|
|
103
177
|
const inspector=root.querySelector<HTMLElement>('.inspector')!,body=inspector.querySelector<HTMLElement>('.inspector-body')!,heading=inspector.querySelector<HTMLElement>('.inspector-heading')!;
|
|
104
178
|
const feedback=root.getElementById('inspector-feedback')!,dialog=root.getElementById('review-dialog')!;
|
|
105
179
|
const [label,status,actions]=[feedback.querySelector<HTMLLabelElement>('label[for="review-status"]')!,root.getElementById('review-status')!,dialog.querySelector<HTMLElement>('.review-dialog-actions')!];
|
|
106
|
-
const actBar=mountActBar({id:'workspace-review-act',decision:[label,status],actions,submit:root.getElementById('save') as HTMLButtonElement,saveState:root.getElementById('review-draft-state')!,saveStateCopies:[root.getElementById('draft-state')].flatMap(node=>node?[{node,title:true}]:[])}),act=actBar.element;
|
|
180
|
+
const actBar=mountActBar({id:'workspace-review-act',decision:[label,status],actions,submit:root.getElementById('save') as HTMLButtonElement,saveState:root.getElementById('review-draft-state')!,saveStateCopies:[root.getElementById(actHome?'dirty':'draft-state')].flatMap(node=>node?[{node,title:true}]:[])}),act=actBar.element;
|
|
181
|
+
if(actHome)for(const id of ['draft-state','draft-recovery'])root.getElementById(id)!.hidden=true;
|
|
107
182
|
const title=dialog.querySelector<HTMLElement>('.review-dialog-header')!;title.querySelector('#review-dialog-close')?.remove();
|
|
108
183
|
feedback.className='workspace-review-panel';feedback.hidden=true;feedback.prepend(title);body.append(feedback);dialog.remove();
|
|
109
184
|
feedback.removeAttribute('data-inspector-panel');
|
|
110
|
-
|
|
185
|
+
root.getElementById('proposal-panel')!.prepend(root.getElementById('comments-list-host')!);
|
|
186
|
+
const bottom=mountBottomPanel({kind:'rig',heading,act,actHome:actHome??heading,tabs:[]}),comment=actionButton(tr('Comments'),null);
|
|
187
|
+
comment.hidden=true;feedback.setAttribute('role','region');feedback.setAttribute('aria-labelledby','stage-comment');
|
|
111
188
|
delete comment.dataset.inspector;bottom.strip.removeAttribute('role');
|
|
112
189
|
for(const button of root.querySelectorAll<HTMLButtonElement>('[data-mode][data-inspector]')){button.id||='mode-'+button.dataset.mode;const panel=root.getElementById('inspector-'+button.dataset.mode)!;panel.setAttribute('role','region');panel.setAttribute('aria-labelledby',button.id);}
|
|
113
190
|
bottom.row={tabs:[...root.querySelectorAll<HTMLButtonElement>('[data-mode][data-inspector]')].map(button=>({id:button.dataset.mode!,button,attribute:'aria-pressed',panels:[root.getElementById('inspector-'+button.dataset.mode)!]})),panels:[root.getElementById('inspector-rig')!,root.getElementById('inspector-playback')!],initialize:true};
|
|
114
|
-
|
|
115
|
-
|
|
191
|
+
bottom.actHome.append(act);
|
|
192
|
+
const syncActRow=()=>{
|
|
193
|
+
if(!actHome)return;
|
|
194
|
+
const headline=root.getElementById('workspace-ask-headline'),error=root.getElementById('review-message');
|
|
195
|
+
const question=!!headline&&!headline.hidden&&!!headline.textContent?.trim();
|
|
196
|
+
const refusal=!!error&&!error.hidden&&error.classList.contains('error')&&!!error.textContent?.trim()&&['save','request-changes','workspace-pending-ask'].every(id=>root.getElementById(id)?.hidden!==false);
|
|
197
|
+
// Loading may render answers before the question; an early read refusal can
|
|
198
|
+
// still use this row once its caller has hidden every answer control.
|
|
199
|
+
actHome.hidden=act.hidden||(!question&&!refusal);root.getElementById('dirty')!.hidden=!actHome.hidden;
|
|
200
|
+
};
|
|
201
|
+
return {...bottom,actBar,answersRendered:false,syncActRow,comments:{button:comment,panel:feedback}};
|
|
116
202
|
}
|
|
117
203
|
|
|
118
204
|
export interface BottomPanel {
|
|
@@ -134,7 +220,7 @@ export function mountBottomPanel(options:BottomPanelOptions):BottomPanel {
|
|
|
134
220
|
panel.setAttribute('role','tabpanel');panel.setAttribute('aria-labelledby',button.id);
|
|
135
221
|
strip.append(button);return {id,button,panels:[panel],attribute:'aria-selected' as const};
|
|
136
222
|
});
|
|
137
|
-
const
|
|
223
|
+
const collapseLabel=tr('Collapse bottom panel'),collapse=actionButton('⌄',null);collapse.id='workspace-bottom-collapse';collapse.setAttribute('aria-expanded','true');collapse.setAttribute('aria-controls','workspace-inspector');collapse.setAttribute('aria-label',collapseLabel);collapse.setAttribute('title',collapseLabel);
|
|
138
224
|
options.heading.replaceChildren(strip,collapse);
|
|
139
225
|
return {row:{tabs,panels:tabs.flatMap(tab=>tab.panels),initialize:true},strip,act:options.act,actHome:options.actHome,collapse,kind:options.kind};
|
|
140
226
|
}
|
|
@@ -164,25 +250,13 @@ export function mountActBar(options:ActBarOptions):ActBar {
|
|
|
164
250
|
const cleanups:(()=>void)[]=[],labels:{button:HTMLButtonElement;label:string}[]=[];
|
|
165
251
|
const listen=(node:HTMLElement,type:string,fn:(event:Event)=>void)=>{node.addEventListener(type,fn);cleanups.push(()=>node.removeEventListener(type,fn));};
|
|
166
252
|
if(options.overflow?.length){
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
menu.setAttribute('role','menu');
|
|
170
|
-
const close=(focus=true)=>{menu.hidden=true;button.setAttribute('aria-expanded','false');if(focus)button.focus();};
|
|
171
|
-
const items=options.overflow.map(action=>{
|
|
253
|
+
const items:HTMLButtonElement[]=[],more=bindPopupMenu(options.id+'-menu',()=>items,cleanups);
|
|
254
|
+
for(const action of options.overflow){
|
|
172
255
|
const item=actionButton(tr(action.label),null);item.setAttribute('role','menuitem');item.tabIndex=-1;
|
|
173
|
-
listen(item,'click',()=>{close();action.handler();});labels.push({button:item,label:action.label});menu.append(item);
|
|
174
|
-
}
|
|
175
|
-
const open=(last=false)=>{menu.hidden=false;button.setAttribute('aria-expanded','true');items[last?items.length-1:0]!.focus();};
|
|
176
|
-
listen(button,'click',()=>menu.hidden?open():close());
|
|
177
|
-
listen(button,'keydown',event=>{const key=(event as KeyboardEvent).key;if(['ArrowDown','ArrowUp','Enter',' '].includes(key)){event.preventDefault();open(key==='ArrowUp');}else if(key==='Escape'){event.preventDefault();close();}});
|
|
178
|
-
listen(menu,'keydown',event=>{
|
|
179
|
-
const key=(event as KeyboardEvent).key;
|
|
180
|
-
if(key==='Escape'){event.preventDefault();close();return;}
|
|
181
|
-
if(['ArrowDown','ArrowUp','Home','End'].includes(key)){event.preventDefault();const index=items.indexOf(event.target as HTMLButtonElement);items[key==='Home'?0:key==='End'?items.length-1:(index+(key==='ArrowDown'?1:items.length-1))%items.length]!.focus();}
|
|
182
|
-
});
|
|
183
|
-
listen(menu,'focusout',event=>{const target=(event as FocusEvent).relatedTarget;if(target!==button&&!menu.contains(target as Node|null))close(false);});
|
|
256
|
+
listen(item,'click',()=>{more.close();action.handler();});labels.push({button:item,label:action.label});more.menu.append(item);items.push(item);
|
|
257
|
+
}
|
|
184
258
|
// Item listeners own activation; events from the sibling popup never trigger submit.
|
|
185
|
-
actions.append(button,menu);labels.push({button,label:'More act actions'});
|
|
259
|
+
actions.append(more.button,more.menu);labels.push({button:more.button,label:'More act actions'});
|
|
186
260
|
}
|
|
187
261
|
const refresh=()=>{
|
|
188
262
|
if(options.submitLabel!==undefined)options.submit.textContent=tr(typeof options.submitLabel==='function'?options.submitLabel():options.submitLabel);
|