Fix reading session timeline long sessions bug, tooltip perf, and ISO week mismatch (#2848)

This commit is contained in:
ACX
2026-02-22 12:46:33 -07:00
committed by GitHub
parent 4d0f529b76
commit d2e6722f98
4 changed files with 34 additions and 8 deletions
@@ -84,7 +84,7 @@
[style.width.%]="session.width"
[style.top]="session.totalLevels > 1 ? 'calc(' + session.level + ' / ' + session.totalLevels + ' * 100% + ' + session.level * 2 + 'px)' : '0'"
[style.height]="session.totalLevels > 1 ? 'calc((1 / ' + session.totalLevels + ' * 100%) - ' + (session.totalLevels - 1) * 2 / session.totalLevels + 'px)' : '100%'"
[pTooltip]="getTooltipContent(session)"
[pTooltip]="session.tooltipContent"
[escape]="false"
tooltipPosition="top"
tooltipStyleClass="session-timeline-tooltip"
@@ -42,6 +42,7 @@ interface TimelineSession {
bookType: BookType;
level: number;
totalLevels: number;
tooltipContent: string;
}
interface DayTimeline {
@@ -319,7 +320,7 @@ export class ReadingSessionTimelineComponent implements OnInit {
width = 0.5;
}
return {
const timelineSession: TimelineSession = {
startHour,
startMinute,
endHour,
@@ -331,8 +332,11 @@ export class ReadingSessionTimelineComponent implements OnInit {
bookId: session.bookId,
bookType: session.bookType,
level,
totalLevels
totalLevels,
tooltipContent: ''
};
timelineSession.tooltipContent = this.buildTooltipContent(timelineSession);
return timelineSession;
}
public formatTime(hour: number, minute: number): string {
@@ -375,7 +379,7 @@ export class ReadingSessionTimelineComponent implements OnInit {
return this.urlHelperService.getDirectThumbnailUrl(bookId);
}
public getTooltipContent(session: TimelineSession): string {
private buildTooltipContent(session: TimelineSession): string {
return `
<div class="session-tooltip-content">
<div class="session-tooltip-cover">