You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
173 lines
6.5 KiB
Markdown
173 lines
6.5 KiB
Markdown
|
1 month ago
|
# Student Task Header Removal Implementation Plan
|
||
|
|
|
||
|
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||
|
|
|
||
|
|
**Goal:** Remove the task-workbench title and requirement description from every student training route while retaining download/export controls and all task behavior.
|
||
|
|
|
||
|
|
**Architecture:** Use two shared templates for routes that already inherit a common workbench, then update the remaining direct student training views in place. Each changed workbench keeps its existing `TrainingMaterialButton` and export button inside an actions-only header; only presentation markup and local header spacing change.
|
||
|
|
|
||
|
|
**Tech Stack:** Vue 3, `<script setup>`, SCSS, Node.js static assertions, Vite 3.
|
||
|
|
|
||
|
|
## Global Constraints
|
||
|
|
|
||
|
|
- Modify student training views only; do not alter teacher, administrator, or API code.
|
||
|
|
- Preserve `TrainingMaterialButton` or `material-download`, export controls, task data, step navigation, save, submit, reset, and draft persistence.
|
||
|
|
- Remove only the workbench-level `Training Task / 任务实训` eyebrow, heading, and requirement-description markup.
|
||
|
|
- Use `apply_patch` for source and test edits.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### Task 1: Expand the student-workbench regression coverage
|
||
|
|
|
||
|
|
**Files:**
|
||
|
|
- Modify: `tests/demand-index-step-standard.static.test.cjs`
|
||
|
|
|
||
|
|
**Interfaces:**
|
||
|
|
- Consumes: UTF-8 Vue source files under `src/views`.
|
||
|
|
- Produces: static assertions verifying the removed header is absent and `TrainingMaterialButton` remains in every direct/shared student training implementation.
|
||
|
|
|
||
|
|
- [ ] **Step 1: Write the failing test**
|
||
|
|
|
||
|
|
```js
|
||
|
|
const workbenchPages = [
|
||
|
|
"training/GenericTrainingPage.vue",
|
||
|
|
"product/components/ProductStandardTrainingPage.vue",
|
||
|
|
"foundation/product-development-factors.vue",
|
||
|
|
"demand/index.vue",
|
||
|
|
"demand/environment.vue",
|
||
|
|
"demand/people.vue",
|
||
|
|
"demand/consumer-behavior.vue",
|
||
|
|
"demand/consumer-scenario.vue",
|
||
|
|
"demand/feature-conversion.vue",
|
||
|
|
"product/index.vue",
|
||
|
|
"product/price.vue",
|
||
|
|
"product/differentiation.vue",
|
||
|
|
"product/structure.vue",
|
||
|
|
"product/after-sales-service.vue",
|
||
|
|
"channel/index.vue",
|
||
|
|
"channel/supplier.vue",
|
||
|
|
"assessment/optimization.vue"
|
||
|
|
];
|
||
|
|
|
||
|
|
for (const pageName of workbenchPages) {
|
||
|
|
const page = fs.readFileSync(path.resolve(__dirname, `../src/views/${pageName}`), "utf8");
|
||
|
|
assert.doesNotMatch(page, /class="workbench-head">\s*<div>[\s\S]*?workbench-description/, `${pageName} should not render the task-workbench heading or description`);
|
||
|
|
assert.match(page, /TrainingMaterialButton|class="material-download"/, `${pageName} should retain the file download control`);
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
- [ ] **Step 2: Run test to verify it fails**
|
||
|
|
|
||
|
|
Run: `node tests/demand-index-step-standard.static.test.cjs`
|
||
|
|
|
||
|
|
Expected: failure naming a remaining student page that still contains the workbench title/description.
|
||
|
|
|
||
|
|
- [ ] **Step 3: Implement the minimal test coverage**
|
||
|
|
|
||
|
|
Append the direct/shared page list and assertions to the existing static test without weakening the prior step-navigation checks.
|
||
|
|
|
||
|
|
- [ ] **Step 4: Run test to verify the expected red state**
|
||
|
|
|
||
|
|
Run: `node tests/demand-index-step-standard.static.test.cjs`
|
||
|
|
|
||
|
|
Expected: failure until Tasks 2 and 3 remove all remaining headers.
|
||
|
|
|
||
|
|
### Task 2: Remove headers in shared student templates
|
||
|
|
|
||
|
|
**Files:**
|
||
|
|
- Modify: `src/views/training/GenericTrainingPage.vue`
|
||
|
|
- Modify: `src/views/product/components/ProductStandardTrainingPage.vue`
|
||
|
|
|
||
|
|
**Interfaces:**
|
||
|
|
- Consumes: current task header plus its `TrainingMaterialButton` or `material-download` markup.
|
||
|
|
- Produces: actions-only headers inherited by foundation/product-development-process, demand/business-feasibility, product/requirements-doc, product/hardware-cost, test/index, and test/promotion.
|
||
|
|
|
||
|
|
- [ ] **Step 1: Replace the header markup**
|
||
|
|
|
||
|
|
```vue
|
||
|
|
<div class="workbench-head workbench-head--actions-only">
|
||
|
|
<div class="workbench-actions">
|
||
|
|
<TrainingMaterialButton :material-name="taskConfig?.materialName" :material-url="taskConfig?.materialUrl" />
|
||
|
|
<button type="button" class="outline-action" @click="exportOutcome">导出实训成果</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
```
|
||
|
|
|
||
|
|
- [ ] **Step 2: Add the actions-only visual rule**
|
||
|
|
|
||
|
|
```scss
|
||
|
|
.workbench-head--actions-only {
|
||
|
|
justify-content: flex-end;
|
||
|
|
margin-bottom: 18px;
|
||
|
|
padding-bottom: 0;
|
||
|
|
border-bottom: 0;
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
- [ ] **Step 3: Run the static test**
|
||
|
|
|
||
|
|
Run: `node tests/demand-index-step-standard.static.test.cjs`
|
||
|
|
|
||
|
|
Expected: remaining failures are direct student views only.
|
||
|
|
|
||
|
|
### Task 3: Remove headers in direct student training views
|
||
|
|
|
||
|
|
**Files:**
|
||
|
|
- Modify: `src/views/foundation/product-development-factors.vue`
|
||
|
|
- Modify: `src/views/demand/index.vue`
|
||
|
|
- Modify: `src/views/demand/environment.vue`
|
||
|
|
- Modify: `src/views/demand/people.vue`
|
||
|
|
- Modify: `src/views/demand/consumer-behavior.vue`
|
||
|
|
- Modify: `src/views/demand/consumer-scenario.vue`
|
||
|
|
- Modify: `src/views/demand/feature-conversion.vue`
|
||
|
|
- Modify: `src/views/product/index.vue`
|
||
|
|
- Modify: `src/views/product/price.vue`
|
||
|
|
- Modify: `src/views/product/differentiation.vue`
|
||
|
|
- Modify: `src/views/product/structure.vue`
|
||
|
|
- Modify: `src/views/product/after-sales-service.vue`
|
||
|
|
- Modify: `src/views/channel/index.vue`
|
||
|
|
- Modify: `src/views/channel/supplier.vue`
|
||
|
|
- Modify: `src/views/assessment/optimization.vue`
|
||
|
|
|
||
|
|
**Interfaces:**
|
||
|
|
- Consumes: per-page workbench header templates and existing download/export handlers.
|
||
|
|
- Produces: direct student pages with download/export controls only above their standard step navigation.
|
||
|
|
|
||
|
|
- [ ] **Step 1: Replace each direct page header**
|
||
|
|
|
||
|
|
Use the actions-only workbench markup while preserving each page's existing `TrainingMaterialButton` or `material-download` binding and export binding exactly.
|
||
|
|
|
||
|
|
- [ ] **Step 2: Add or extend local actions-only header CSS**
|
||
|
|
|
||
|
|
Add the same four properties from Task 2 in the final effective style block of each page so minified legacy rules do not override it.
|
||
|
|
|
||
|
|
- [ ] **Step 3: Run the static test**
|
||
|
|
|
||
|
|
Run: `node tests/demand-index-step-standard.static.test.cjs`
|
||
|
|
|
||
|
|
Expected: all assertions pass.
|
||
|
|
|
||
|
|
### Task 4: Verify all changed student pages compile
|
||
|
|
|
||
|
|
**Files:**
|
||
|
|
- Verify: `tests/demand-index-step-standard.static.test.cjs`
|
||
|
|
- Verify: all files in Tasks 2 and 3 plus previously changed `foundation/new-product-survey.vue` and `assessment/diagnosis.vue`.
|
||
|
|
|
||
|
|
- [ ] **Step 1: Check whitespace errors**
|
||
|
|
|
||
|
|
Run: `git diff --check`
|
||
|
|
|
||
|
|
Expected: exit code 0.
|
||
|
|
|
||
|
|
- [ ] **Step 2: Run regression checks**
|
||
|
|
|
||
|
|
Run: `node tests/demand-index-step-standard.static.test.cjs`
|
||
|
|
|
||
|
|
Expected: exit code 0.
|
||
|
|
|
||
|
|
- [ ] **Step 3: Run production compilation**
|
||
|
|
|
||
|
|
Run: `npm run build:prod`
|
||
|
|
|
||
|
|
Expected: Vite exits 0; any existing `::v-deep`, unresolved image, or chunk-size warnings are reported separately from build failure.
|