fix(convivo): readable descriptions, no feedback UI on service sessions, no demo-clock badge
Three attendee-app polish items from hands-on testing (Sabrina). All presentation-layer: no migration, no RPC, no admin/sidecar change. - Session detail collapsed multi-paragraph descriptions into one block. The feed carries real newlines (the sidecar passes Sessionize description through untouched), so this was pure CSS: new .sd-desc uses white-space: pre-line. The AI feedback summary gets the same via .feedback-review .fr-text. - Staff saw "Your session feedback" on Break/Lunch cards, because _assign_service_session_speakers makes every staff member a speaker of every service slot. showFeedback = !isService now gates all three feedback surfaces (review block, Give-feedback button, "not checked in" note). The sheet itself stays openable for service sessions. - Removed the "Demo clock" badge from the Home header. The simulated clock is an internal demo aid; attendees were never meant to see it. useEvent() still exposes clockMode and the admin toggle is unchanged. Tests: three new API-mocked cases in convivo-admin-entry.spec.ts (service feedback suppression, multi-line description via pre-line CSS + exact textContent + rendered-height comparison, no demo-clock badge per clock mode). 45/45 green against the local dev server; attendee build clean. Docs synced: screens.md, app-structure.md, backend/tests.md, next-steps.md, plus a release record at docs/releases/2026-10-18.md noting that items 1/3/7 of the report were already shipped (84d3922,2aa2b89) and that this change is not yet deployed. Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
6d375d0413
commit
a81ec4b787
9 files changed
+217
-27
No files matched your search
@@ -51,6 +51,11 @@ export function SessionDetail({
|
||||
// Service sessions have no material requirement (and no mic), so the
|
||||
// pending-material notice never applies to them.
|
||||
const needsMaterial = isSpeaker && !session.material_path && !isService;
|
||||
// Feedback never applies to a service session: attendees cannot check in to
|
||||
// one (so there is nothing to rate) and every staff member is auto-assigned
|
||||
// as its speaker (so staff would otherwise see a "Your session feedback"
|
||||
// block on a break/lunch card).
|
||||
const showFeedback = !isService;
|
||||
|
||||
async function togglePick() {
|
||||
try {
|
||||
@@ -113,7 +118,9 @@ export function SessionDetail({
|
||||
</div>
|
||||
<button className="btn ghost small" onClick={onClose}>✕</button>
|
||||
</div>
|
||||
<div className="muted small" id="sd-desc" style={{ margin: '12px 0', lineHeight: 1.55 }}>
|
||||
{/* The feed (Sessionize / Excel) carries real line breaks — .sd-desc
|
||||
preserves them instead of collapsing the text into one block. */}
|
||||
<div className="muted small sd-desc" id="sd-desc">
|
||||
{session.description}
|
||||
</div>
|
||||
<div className="row" style={{ gap: 8, marginBottom: 14, flexWrap: 'wrap' }}>
|
||||
@@ -135,8 +142,9 @@ export function SessionDetail({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Speaker feedback: visible only after the session is over. */}
|
||||
{isSpeaker && status === 'done' && (
|
||||
{/* Speaker feedback: visible only after the session is over, and never
|
||||
for a service session. */}
|
||||
{isSpeaker && showFeedback && status === 'done' && (
|
||||
<div className="feedback-review">
|
||||
<div className="fr-title">⭐ Your session feedback</div>
|
||||
{session.average_feedback != null ? (
|
||||
@@ -154,19 +162,19 @@ export function SessionDetail({
|
||||
{session.ai_generated_feedback && (
|
||||
<div className="fr-summary">
|
||||
<div className="muted small" style={{ fontWeight: 700, marginBottom: 4 }}>AI summary</div>
|
||||
<div style={{ lineHeight: 1.5 }}>{session.ai_generated_feedback}</div>
|
||||
<div className="fr-text">{session.ai_generated_feedback}</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
||||
{status === 'done' && checkedIn && onGiveFeedback && (
|
||||
{showFeedback && status === 'done' && checkedIn && onGiveFeedback && (
|
||||
<button className="btn primary" data-testid="give-feedback" onClick={() => onGiveFeedback(session.id)}>
|
||||
Give feedback ⭐
|
||||
</button>
|
||||
)}
|
||||
{status === 'done' && !checkedIn && (
|
||||
{showFeedback && status === 'done' && !checkedIn && (
|
||||
<div className="muted small" style={{ textAlign: 'center' }}>
|
||||
You weren’t checked in to this session.
|
||||
</div>
|
||||
|
||||
@@ -50,7 +50,7 @@ function ConcurrentList({ sessions, hasPicks }: { sessions: Session[]; hasPicks:
|
||||
|
||||
export function Home({ go, onEventFeedback, openFeedback }: { go: (tab: string) => void; onEventFeedback?: () => void; openFeedback?: (sessionId: string) => void }) {
|
||||
const { contact, registration } = useAuth();
|
||||
const { event, slots, sessionById, slotById, now, clockMode, loading, reload } = useEvent();
|
||||
const { event, slots, sessionById, slotById, now, loading, reload } = useEvent();
|
||||
const [prefs, setPrefs] = useState<Preference[]>([]);
|
||||
const [checkins, setCheckins] = useState<string[]>([]);
|
||||
const [mySpeakerSessions, setMySpeakerSessions] = useState<string[]>([]);
|
||||
@@ -151,11 +151,6 @@ export function Home({ go, onEventFeedback, openFeedback }: { go: (tab: string)
|
||||
<div>
|
||||
<div className="h1">{greeting(now)}, {firstName} 👋</div>
|
||||
<div className="muted small">{event.name}</div>
|
||||
{clockMode === 'simulated' && (
|
||||
<div className="muted small" style={{ marginTop: 2 }}>
|
||||
🎬 Demo clock
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
{pendingMaterial.length > 0 && (
|
||||
|
||||
@@ -161,6 +161,8 @@ body {
|
||||
.feedback-review .fr-stars .on { color: #f59e0b; }
|
||||
.feedback-review .fr-num { font-weight: 800; font-size: 16px; }
|
||||
.feedback-review .fr-summary { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
|
||||
/* The AI summary is free text written by the model with real paragraphs. */
|
||||
.feedback-review .fr-text { line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
|
||||
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; color: #fff; flex-shrink: 0; }
|
||||
.input {
|
||||
width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line);
|
||||
@@ -312,6 +314,9 @@ textarea.input { resize: none; min-height: 96px; }
|
||||
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
|
||||
.sheet h3 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
|
||||
.sheet .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
|
||||
/* Session description: the Sessionize/Excel feed carries line breaks and blank
|
||||
lines, so keep them instead of collapsing everything into one block. */
|
||||
.sd-desc { margin: 12px 0; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
|
||||
|
||||
/* ---------- Scan: uiverse check-in type toggle (Shoh2008 / brown-bulldog-12) ---------- */
|
||||
.uiverse-toggle { display: inline-flex; }
|
||||
|
||||
+15
-1
@@ -177,7 +177,7 @@ separate. See the [deployment record](../releases/2026-10-11.md).
|
||||
|
||||
# Agenda Consistency + Home Picks Regression
|
||||
|
||||
Two further API-mocked checks run in the same spec:
|
||||
Further API-mocked checks run in the same spec:
|
||||
|
||||
```sh
|
||||
CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- convivo-admin-entry.spec.ts --project=chromium --grep 'Service agenda|Home session picks'
|
||||
@@ -198,6 +198,20 @@ CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- convivo-admin-en
|
||||
concurrent list must **not** show "No pick yet — tap a session in the Agenda
|
||||
to choose."; with no picks at all the nudge is still shown. Asserted per card
|
||||
(`.now-card`), since Now and Next each render their own copy.
|
||||
- **Service session feedback suppression** — a staff contact who is an assigned
|
||||
speaker of a finished service slot opens its sheet and must see **no** "Your
|
||||
session feedback" block, **no** `give-feedback` button and **no** "You weren't
|
||||
checked in" note (the sheet still shows the title and "No pick needed for this
|
||||
slot.").
|
||||
- **Multi-line description** — a `get_agenda` description containing `\n\n`
|
||||
renders in `#sd-desc` with `white-space: pre-line`; the raw newlines stay in
|
||||
the DOM and the block measures taller than the same text with collapsed
|
||||
whitespace.
|
||||
- **No demo-clock badge** — each "Event demo clock" scenario also opens Home and
|
||||
asserts "Demo clock" is absent, in both simulated and real-time mode.
|
||||
|
||||
The last three cases come from the 2026-10-18 feedback polish; see the
|
||||
[release record](../releases/2026-10-18.md).
|
||||
|
||||
# Session Persistence Regression
|
||||
|
||||
|
||||
@@ -98,9 +98,9 @@ const clockMode: 'simulated' | 'realtime' = event?.use_realtime_clock ? 'realtim
|
||||
const now = clockMode === 'simulated' && event ? demoNow(event.start_date) : new Date();
|
||||
```
|
||||
|
||||
The Home header shows a **🎬 Demo clock** indicator only when the simulated
|
||||
clock is active — when the real clock is on, nothing is shown (a real clock is
|
||||
the expected state, so it needs no badge).
|
||||
The simulated clock is an **internal demo aid with no UI surface**: the Home
|
||||
header never advertises it (no badge in either mode). `useEvent()` still exposes
|
||||
`clockMode` for the screens that need to know which clock is driving slot status.
|
||||
|
||||
### How "Live" / "Up next" / "Done" is decided
|
||||
|
||||
@@ -210,6 +210,11 @@ opens the session in place instead of routing to the Agenda). It receives the
|
||||
`onMaterialChanged`) — the owning screen keeps its own preference/check-in
|
||||
state and refreshes it through the callbacks. Renders: title + time/room
|
||||
subtitle (the slot name is prefixed only when it adds information, so an
|
||||
auto-named "Slot 10:15–11:00" never repeats the time range), description, speaker/level/area/capacity/checked-in pills, the speaker
|
||||
material upload notice, the speaker feedback review, the Give-feedback button,
|
||||
the pick / "No pick needed" control, and the material download/remove buttons.
|
||||
auto-named "Slot 10:15–11:00" never repeats the time range), description
|
||||
(`.sd-desc`, `white-space: pre-line` — the line breaks carried by the
|
||||
Sessionize/Excel feed are preserved), speaker/level/area/capacity/checked-in
|
||||
pills, the speaker material upload notice, the speaker feedback review, the
|
||||
Give-feedback button, the pick / "No pick needed" control, and the material
|
||||
download/remove buttons. For a **service session** every feedback surface is
|
||||
suppressed (review, Give-feedback, and the "not checked in" note) — see
|
||||
[screens.md](./screens.md#agenda).
|
||||
@@ -173,7 +173,12 @@ differently:
|
||||
- the **🎤 mic emoji is never shown** (neither the "🎤 you" tag nor the mic in
|
||||
the speaker pill) — service sessions have no individual speaker;
|
||||
- they have **no material requirement** (the pending-material notice never
|
||||
applies to them).
|
||||
applies to them);
|
||||
- they have **no feedback UI of any kind** — neither "Give feedback ⭐" nor the
|
||||
speaker's "⭐ Your session feedback" review nor the "You weren't checked in"
|
||||
note. Attendees cannot check in to a service session, and **every staff
|
||||
member is auto-assigned as its speaker**, so without this guard staff would
|
||||
see a feedback review block on a break/lunch card.
|
||||
|
||||
A **service slot with no session behind it** (an orphan left over from an
|
||||
earlier feed or a manual edit) is **hidden entirely** by `groupAgenda`, exactly
|
||||
@@ -186,11 +191,16 @@ the agenda list, its slot count, and Home's Now/Next cards all agree.
|
||||
speakers, room, capacity, checked-in state) and actions. The subtitle shows
|
||||
**time · room**, prefixed with the **slot name only when it adds
|
||||
information** — auto-named talk slots ("Slot 10:15–11:00") and service slots
|
||||
named like their session are not repeated:
|
||||
named like their session are not repeated. The **description keeps the line
|
||||
breaks** carried by the Sessionize/Excel feed (`.sd-desc` uses
|
||||
`white-space: pre-line`), so multi-paragraph text stays readable instead of
|
||||
collapsing into one block:
|
||||
- **Give feedback ⭐** — only when the session is *done* **and** the user is
|
||||
checked in. Opens the Feedback takeover (`openFeedback(sessionId)`).
|
||||
- **Speaker feedback review** — when the user is a **speaker** of the session
|
||||
**and** the session is *done*, a **"⭐ Your session feedback"** block shows the
|
||||
checked in **and** it is not a service session. Opens the Feedback takeover
|
||||
(`openFeedback(sessionId)`).
|
||||
- **Speaker feedback review** — when the user is a **speaker** of a
|
||||
**non-service** session **and** the session is *done*, a **"⭐ Your session
|
||||
feedback"** block shows the
|
||||
session's **average rating** (stars + number) and the **AI-generated summary**
|
||||
(`ai_generated_feedback`). It is **never shown while the session is still
|
||||
running** — only after it's over.
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ current phase.
|
||||
> **Real-time clock toggle** (a per-event `events.use_realtime_clock` flag,
|
||||
> toggled in the admin Events view, switches the attendee app between the real
|
||||
> system clock and the simulated mid-event clock for Live/Next/Done status; the
|
||||
> Home header shows a 🎬 Demo clock badge only in simulated mode), and
|
||||
> simulated clock has no badge in the UI), and
|
||||
> **Post-event reporting + talk networking incentives** (a per-event
|
||||
> `talk_networking_bonus` awarded when two people who shared a checked-in talk
|
||||
> accept a connection, a Convivo **Networking** sub-tab inside the Connect
|
||||
@@ -502,8 +502,8 @@ drives slot status (Live/Next/Done) from the **real system clock** or the
|
||||
(on = real clock, off = simulated). Saved via `upsertEvent`.
|
||||
- **App:** `useEvent()` picks `now` from the flag — `new Date()` when on,
|
||||
`DEFAULT_NOW` when off — and exposes `clockMode` (`'realtime'` |
|
||||
`'simulated'`). The Home header shows a **🎬 Demo clock** badge only in
|
||||
simulated mode (nothing when the real clock is on). With the real clock on and
|
||||
`'simulated'`). Neither mode shows a badge in the UI (the simulated clock is a
|
||||
demo aid only, attendees are not told about it). With the real clock on and
|
||||
the event in the past, every slot is
|
||||
`done` (no Now/Next card); with it off, the simulated clock restores the live
|
||||
slot.
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# Attendee Feedback Polish (2026-10-18)
|
||||
|
||||
Three fixes requested by Sabrina after hands-on testing of `convivo.appe.at`.
|
||||
All presentation-layer (attendee app only) — no migration, no RPC, no admin or
|
||||
sidecar change.
|
||||
|
||||
## 1. Session description collapsed into one block
|
||||
|
||||
**Symptom.** The session detail sheet rendered multi-paragraph descriptions as a
|
||||
single unreadable wall of text.
|
||||
|
||||
**Root cause.** The feed carries real line breaks: the sidecar passes Sessionize
|
||||
`s.description` through untouched (`apps/sidecar/src/server.js`), so the DB
|
||||
holds `\n` / `\n\n` (19 of the 33 seeded local sessions are multi-line). The
|
||||
sheet's description `<div>` used a plain inline style, and default CSS collapses
|
||||
newlines into spaces.
|
||||
|
||||
**Fix.** New `.sd-desc` class (`apps/convivo/src/styles.css`):
|
||||
`white-space: pre-line; line-height: 1.55; overflow-wrap: anywhere`, applied to
|
||||
the `#sd-desc` block in `apps/convivo/src/components/SessionDetail.tsx`. The
|
||||
AI feedback summary got the same treatment via
|
||||
`.feedback-review .fr-text`. No markdown parser added — the feed is plain text.
|
||||
|
||||
## 2. "Your session feedback" shown on service sessions
|
||||
|
||||
**Symptom.** Staff opened a Break/Lunch card and saw the speaker feedback review
|
||||
("⭐ Your session feedback", stars, AI summary) — nonsense on a break.
|
||||
|
||||
**Root cause.** `_assign_service_session_speakers` links **every staff
|
||||
registration** as a speaker of **every service slot** (by design, so service
|
||||
sessions have a speaker set). `SessionDetail` showed the review whenever
|
||||
`isSpeaker && status === 'done'`, so any staff member hit it on every finished
|
||||
service card. Attendees can't check in to service sessions, so the
|
||||
"You weren't checked in" note was equally noise there.
|
||||
|
||||
**Fix.** `const showFeedback = !isService;` in `SessionDetail.tsx`; all three
|
||||
feedback surfaces (review block, **Give feedback ⭐** button, "not checked in"
|
||||
note) are gated on it. The sheet itself stays — service cards remain openable
|
||||
(title, time, room, "No pick needed for this slot.").
|
||||
|
||||
## 3. "🎬 Demo clock" badge removed from Home
|
||||
|
||||
The simulated clock (`use_realtime_clock = false`, the default) is an internal
|
||||
demo aid; attendees were never meant to see it. The badge is gone from the Home
|
||||
header (`apps/convivo/src/screens/Home.tsx`, `clockMode` dropped from the
|
||||
`useEvent()` destructure — `noUnusedLocals` requires it). `useEvent()` still
|
||||
exposes `clockMode`; the admin Events toggle is unchanged.
|
||||
|
||||
## Already fixed before this round (no code change)
|
||||
|
||||
- **Pick → detail instead of routing to Agenda** and **duplicated "Slot" time** —
|
||||
shipped in `ef0446d`, live since the 2026-10-16 deploy.
|
||||
- **Filters keep service sessions** — on purpose (confirmed with the user):
|
||||
Level/Area filters apply to talks; service slots always show. Documented in
|
||||
[screens.md](../frontend/screens.md#agenda).
|
||||
- **"No picks" text next to existing picks** — shipped in `999527b`, live since
|
||||
2026-10-17 (verified present in the served bundle `index-CRttiV1E.js`). The
|
||||
screenshot predates that deploy; `index.html` is served `no-cache` and there
|
||||
is no service worker, so a reload picks it up.
|
||||
|
||||
## Verification
|
||||
|
||||
- `convivo-admin-entry.spec.ts`: three new API-mocked cases —
|
||||
*service session detail shows no feedback UI for a staff speaker*,
|
||||
*keeps the paragraph breaks of a multi-line description* (asserts
|
||||
`white-space: pre-line`, exact `textContent` newlines preserved, and that the
|
||||
block renders taller than the same text with collapsed whitespace —
|
||||
`toHaveText` normalises whitespace and would pass trivially), and a
|
||||
no-"Demo clock"-badge assertion appended to each existing demo-clock
|
||||
scenario. **45/45** against the local dev server (`:3000`).
|
||||
- `npm run build --prefix apps/convivo` clean; bundle grep confirms `Demo
|
||||
clock` absent and `.sd-desc`/`.fr-text` in the CSS.
|
||||
- Docs synced in the same commit: [screens.md](../frontend/screens.md),
|
||||
[app-structure.md](../frontend/app-structure.md),
|
||||
[tests.md](../backend/tests.md), [next-steps.md](../next-steps.md).
|
||||
|
||||
## Deployment
|
||||
|
||||
**Not deployed as of 2026-10-18.** Production still serves `index-CRttiV1E.js`
|
||||
(= `999527b`), so items 1–3 above are not yet visible on `convivo.appe.at`.
|
||||
Attendee-only deploy (three files: `SessionDetail.tsx`, `Home.tsx`,
|
||||
`styles.css`); follow the drift-guard + backup procedure in
|
||||
[deployment.md](../deployment.md).
|
||||
@@ -87,6 +87,33 @@ test.describe('Service agenda', () => {
|
||||
await expect(page.locator('.slot-card').filter({ hasText: '11:15' })).toHaveCount(0);
|
||||
await expect(page.locator('.sess .title')).toHaveText(['Arrival & Coffee', 'A Talk', 'Lunch']);
|
||||
});
|
||||
|
||||
// Every staff member is auto-assigned as a speaker of a service slot, so
|
||||
// without an explicit guard a staff user gets a "Your session feedback" block
|
||||
// (and the checked-in feedback entry) on a break/lunch card. Feedback never
|
||||
// applies to a service session: it cannot be checked into.
|
||||
test('service session detail shows no feedback UI for a staff speaker', async ({ page }) => {
|
||||
const { session } = await mockApi(page, { registered: true, checkedIn: true, staff: true });
|
||||
const rows = [
|
||||
{ slot_id: 1, slot_name: 'Lunch', start_time: '08:30:00', end_time: '09:00:00', slot_type: 'service_session',
|
||||
session_id: 'session-1', title: 'Lunch', room: 'Main', speakers: 'Staff One, Staff Two' },
|
||||
].map(row => ({ ...row, slot_date: '2026-02-20', description: 'Lunch is served.', material_path: null, capacity: null,
|
||||
average_feedback: 4.5, ai_generated_feedback: 'Guests liked the coffee.', level: null, area: null }));
|
||||
await page.route('**/rest/v1/rpc/get_agenda', route => route.fulfill({ json: rows }));
|
||||
// The staff contact is the assigned speaker of the (finished) service slot.
|
||||
await page.route('**/rest/v1/session_speakers**', route => route.fulfill({ json: [{ session_id: 'session-1' }] }));
|
||||
await page.goto(`${appUrl}/auth/callback#access_token=${session.access_token}&refresh_token=${session.refresh_token}&type=magiclink`);
|
||||
await page.getByTestId('tab-agenda').click();
|
||||
await page.locator('.sess .title', { hasText: /^Lunch$/ }).click();
|
||||
|
||||
// The sheet still opens with the basic facts…
|
||||
await expect(page.locator('.sheet h3')).toHaveText('Lunch');
|
||||
await expect(page.getByText('No pick needed for this slot.', { exact: true })).toBeVisible();
|
||||
// …but no feedback surface of any kind.
|
||||
await expect(page.getByText('Your session feedback')).toHaveCount(0);
|
||||
await expect(page.getByTestId('give-feedback')).toHaveCount(0);
|
||||
await expect(page.getByText('You weren’t checked in to this session.')).toHaveCount(0);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Home session picks', () => {
|
||||
@@ -135,6 +162,45 @@ test.describe('Home session picks', () => {
|
||||
await expect(page.getByTestId('home-pick')).toHaveCount(1);
|
||||
});
|
||||
|
||||
// Sessionize/Excel descriptions carry real paragraphs; without pre-line they
|
||||
// collapse into one hard-to-read block.
|
||||
test('keeps the paragraph breaks of a multi-line description', async ({ page }) => {
|
||||
const { session } = await mockApi(page, {
|
||||
registered: true, checkedIn: true,
|
||||
picks: [{ slot_id: 1, session_id: 'session-1' }],
|
||||
});
|
||||
const rows = [
|
||||
{ slot_id: 1, slot_name: 'Slot 10:15–11:00', start_time: '10:15:00', end_time: '11:00:00', slot_type: 'session',
|
||||
session_id: 'session-1', title: 'Wrapped Talk', room: 'Room A', speakers: 'Ada Lovelace',
|
||||
description: 'First paragraph.\n\nSecond paragraph.\nA single break.', level: null, area: null },
|
||||
].map(row => ({ ...row, slot_date: '2026-02-20', material_path: null, capacity: null,
|
||||
average_feedback: null, ai_generated_feedback: null }));
|
||||
await page.route('**/rest/v1/rpc/get_agenda', route => route.fulfill({ json: rows }));
|
||||
await page.goto(`${appUrl}/auth/callback#access_token=${session.access_token}&refresh_token=${session.refresh_token}&type=magiclink`);
|
||||
|
||||
await page.getByTestId('home-pick').click();
|
||||
const desc = page.locator('#sd-desc');
|
||||
await expect(desc).toHaveCSS('white-space', 'pre-line');
|
||||
// The newlines survive in the DOM…
|
||||
await expect(desc.evaluate((el) => el.textContent)).resolves.toBe(
|
||||
'First paragraph.\n\nSecond paragraph.\nA single break.',
|
||||
);
|
||||
// …and they actually break the lines (the block is taller than the same
|
||||
// text rendered with collapsed whitespace).
|
||||
const heightWith = (whiteSpace: string) => desc.evaluate(
|
||||
(el, value) => {
|
||||
const node = el as HTMLElement;
|
||||
const previous = node.style.whiteSpace;
|
||||
node.style.whiteSpace = value;
|
||||
const height = node.getBoundingClientRect().height;
|
||||
node.style.whiteSpace = previous;
|
||||
return height;
|
||||
},
|
||||
whiteSpace,
|
||||
);
|
||||
expect(await heightWith('pre-line')).toBeGreaterThan(await heightWith('normal'));
|
||||
});
|
||||
|
||||
// The Now/Next card lists concurrent sessions when the user has no pick for
|
||||
// that specific slot. Its "No pick yet" nudge must disappear once the user
|
||||
// has any pick at all — otherwise it contradicts the "My picks today" list
|
||||
@@ -202,6 +268,10 @@ test.describe('Event demo clock', () => {
|
||||
await expect(status('Morning service')).toHaveText('Done');
|
||||
await expect(status('Current talk')).toHaveText(scenario.realtimeClock ? 'Done' : '● Live');
|
||||
await expect(status('Later talk')).toHaveText(scenario.realtimeClock ? 'Done' : 'Up next');
|
||||
// The simulated clock is an internal demo aid only — the Home header must
|
||||
// never advertise it to attendees, in either mode.
|
||||
await page.getByTestId('tab-home').click();
|
||||
await expect(page.getByText('Demo clock')).toHaveCount(0);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user