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 (ef0446d, 999527b) and that this change is not yet
deployed.
This commit is contained in:
Lago committed 2026-10-18 18:20:16 +02:00
1 parent 1e3c969365
commit 6bde90aac1
9 files changed
+217 -27

No files matched your search

+70
View File
@@ -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);
});
}
});