diff --git a/lib/utils/programmer_day_rows.dart b/lib/utils/programmer_day_rows.dart index 896bcf90..0cb13d8c 100644 --- a/lib/utils/programmer_day_rows.dart +++ b/lib/utils/programmer_day_rows.dart @@ -74,8 +74,6 @@ List buildDayRows({ // Process each task for (final task in tasks) { - if (!taskMap.containsKey(task.id)) continue; - final assigneeId = task.assigneeId; // Compute daily seconds for this task @@ -88,12 +86,14 @@ List buildDayRows({ final userDailySeconds = dailyByAssignee[userId] ?? {}; final assigneeSeconds = userDailySeconds[day] ?? 0; - // Check for assignee row: has seconds that day OR authored notes-only log that day + // Check for assignee row: has seconds that day OR (is assignee AND authored notes-only log that day) final assigneeLogsKey = '${task.id}:$userId'; - final assigneeLogsThisDay = workLogsByTaskAndAuthor[assigneeLogsKey] - ?.where((l) => l.workDate == day && l.minutes == null) - .toList() ?? - []; + final assigneeLogsThisDay = (userId == assigneeId) + ? (workLogsByTaskAndAuthor[assigneeLogsKey] + ?.where((l) => l.workDate == day && l.minutes == null) + .toList() ?? + []) + : []; if (assigneeSeconds > 0 || assigneeLogsThisDay.isNotEmpty) { final notes = assigneeLogsThisDay diff --git a/test/programmer_day_rows_test.dart b/test/programmer_day_rows_test.dart index 60cb7639..a2c337c6 100644 --- a/test/programmer_day_rows_test.dart +++ b/test/programmer_day_rows_test.dart @@ -24,6 +24,10 @@ void main() { expect(deltaJsonToPlainText('[{invalid json'), '[{invalid json'); }); + test('Delta JSON with insert is converted to plain text', () { + expect(deltaJsonToPlainText('[{"insert":"Hello\\n"}]'), 'Hello'); + }); + test('Delta JSON arrays starting with [ are attempted to be parsed', () { // The function attempts to parse JSON that starts with '[' // If parsing fails, it returns the trimmed string