Add study right mode panel design spec
This commit is contained in:
1 parent
d78ddc7e00
commit
584fb3e5f1
1 file changed
+174
+174
@@ -0,0 +1,174 @@
|
||||
# Speaking Lab Study Right Mode Panel Design
|
||||
|
||||
## Goal
|
||||
|
||||
Fix the study page practice-mode UI so the video area stays clean and the right panel changes content based on the selected learning mode.
|
||||
|
||||
The current functionality is correct, but the current placement makes the left video area feel crowded because the mode bar and practice panel sit below the video controls. The revised design keeps the existing two-column page structure and moves mode-specific learning content into the existing right panel.
|
||||
|
||||
## Scope
|
||||
|
||||
Included:
|
||||
|
||||
- Keep the existing page structure: left video stage, right learning panel.
|
||||
- Remove the mode bar and practice panel from below the video controls.
|
||||
- Put the mode bar at the top of the right panel.
|
||||
- For `双语`, `英文`, and `中文`, show the normal transcript list in the right panel.
|
||||
- For `听写`, hide the transcript list and show only the dictation practice view.
|
||||
- For `中译英`, hide the transcript list and show only the translation practice view.
|
||||
- Keep the existing answer checking behavior.
|
||||
- Keep the existing previous, replay, next, loop, favorite, recording, practiced, and difficult behavior.
|
||||
- Keep `挖空` out of the UI.
|
||||
|
||||
Excluded:
|
||||
|
||||
- Backend changes.
|
||||
- Database changes.
|
||||
- New persistent practice history.
|
||||
- AI scoring.
|
||||
- Changing the left/right page grid.
|
||||
- Adding a separate route or modal.
|
||||
- Reworking video playback controls.
|
||||
|
||||
## UX
|
||||
|
||||
The study page remains visually stable:
|
||||
|
||||
- Left column: video, recording controls, sentence navigation, loop, favorite, recording status.
|
||||
- Right column: one learning panel that switches its internal content by mode.
|
||||
|
||||
The right panel has a compact mode bar at the top:
|
||||
|
||||
- `双语`
|
||||
- `英文`
|
||||
- `中文`
|
||||
- `听写`
|
||||
- `中译英`
|
||||
|
||||
Display modes:
|
||||
|
||||
- `双语`, `英文`, and `中文` show the transcript list.
|
||||
- The transcript list remains scrollable.
|
||||
- Transcript rows still support clicking to jump to a sentence.
|
||||
- `已练` and `难句` remain visible on transcript rows.
|
||||
|
||||
Input modes:
|
||||
|
||||
- `听写` replaces the transcript list with a focused dictation view.
|
||||
- `中译英` replaces the transcript list with a focused translation view.
|
||||
- In these two modes, the right panel should not show the full subtitle list.
|
||||
- The focused view should show only the controls needed for that mode: current sentence context, input, check button, feedback, and reference answer after checking.
|
||||
|
||||
## Behavior
|
||||
|
||||
Mode changes:
|
||||
|
||||
- Selecting a display mode switches the right panel to transcript-list view.
|
||||
- Selecting `听写` switches the right panel to dictation view.
|
||||
- Selecting `中译英` switches the right panel to translation view.
|
||||
- Changing mode clears the current practice input and feedback.
|
||||
|
||||
Sentence changes:
|
||||
|
||||
- Previous, replay, next, and transcript-row clicks still update the active sentence.
|
||||
- Changing the active sentence clears practice input and feedback.
|
||||
- In `听写` or `中译英`, the focused practice view updates to the new current sentence.
|
||||
|
||||
Answer checking:
|
||||
|
||||
- Reuse the existing lightweight answer checking.
|
||||
- Continue ignoring case, common punctuation, apostrophes, and extra whitespace.
|
||||
- Correct answers show the existing positive result.
|
||||
- Incorrect answers show the existing mismatch result and reference English.
|
||||
- Empty answers prompt the learner to type first.
|
||||
- Missing English reference disables or blocks checking with the existing missing-reference message.
|
||||
|
||||
Transcript visibility:
|
||||
|
||||
- The transcript list is visible only for `双语`, `英文`, and `中文`.
|
||||
- The transcript list is hidden for `听写` and `中译英`.
|
||||
- The app should not remove transcript data or status controls; it only changes what is visible.
|
||||
|
||||
## Components
|
||||
|
||||
`study.html`:
|
||||
|
||||
- Move the existing `.practice-mode-bar` into the right panel toolbar area.
|
||||
- Move the existing `.practice-body` into the right panel as a focused practice view.
|
||||
- Keep `#transcriptList` in the right panel.
|
||||
- Remove the left-side `.practice-panel` from the video panel.
|
||||
|
||||
`app.js`:
|
||||
|
||||
- Keep the existing mode state and answer helper functions.
|
||||
- Render the right panel as either transcript mode or focused practice mode.
|
||||
- Ensure `renderTranscript()` still builds transcript rows for display modes.
|
||||
- Ensure practice rendering no longer depends on the practice panel being below the video.
|
||||
|
||||
`styles.css`:
|
||||
|
||||
- Remove the extra video-panel row created for the left practice panel.
|
||||
- Style the right panel as a single surface with:
|
||||
- mode bar at top
|
||||
- transcript list for display modes
|
||||
- focused practice view for input modes
|
||||
- Keep mobile behavior simple: the right panel stacks below the video as it already does.
|
||||
|
||||
## Visual Design
|
||||
|
||||
The right panel should feel like the learning console:
|
||||
|
||||
- Mode bar stays compact and visible at the top of the right panel.
|
||||
- Display modes prioritize scanning subtitles.
|
||||
- Input modes prioritize a calm single-task practice surface.
|
||||
- The focused practice view should have enough spacing to feel intentional, but not like a marketing card.
|
||||
- Avoid nested cards, decorative backgrounds, large hero typography, and extra explanatory text.
|
||||
|
||||
For `听写`:
|
||||
|
||||
- Show a short label such as `听写`.
|
||||
- Show a prompt telling the learner to listen and type the current English sentence.
|
||||
- Do not show the English sentence before checking.
|
||||
|
||||
For `中译英`:
|
||||
|
||||
- Show a short label such as `中译英`.
|
||||
- Show the Chinese current sentence prominently.
|
||||
- Show the English reference only after checking, or through the existing mismatch feedback.
|
||||
|
||||
## Testing
|
||||
|
||||
Automated checks:
|
||||
|
||||
```powershell
|
||||
node --check app.js
|
||||
node --check home.js
|
||||
node --check admin.js
|
||||
node tests\practice-helpers.test.mjs
|
||||
node tests\progress-helpers.test.mjs
|
||||
node tests\admin-file-input.test.mjs
|
||||
python -m py_compile backend\main.py backend\db.py
|
||||
```
|
||||
|
||||
Manual browser checks:
|
||||
|
||||
1. Open `http://127.0.0.1:8000/study.html`.
|
||||
2. Confirm the left video area no longer contains the mode bar or practice panel.
|
||||
3. Confirm the right panel has the mode bar.
|
||||
4. Select `双语`, `英文`, and `中文`; confirm the transcript list is visible.
|
||||
5. Select `听写`; confirm the transcript list is hidden and only dictation UI is visible.
|
||||
6. Select `中译英`; confirm the transcript list is hidden and only translation UI is visible.
|
||||
7. Confirm `挖空` does not appear.
|
||||
8. Confirm checking correct and incorrect answers still works.
|
||||
9. Confirm changing sentence clears input and feedback.
|
||||
10. Confirm previous, replay, next, loop, favorite, recording, practiced, and difficult still work.
|
||||
11. Check desktop and narrow viewport for no horizontal overflow or text overlap.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- The left video/control area is clean and does not contain learning mode buttons or practice input.
|
||||
- The right panel contains the mode bar.
|
||||
- Display modes show the transcript list.
|
||||
- `听写` and `中译英` hide the transcript list and show only their focused practice UI.
|
||||
- Existing practice checking behavior continues to work.
|
||||
- No `挖空` mode appears.
|
||||
Reference in new issue
Block a user