feat(programmer): dated work-log corrections
Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -16,11 +16,15 @@ import '../programmer_task_prompts.dart';
|
||||
/// a non-assignee helper gets Hours + Minutes fields and is prompted to deduct
|
||||
/// that time from their own running task. The assignee is prompted to pause
|
||||
/// after logging.
|
||||
///
|
||||
/// When [workDate] is supplied the entry is a correction for a past day:
|
||||
/// the header names that date and the pause/deduct prompts are skipped.
|
||||
class WorkLogSection extends ConsumerStatefulWidget {
|
||||
const WorkLogSection({super.key, required this.task, required this.isAssignee});
|
||||
const WorkLogSection({super.key, required this.task, required this.isAssignee, this.workDate});
|
||||
|
||||
final ProgrammerTask task;
|
||||
final bool isAssignee;
|
||||
final DateTime? workDate;
|
||||
|
||||
@override
|
||||
ConsumerState<WorkLogSection> createState() => _WorkLogSectionState();
|
||||
@@ -68,15 +72,18 @@ class _WorkLogSectionState extends ConsumerState<WorkLogSection> {
|
||||
taskId: widget.task.id,
|
||||
description: quillToDeltaJson(_descQuill),
|
||||
minutes: minutes,
|
||||
workDate: widget.workDate,
|
||||
);
|
||||
_descQuill.clear();
|
||||
_hoursCtrl.clear();
|
||||
_minutesCtrl.clear();
|
||||
if (!mounted) return;
|
||||
if (widget.isAssignee) {
|
||||
await maybePromptPauseTimer(context, ref, widget.task);
|
||||
} else if (minutes != null) {
|
||||
await maybePromptDeductHelperTime(context, ref, minutes, widget.task.id);
|
||||
if (widget.workDate == null) {
|
||||
if (widget.isAssignee) {
|
||||
await maybePromptPauseTimer(context, ref, widget.task);
|
||||
} else if (minutes != null) {
|
||||
await maybePromptDeductHelperTime(context, ref, minutes, widget.task.id);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
messenger.showSnackBar(SnackBar(content: Text('Could not save: $e')));
|
||||
@@ -97,7 +104,11 @@ class _WorkLogSectionState extends ConsumerState<WorkLogSection> {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const AppSectionHeader('Work Log'),
|
||||
AppSectionHeader(
|
||||
widget.workDate != null
|
||||
? 'Correction for ${AppTime.formatDate(widget.workDate!)}'
|
||||
: 'Work Log',
|
||||
),
|
||||
QuillFieldEditor(
|
||||
controller: _descQuill,
|
||||
placeholder: widget.isAssignee
|
||||
|
||||
Reference in New Issue
Block a user