Add coverage prettification and sorting functionality

- Introduced `prettify.css` for syntax highlighting in coverage reports.
- Added `prettify.js` to handle code formatting and highlighting.
- Included `sort-arrow-sprite.png` for sort indicators in the coverage table.
- Implemented `sorter.js` to enable sorting and filtering of coverage summary tables.
- Added a search box for filtering table rows based on user input.
This commit is contained in:
catlog22
2026-02-07 22:21:05 +08:00
parent 6073627ff2
commit ece02ab32a
40 changed files with 2828 additions and 728 deletions

View File

@@ -362,27 +362,25 @@ if (autoYes) {
console.log(`[--yes] Auto-continuing to Phase 4: Execution`)
// Read phases/04-execution.md and execute Phase 4
} else {
AskUserQuestion({
questions: [{
question: "Planning complete. What would you like to do next?",
header: "Next Action",
multiSelect: false,
options: [
{
label: "Verify Plan Quality (Recommended)",
description: "Run quality verification to catch issues before execution."
},
{
label: "Start Execution",
description: "Begin implementing tasks immediately (Phase 4)."
},
{
label: "Review Status Only",
description: "View task breakdown and session status without taking further action."
}
]
}]
});
ASK_USER([{
id: "phase3-next-action",
type: "select",
prompt: "Planning complete. What would you like to do next?",
options: [
{
label: "Verify Plan Quality (Recommended)",
description: "Run quality verification to catch issues before execution."
},
{
label: "Start Execution",
description: "Begin implementing tasks immediately (Phase 4)."
},
{
label: "Review Status Only",
description: "View task breakdown and session status without taking further action."
}
]
}]) // BLOCKS (wait for user response)
}
// Execute based on user choice

View File

@@ -49,7 +49,7 @@ Step 3: Inline Conflict Resolution (conditional)
│ └─ Gemini/Qwen CLI analysis → conflict strategies
├─ 3.4 Iterative user clarification (send_input loop, max 10 rounds)
│ ├─ Display conflict + strategy ONE BY ONE
│ ├─ AskUserQuestion for user selection
│ ├─ ASK_USER for user selection
│ └─ send_input → agent re-analysis → confirm uniqueness
├─ 3.5 Generate conflict-resolution.json
└─ 3.6 Close conflict agent
@@ -419,11 +419,10 @@ FOR each conflict:
selectedStrategy = conflict.strategies[conflict.recommended || 0]
clarified = true // Skip clarification loop
} else {
AskUserQuestion({
questions: [{
question: formatStrategiesForDisplay(conflict.strategies),
header: "策略选择",
multiSelect: false,
ASK_USER([{
id: `conflict-${conflict.id}-strategy`,
type: "select",
prompt: formatStrategiesForDisplay(conflict.strategies),
options: [
...conflict.strategies.map((s, i) => ({
label: `${s.name}${i === conflict.recommended ? ' (推荐)' : ''}`,
@@ -431,8 +430,7 @@ FOR each conflict:
})),
{ label: "自定义修改", description: `建议: ${conflict.modification_suggestions?.slice(0,2).join('; ')}` }
]
}]
})
}]) // BLOCKS (wait for user response)
// 3. Handle selection
if (userChoice === "自定义修改") {
@@ -446,12 +444,12 @@ FOR each conflict:
// 4. Clarification (if needed) - using send_input for agent re-analysis
if (!autoYes && selectedStrategy.clarification_needed?.length > 0) {
for (batch of chunk(selectedStrategy.clarification_needed, 4)) {
AskUserQuestion({
questions: batch.map((q, i) => ({
question: q, header: `澄清${i+1}`, multiSelect: false,
options: [{ label: "详细说明", description: "提供答案" }]
}))
})
ASK_USER(batch.map((q, i) => ({
id: `clarify-${conflict.id}-${i+1}`,
type: "select",
prompt: q,
options: [{ label: "详细说明", description: "提供答案" }]
}))) // BLOCKS (wait for user response)
userClarifications.push(...collectAnswers(batch))
}
@@ -498,7 +496,7 @@ selectedStrategies = resolvedConflicts.map(r => ({
```
**Key Points**:
- AskUserQuestion: max 4 questions/call, batch if more
- ASK_USER: max 4 questions/call, batch if more
- Strategy options: 2-4 strategies + "自定义修改"
- Clarification loop via send_input: max 10 rounds, agent determines uniqueness_confirmed
- Agent stays active throughout interaction (no close_agent until Step 3.6)

View File

@@ -92,57 +92,53 @@ if (autoYes) {
**User Questions** (skipped if autoYes):
```javascript
if (!autoYes) AskUserQuestion({
questions: [
{
question: "Do you have supplementary materials or guidelines to include?",
header: "Materials",
multiSelect: false,
options: [
{ label: "No additional materials", description: "Use existing context only" },
{ label: "Provide file paths", description: "I'll specify paths to include" },
{ label: "Provide inline content", description: "I'll paste content directly" }
]
},
{
question: "Select execution method for generated tasks:",
header: "Execution",
multiSelect: false,
options: [
{ label: "Agent (Recommended)", description: "Claude agent executes tasks directly" },
{ label: "Hybrid", description: "Agent orchestrates, calls CLI for complex steps" },
{ label: "CLI Only", description: "All execution via CLI tools (codex/gemini/qwen)" }
]
},
{
question: "If using CLI, which tool do you prefer?",
header: "CLI Tool",
multiSelect: false,
options: [
{ label: "Codex (Recommended)", description: "Best for implementation tasks" },
{ label: "Gemini", description: "Best for analysis and large context" },
{ label: "Qwen", description: "Alternative analysis tool" },
{ label: "Auto", description: "Let agent decide per-task" }
]
}
]
})
if (!autoYes) ASK_USER([
{
id: "materials",
type: "select",
prompt: "Do you have supplementary materials or guidelines to include?",
options: [
{ label: "No additional materials", description: "Use existing context only" },
{ label: "Provide file paths", description: "I'll specify paths to include" },
{ label: "Provide inline content", description: "I'll paste content directly" }
]
},
{
id: "execution-method",
type: "select",
prompt: "Select execution method for generated tasks:",
options: [
{ label: "Agent (Recommended)", description: "Claude agent executes tasks directly" },
{ label: "Hybrid", description: "Agent orchestrates, calls CLI for complex steps" },
{ label: "CLI Only", description: "All execution via CLI tools (codex/gemini/qwen)" }
]
},
{
id: "cli-tool",
type: "select",
prompt: "If using CLI, which tool do you prefer?",
options: [
{ label: "Codex (Recommended)", description: "Best for implementation tasks" },
{ label: "Gemini", description: "Best for analysis and large context" },
{ label: "Qwen", description: "Alternative analysis tool" },
{ label: "Auto", description: "Let agent decide per-task" }
]
}
]) // BLOCKS (wait for user response)
```
**Handle Materials Response** (skipped if autoYes):
```javascript
if (!autoYes && userConfig.materials === "Provide file paths") {
// Follow-up question for file paths
const pathsResponse = AskUserQuestion({
questions: [{
question: "Enter file paths to include (comma-separated or one per line):",
header: "Paths",
multiSelect: false,
options: [
{ label: "Enter paths", description: "Provide paths in text input" }
]
}]
})
const pathsResponse = ASK_USER([{
id: "material-paths",
type: "input",
prompt: "Enter file paths to include (comma-separated or one per line):",
options: [
{ label: "Enter paths", description: "Provide paths in text input" }
]
}]) // BLOCKS (wait for user response)
userConfig.supplementaryPaths = parseUserPaths(pathsResponse)
}
```

View File

@@ -51,7 +51,7 @@ Step 3: Task Execution Loop
Step 4: Completion
├─ Synchronize all statuses
├─ Generate summaries
└─ AskUserQuestion: Review or Complete Session
└─ ASK_USER: Review or Complete Session
```
## Step 1: TodoWrite Generation
@@ -284,23 +284,21 @@ if (autoYes) {
// Execute: workflow:session:complete --yes
} else {
// Interactive mode: Ask user
AskUserQuestion({
questions: [{
question: "All tasks completed. What would you like to do next?",
header: "Next Step",
multiSelect: false,
options: [
{
label: "Enter Review",
description: "Run specialized review (security/architecture/quality/action-items)"
},
{
label: "Complete Session",
description: "Archive session and update manifest"
}
]
}]
})
ASK_USER([{
id: "completion-next-step",
type: "select",
prompt: "All tasks completed. What would you like to do next?",
options: [
{
label: "Enter Review",
description: "Run specialized review (security/architecture/quality/action-items)"
},
{
label: "Complete Session",
description: "Archive session and update manifest"
}
]
}]) // BLOCKS (wait for user response)
}
```