From d73805be2adad9fe88e225b014fa4dccc6782ca3 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Mon, 30 Mar 2026 16:54:40 -0500 Subject: [PATCH] show favorites across all days when current day has none When viewing favorites and the selected day has none, shows a contextual message with option to view all favorites across every day in a single combined list. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/app/pages/schedule/schedule.html | 9 ++++-- src/app/pages/schedule/schedule.ts | 32 ++++++++++++++++++++++ src/app/providers/conference-data.ts | 41 ++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/src/app/pages/schedule/schedule.html b/src/app/pages/schedule/schedule.html index 4c12624e..0b5dd195 100644 --- a/src/app/pages/schedule/schedule.html +++ b/src/app/pages/schedule/schedule.html @@ -33,8 +33,11 @@
-

No favorites yet

-

Browse the schedule and tap the on sessions you're interested in to build your personal schedule.

+

No favorites yet

+

Browse the schedule and tap the on sessions you're interested in to build your personal schedule.

+

No favorites on {{days[dayIndex]?.day}}

+

You have favorites on other days.

+ Show favorites on other days Show all sessions
@@ -56,7 +59,7 @@

No favorites yet

- {{days[dayIndex].day}} - {{group.time}} + {{allDaysMode ? group.dayLabel : days[dayIndex]?.day}} - {{group.time}} diff --git a/src/app/pages/schedule/schedule.ts b/src/app/pages/schedule/schedule.ts index 19d95397..dc994129 100644 --- a/src/app/pages/schedule/schedule.ts +++ b/src/app/pages/schedule/schedule.ts @@ -36,6 +36,8 @@ export class SchedulePage implements OnInit, OnDestroy { currentTime: Date; todayIndex: string = null; jumpBtnCollapsed: boolean = false; + hasFavoritesOnOtherDays: boolean = false; + allDaysMode: boolean = false; private favoritesSubscription: Subscription; constructor( @@ -130,6 +132,7 @@ export class SchedulePage implements OnInit, OnDestroy { updateSchedule() { this.searchedAllDays = false; + this.allDaysMode = false; // Close any open sliding items when the schedule updates if (this.scheduleList) { @@ -143,6 +146,12 @@ export class SchedulePage implements OnInit, OnDestroy { this.confData.getTimeline(this.dayIndex, this.queryText, this.excludeTracks, this.segment).subscribe((data: any) => { this.shownSessions = data.shownSessions; this.groups = data.groups; + + if (this.segment === 'favorites' && this.shownSessions === 0) { + this.checkFavoritesOnOtherDays(); + } else { + this.hasFavoritesOnOtherDays = false; + } }); this.changeDetectorRef.detectChanges(); @@ -178,6 +187,29 @@ export class SchedulePage implements OnInit, OnDestroy { this.updateSchedule(); } + checkFavoritesOnOtherDays() { + this.hasFavoritesOnOtherDays = false; + for (let i = 0; i < this.days.length; i++) { + if (String(i) === this.dayIndex) continue; + this.confData.getTimeline(String(i), '', this.excludeTracks, 'favorites').subscribe((data: any) => { + if (data.shownSessions > 0) { + this.hasFavoritesOnOtherDays = true; + this.changeDetectorRef.detectChanges(); + } + }); + } + } + + showAllFavorites() { + this.allDaysMode = true; + this.confData.getAllDaysTimeline(this.queryText, this.excludeTracks, 'favorites').subscribe((data: any) => { + this.shownSessions = data.shownSessions; + this.groups = data.groups; + this.hasFavoritesOnOtherDays = false; + this.changeDetectorRef.detectChanges(); + }); + } + searchAllDays() { let found = false; let checked = 0; diff --git a/src/app/providers/conference-data.ts b/src/app/providers/conference-data.ts index 49666fca..e509bd63 100644 --- a/src/app/providers/conference-data.ts +++ b/src/app/providers/conference-data.ts @@ -477,6 +477,47 @@ export class ConferenceData { ); } + getAllDaysTimeline( + queryText = '', + excludeTracks: any[] = [], + segment = 'all' + ) { + return this.load().pipe( + map((data: any) => { + const schedule = data.schedule.sort(function(a, b){var x = a.date; var y = b.date; return ((x < y) ? -1 : ((x > y) ? 1 : 0));}); + let shownSessions = 0; + const allGroups = []; + + queryText = queryText.toLowerCase().replace(/,|\.|-/g, ' '); + const queryWords = queryText.split(' ').filter(w => !!w.trim().length); + + schedule.forEach((day: any) => { + const dateObj = new Date(day.date + "T00:00:00.000-12:00"); + const dayLabel = dateObj.toLocaleDateString('en-us', {timeZone: environment.timezone, weekday: 'short'}); + + day.groups.forEach((group: any) => { + group.hide = true; + group.dayLabel = dayLabel; + + group.sessions.forEach((session: any) => { + this.filterSession(session, queryWords, excludeTracks, segment); + if (!session.hide) { + group.hide = false; + shownSessions++; + } + }); + + if (!group.hide) { + allGroups.push(group); + } + }); + }); + + return { shownSessions, groups: allGroups }; + }) + ); + } + getSessions( queryText = '', excludeTracks: any[] = [],