feat(P01-05-04): full React client session UX — start → live → debrief

client/src/App.tsx now renders three views:
  - start: scenario title + description + disclaimer acknowledgement
    checkbox (required before Start) + Start button
  - live: status badge, latency readout (within/over 600ms budget), End
    button, live transcript with learner/AI turn indicators
  - debrief: coaching debrief placeholder + latency summary + turns-this-
    session recap + Start-new-session button

View transitions are driven by the voice session state (connected → live,
idle → debrief). App.css updated with scenario-card, disclaimer-check, and
summary styles. npm run typecheck + npm run build pass. Replaces the
SLICE-02 minimal page.

---ci---
phase: 1
milestone: v0.1
plan: 05
task: 05-04
status: execute
persona: frontend-engineer
requirements:
  covered: [REQ-DEBRIEF-01, REQ-VOICE-01, REQ-NFR-LAT-01]
---/ci---
This commit is contained in:
Praxis CI
2026-08-01 13:17:40 +00:00
parent 37f5cd4587
commit c7acbb8054
2 changed files with 324 additions and 221 deletions
+169 -163
View File
@@ -1,184 +1,190 @@
.counter {
font-size: 16px;
padding: 5px 10px;
border-radius: 5px;
color: var(--accent);
background: var(--accent-bg);
border: 2px solid transparent;
transition: border-color 0.3s;
margin-bottom: 24px;
/* Praxis v0.1 session page — voice-first, minimal. */
&:hover {
border-color: var(--accent-border);
}
&:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
#root {
max-width: 720px;
margin: 0 auto;
padding: 2rem;
font-family: system-ui, -apple-system, sans-serif;
color: #1a1a1a;
}
.hero {
position: relative;
.base,
.framework,
.vite {
inset-inline: 0;
margin: 0 auto;
}
.base {
width: 170px;
position: relative;
z-index: 0;
}
.framework,
.vite {
position: absolute;
}
.framework {
z-index: 1;
top: 34px;
height: 28px;
transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg)
scale(1.4);
}
.vite {
z-index: 0;
top: 107px;
height: 26px;
width: auto;
transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg)
scale(0.8);
}
#praxis-session header h1 {
margin: 0;
font-size: 2rem;
}
#center {
.subtitle {
margin: 0.25rem 0 1.5rem;
color: #666;
font-size: 0.95rem;
}
.disclaimer {
background: #fff8e1;
border-left: 3px solid #ffb300;
padding: 0.75rem 1rem;
margin-bottom: 1.5rem;
font-size: 0.9rem;
color: #5d4037;
border-radius: 4px;
}
.disclaimer-check {
display: flex;
flex-direction: column;
gap: 25px;
place-content: center;
place-items: center;
flex-grow: 1;
@media (max-width: 1024px) {
padding: 32px 20px 24px;
gap: 18px;
}
align-items: flex-start;
gap: 0.5rem;
cursor: pointer;
}
#next-steps {
.disclaimer-check input {
margin-top: 0.2rem;
}
.controls {
display: flex;
border-top: 1px solid var(--border);
text-align: left;
& > div {
flex: 1 1 0;
padding: 32px;
@media (max-width: 1024px) {
padding: 24px 20px;
}
}
.icon {
margin-bottom: 16px;
width: 22px;
height: 22px;
}
@media (max-width: 1024px) {
flex-direction: column;
text-align: center;
}
gap: 0.75rem;
margin-bottom: 1rem;
}
#docs {
border-right: 1px solid var(--border);
@media (max-width: 1024px) {
border-right: none;
border-bottom: 1px solid var(--border);
}
.controls button {
padding: 0.6rem 1.2rem;
font-size: 1rem;
border: none;
border-radius: 6px;
cursor: pointer;
transition: opacity 0.15s;
}
#next-steps ul {
.controls button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.controls .start {
background: #2563eb;
color: white;
}
.controls .stop {
background: #ef4444;
color: white;
}
.status {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1rem;
}
.badge {
padding: 0.2rem 0.6rem;
border-radius: 12px;
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
}
.badge--idle { background: #e5e7eb; color: #374151; }
.badge--connecting { background: #dbeafe; color: #1d4ed8; }
.badge--connected { background: #d1fae5; color: #047857; }
.badge--error { background: #fee2e2; color: #b91c1c; }
.error {
color: #b91c1c;
font-size: 0.85rem;
}
.latency {
font-size: 0.95rem;
}
.latency .ok { color: #047857; font-weight: 600; }
.latency .over { color: #b91c1c; font-weight: 600; }
.latency .budget { color: #666; font-size: 0.85rem; }
.transcript h2,
.transcript h3 {
font-size: 1.1rem;
margin-bottom: 0.5rem;
}
.transcript ul {
list-style: none;
padding: 0;
margin: 0;
}
.transcript .turn {
padding: 0.5rem 0.75rem;
margin-bottom: 0.4rem;
border-radius: 6px;
display: flex;
gap: 8px;
margin: 32px 0 0;
.logo {
height: 18px;
}
a {
color: var(--text-h);
font-size: 16px;
border-radius: 6px;
background: var(--social-bg);
display: flex;
padding: 6px 12px;
align-items: center;
gap: 8px;
text-decoration: none;
transition: box-shadow 0.3s;
&:hover {
box-shadow: var(--shadow);
}
.button-icon {
height: 18px;
width: 18px;
}
}
@media (max-width: 1024px) {
margin-top: 20px;
flex-wrap: wrap;
justify-content: center;
li {
flex: 1 1 calc(50% - 8px);
}
a {
width: 100%;
justify-content: center;
box-sizing: border-box;
}
}
gap: 0.5rem;
}
#spacer {
height: 88px;
border-top: 1px solid var(--border);
@media (max-width: 1024px) {
height: 48px;
}
.turn--user {
background: #e5e7eb;
}
.ticks {
position: relative;
width: 100%;
&::before,
&::after {
content: '';
position: absolute;
top: -4.5px;
border: 5px solid transparent;
}
&::before {
left: 0;
border-left-color: var(--border);
}
&::after {
right: 0;
border-right-color: var(--border);
}
.turn--assistant {
background: #dbeafe;
}
.turn .role {
font-weight: 600;
min-width: 2.5rem;
}
.turn .text {
flex: 1;
}
.muted {
color: #666;
font-size: 0.9rem;
}
/* Full session UX (SLICE-05) */
.view {
margin-bottom: 1rem;
}
.scenario-card {
background: #f0f9ff;
border: 1px solid #bae6fd;
border-radius: 8px;
padding: 1rem 1.25rem;
margin-bottom: 1.5rem;
}
.scenario-card h2 {
margin: 0 0 0.5rem;
font-size: 1.15rem;
}
.scenario-desc {
margin: 0;
color: #475569;
font-size: 0.9rem;
line-height: 1.4;
}
.summary {
background: #f0fdf4;
border: 1px solid #bbf7d0;
border-radius: 6px;
padding: 0.75rem 1rem;
margin-bottom: 1rem;
}
.summary h3 {
margin: 0 0 0.25rem;
font-size: 0.95rem;
}
.summary p {
margin: 0;
font-size: 0.9rem;
}