@@ -312,16 +312,16 @@ export class NavigationManager {
312312 breakMinutes : 0
313313 } ) ) ;
314314
315- // Process today's sessions
315+ // Process today's sessions (excluding break sessions)
316316 todaysSessions . forEach ( session => {
317317 const [ startHour ] = session . start_time . split ( ':' ) . map ( Number ) ;
318318 const duration = session . duration || 0 ;
319319
320- if ( session . session_type === 'focus' ) {
320+ // Only include focus and custom sessions, exclude break sessions
321+ if ( session . session_type === 'focus' || session . session_type === 'custom' ) {
321322 hourlyData [ startHour ] . focusMinutes += duration ;
322- } else if ( session . session_type === 'break' || session . session_type === 'longBreak' ) {
323- hourlyData [ startHour ] . breakMinutes += duration ;
324323 }
324+ // Skip break and longBreak sessions from chart display
325325 } ) ;
326326
327327 // If we have timer session data but no manual sessions, distribute timer sessions across the current hour
@@ -335,41 +335,32 @@ export class NavigationManager {
335335 }
336336 }
337337
338- // Find max total minutes for scaling
338+ // Find max total minutes for scaling (only focus minutes now)
339339 const maxTotalMinutes = Math . max (
340- ...hourlyData . map ( data => data . focusMinutes + data . breakMinutes ) ,
340+ ...hourlyData . map ( data => data . focusMinutes ) ,
341341 60 // Minimum scale of 1 hour
342342 ) ;
343343
344344 hours . forEach ( hour => {
345345 const data = hourlyData [ hour ] ;
346- const totalMinutes = data . focusMinutes + data . breakMinutes ;
346+ const totalMinutes = data . focusMinutes ; // Only focus minutes now
347347
348348 const hourBar = document . createElement ( 'div' ) ;
349349 hourBar . className = 'hour-bar' ;
350350
351- // Calculate height based on total activity in this hour
351+ // Calculate height based on focus activity in this hour
352352 const height = totalMinutes > 0
353353 ? Math . max ( ( totalMinutes / maxTotalMinutes ) * maxHeight , 8 )
354354 : 8 ; // Minimum height for visibility
355355
356356 hourBar . style . height = `${ height } px` ;
357357
358- // Create segments for focus and break time if there's data
358+ // Create focus segment if there's data
359359 if ( totalMinutes > 0 ) {
360- if ( data . focusMinutes > 0 ) {
361- const focusSegment = document . createElement ( 'div' ) ;
362- focusSegment . className = 'hour-bar-focus' ;
363- focusSegment . style . height = `${ ( data . focusMinutes / totalMinutes ) * 100 } %` ;
364- hourBar . appendChild ( focusSegment ) ;
365- }
366-
367- if ( data . breakMinutes > 0 ) {
368- const breakSegment = document . createElement ( 'div' ) ;
369- breakSegment . className = 'hour-bar-break' ;
370- breakSegment . style . height = `${ ( data . breakMinutes / totalMinutes ) * 100 } %` ;
371- hourBar . appendChild ( breakSegment ) ;
372- }
360+ const focusSegment = document . createElement ( 'div' ) ;
361+ focusSegment . className = 'hour-bar-focus' ;
362+ focusSegment . style . height = '100%' ; // Full height since only focus
363+ hourBar . appendChild ( focusSegment ) ;
373364 } else {
374365 // Empty hour - show subtle background
375366 hourBar . classList . add ( 'hour-bar-empty' ) ;
@@ -381,10 +372,9 @@ export class NavigationManager {
381372 hourLabel . textContent = hour . toString ( ) . padStart ( 2 , '0' ) ;
382373 hourBar . appendChild ( hourLabel ) ;
383374
384- // Enhanced tooltip with session details
375+ // Enhanced tooltip with session details (focus only)
385376 const focusText = data . focusMinutes > 0 ? `${ data . focusMinutes } m focus` : '' ;
386- const breakText = data . breakMinutes > 0 ? `${ data . breakMinutes } m break` : '' ;
387- const activityText = [ focusText , breakText ] . filter ( text => text ) . join ( ', ' ) || 'No activity' ;
377+ const activityText = focusText || 'No activity' ;
388378
389379 // Use custom tooltip instead of native title
390380 hourBar . dataset . tooltip = `${ hour } :00 - ${ activityText } ` ;
@@ -395,7 +385,6 @@ export class NavigationManager {
395385 // Add data attributes for potential future interactions
396386 hourBar . dataset . hour = hour ;
397387 hourBar . dataset . focusMinutes = data . focusMinutes ;
398- hourBar . dataset . breakMinutes = data . breakMinutes ;
399388
400389 dailyChart . appendChild ( hourBar ) ;
401390 } ) ;
@@ -682,13 +671,18 @@ export class NavigationManager {
682671 return ;
683672 }
684673
685- // Create timeline session blocks
686- allSessions . forEach ( session => {
687- this . createTimelineSession ( session , date , timelineTrack , allSessions ) ;
674+ // Filter out break sessions from timeline display
675+ const visibleSessions = allSessions . filter ( session =>
676+ session . session_type !== 'break' && session . session_type !== 'longBreak'
677+ ) ;
678+
679+ // Create timeline session blocks (excluding break sessions)
680+ visibleSessions . forEach ( session => {
681+ this . createTimelineSession ( session , date , timelineTrack , visibleSessions ) ;
688682 } ) ;
689683
690684 // Calculate and set timeline height after all sessions are added
691- this . updateTimelineHeight ( timelineTrack , allSessions . length ) ;
685+ this . updateTimelineHeight ( timelineTrack , visibleSessions . length ) ;
692686
693687 // Initialize timeline interactions
694688 this . initializeTimelineInteractions ( ) ;
@@ -847,12 +841,22 @@ export class NavigationManager {
847841 }
848842
849843 updateTimelineHeight ( timelineTrack , totalSessions ) {
850- const rowHeight = 20 ; // 15px session height + 5px spacing
851- const baseHeight = 25 ; // Base padding
844+ const rowHeight = 20 ; // Spacing between rows
845+ const sessionHeight = 15 ; // Height of each session
846+ const topPadding = 10 ; // Top padding
847+ const bottomPadding = 10 ; // Bottom padding
852848 const minHeight = 60 ; // Minimum height even with no sessions
853- const requiredHeight = Math . max ( minHeight , baseHeight + ( totalSessions * rowHeight ) ) ;
854849
855- timelineTrack . style . height = `${ requiredHeight } px` ;
850+ if ( totalSessions === 0 ) {
851+ timelineTrack . style . height = `${ minHeight } px` ;
852+ } else {
853+ // Calculate: top padding + (all session heights) + (spacing between sessions) + bottom padding
854+ const totalSessionHeights = totalSessions * sessionHeight ;
855+ const totalSpacing = ( totalSessions - 1 ) * rowHeight ;
856+ const requiredHeight = topPadding + totalSessionHeights + totalSpacing + bottomPadding ;
857+ console . log ( `Timeline height calculation: ${ topPadding } + ${ totalSessionHeights } + ${ totalSpacing } + ${ bottomPadding } = ${ requiredHeight } px for ${ totalSessions } sessions` ) ;
858+ timelineTrack . style . height = `${ requiredHeight } px` ;
859+ }
856860
857861 // Add vertical grid lines
858862 this . addTimelineGridLines ( timelineTrack ) ;
0 commit comments