fix(home): hide the 'No pick yet' nudge once the user has any pick

The Now/Next cards fall back to a concurrent-session list when the user
has no pick for that specific slot, and always appended a 'No pick yet —
tap a session in the Agenda to choose.' hint. With picks on other slots
this contradicted the 'My picks today' list right below (screenshot).
ConcurrentList now takes hasPicks and renders the hint only while the
user has no picks at all.

e2e: two new 'Home session picks' cases (hint hidden with a pick on the
other slot; still shown with none, asserted per card). 43/43 local.
Docs: screens.md nudge rule, tests.md regression note.
This commit is contained in:
Lago committed 2026-10-17 10:36:58 +02:00
1 parent 7733af7625
commit 999527b188
4 files changed
+63 -8

No files matched your search

+12 -7
View File
@@ -26,8 +26,11 @@ function SessionBlock({ session, checkedIn }: { session: Session; checkedIn?: bo
);
}
/** The list of concurrent sessions shown when the user has no pick for the slot. */
function ConcurrentList({ sessions }: { sessions: Session[] }) {
/** The list of concurrent sessions shown when the user has no pick for the slot.
* The "No pick yet" nudge only makes sense for someone who has never picked;
* once the user has any pick it would contradict the "My picks today" list
* below, so it is hidden (hasPicks). */
function ConcurrentList({ sessions, hasPicks }: { sessions: Session[]; hasPicks: boolean }) {
return (
<div className="now-list">
{sessions.map((s) => (
@@ -36,9 +39,11 @@ function ConcurrentList({ sessions }: { sessions: Session[] }) {
<div className="muted small">{s.room} · {s.speakers}</div>
</div>
))}
<div className="muted small" style={{ marginTop: 10 }}>
No pick yet — tap a session in the Agenda to choose.
</div>
{!hasPicks && (
<div className="muted small" style={{ marginTop: 10 }}>
No pick yet — tap a session in the Agenda to choose.
</div>
)}
</div>
);
}
@@ -179,7 +184,7 @@ export function Home({ go, onEventFeedback, openFeedback }: { go: (tab: string)
{nowPick ? (
<SessionBlock session={nowPick} checkedIn={checkins.includes(nowPick.id)} />
) : current.sessions.length > 0 ? (
<ConcurrentList sessions={current.sessions} />
<ConcurrentList sessions={current.sessions} hasPicks={picks.length > 0} />
) : (
<div className="muted small" style={{ marginTop: 10 }}>Nothing scheduled right now.</div>
)}
@@ -196,7 +201,7 @@ export function Home({ go, onEventFeedback, openFeedback }: { go: (tab: string)
{nextPick ? (
<SessionBlock session={nextPick} />
) : next.sessions.length > 0 ? (
<ConcurrentList sessions={next.sessions} />
<ConcurrentList sessions={next.sessions} hasPicks={picks.length > 0} />
) : (
<div className="muted small" style={{ marginTop: 10 }}>Nothing scheduled next.</div>
)}