Place teacher prompt buttons above the composer

This commit is contained in:
鲨鱼辣椒
2026-09-29 20:06:31 +08:00
parent bb96941461
commit efd1894269
6 changed files with 96 additions and 24 deletions

View File

@@ -0,0 +1,56 @@
# Task: Move configured teacher prompts above composer
## Identity
- Task ID: 20260929-teacher-prompt-buttons-a682d30f
- Mode: Feature
- Branch: codex/20260929-teacher-prompt-buttons-a682d30f-teacher-prompt-buttons
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260929-teacher-prompt-buttons-a682d30f
- Base commit: 78cfde67340aaccea8e8edc2505136cfcf865eda
- Owner: codex
- Status: Ready for Integration
## Scope
- Move Yuxi-configured teacher shortcuts above the composer as small, flat pastel buttons; preserve exact configured label/prompt and existing send/voice/model behavior.
## Intent And Constraints
- User authorized code and background trial update. No subagents, cloud deployment, paid prompts, main merge/push, focus changes or history deletion.
## Outcome
- Configured teacher shortcuts now sit outside and directly above the composer. Buttons use 13px normal text (same as reply body), pale cream fill, light border and no shadow; wrapping/overflow/keyboard focus supported.
- Adapted product/tests dependency from main 53d5b6b (bb96941); original source task record remains in its source commit, excluded from this feature boundary. Explicit empty arrays hide prompts; absent historical field retains approved fallback. Published label and prompt are unchanged.
- Trial Renderer updated in place in PID 32583; Main and empty-work preview overlay remain intact. Live Alice cloud v53 supplies “继续看看咯”.
## Verification
- Typecheck, lint (0 errors / 8 existing warnings), production build passed. 75 focused unit tests and 23 headless browser scenarios passed, including 319/508px overflow, keyboard focus, exact configured prompt sends, preserved drafts, cloud refresh/empty list and voice/model controls.
- First test pass exposed two stale assertions in the imported tests (send argument position and old toolbar ownership); adapted them. One rerun hit the existing old-topic stream timing test; serial rerun passed all 75 with no product changes.
- Trial screenshot confirms 13px, weight 400, no shadow, buttons above composer, no horizontal overflow. Same account/storage/drafts/teacher/tab; focus monitor reports no trial activation.
- Operation hydration initially collided with the existing E2E trial 250ms background-sleep timer while the desktop was at loginwindow. Read-only inspector diagnosis traced stop to BackgroundLifecycleController.sleepIfIdle (same failures present at 11:28Z before this update). A temporary Main-owned snapshot-verification lease allowed normal selectConversation hydration; then released it. No runtime code or user files changed. Final comparison: all 14 operation messages, teacher turns, drafts, selected teacher, route/tab unchanged; 15 timestamps visible. No live prompt or microphone call. All inspector breakpoints were removed.
## Follow-ups
- Feature branch awaits separate integration; no main merge/push or cloud deployment in this task. Prior model-selection cloud rollout remains pending.
## Promotion Candidates
- Target: integrated classroom UI documentation. Proposal: configured prompts live above the composer as flat body-size buttons; exact cloud labels/prompts, absent/empty compatibility and send guards retained. Evidence: user approval, 75 unit / 23 browser tests and live trial comparison. No product-policy conflict; canonical promotion belongs to integration.
## Project Context Loaded
- Task ID/mode/branch/worktree/base: matching official reservation and owner verified; feature task at 78cfde67340aaccea8e8edc2505136cfcf865eda in the isolated path above.
- Read: AGENTS; entry, memory index, active task, positioning, current state, decisions/teacher ADR, architecture, domain rules, success criteria, evidence/commitment indexes and all registered peer Scope/Intent/Promotion sections.
- Goal: child-friendly creation with cloud-defined teachers and Main-owned auth/model access. Current code and README supersede stale canonical mentions of retired discussion components.
- Active peers: window-close (native lifecycle, explicitly excludes trial), help-label/replies-release, child-language (undefined scope), and completed teacher/composer/community/empty-preview tasks. No concrete semantic conflict; preserve their committed behavior and do not modify peer checkouts.
- Relevant dependencies: main 53d5b6b adds configured shortcuts; current trial has 78cfde6 microphone/models and empty-preview 0167d36 overlay. Only shortcut support and presentation are brought into this task.
- Files: TeacherChatPanel, classroom-workspace.css, shared definition and focused UI/layout fixtures, README. Existing single light palette and body font remain; design skill recommendations subordinate to approved layout.
- Gate: Passed.
## Plan
1. Reconcile committed Yuxi shortcuts support with trial composer, preserving empty-array versus absent compatibility.
2. Move controls above composer and give them body-size, normal-weight, pale rounded styling with keyboard focus and wrapping.
3. Verify UI behavior/layout, typecheck/lint/build; update current trial in background preserving source overlays and user state; document evidence.