From 645df1d00f953524c6da22103d26c38ae4331cd6 Mon Sep 17 00:00:00 2001 From: Skitty1238 <157652284+Skitty1238@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:59:34 -0400 Subject: partial google calendar task integration + fix with dark mode colors for task nodes so that text is still visible --- src/client/views/nodes/TaskBox.scss | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/client/views/nodes/TaskBox.scss') diff --git a/src/client/views/nodes/TaskBox.scss b/src/client/views/nodes/TaskBox.scss index 0fcc2f955..6ef0c6454 100644 --- a/src/client/views/nodes/TaskBox.scss +++ b/src/client/views/nodes/TaskBox.scss @@ -6,6 +6,15 @@ width: 100%; height: 100%; box-sizing: border-box; + + input, + textarea, + select, + button { + background-color: #fff !important; + color: #000 !important; + border-color: #ccc !important; + } } .task-manager-title { @@ -69,4 +78,4 @@ input[type="datetime-local"] { border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; -} +} \ No newline at end of file -- cgit v1.2.3-70-g09d2 From eb9c93a635191ef9ec842592c4a85262811cf108 Mon Sep 17 00:00:00 2001 From: Skitty1238 <157652284+Skitty1238@users.noreply.github.com> Date: Wed, 4 Jun 2025 21:05:47 -0400 Subject: allowed for incomplete tasks + fix for all day tasks not being added correctly + button styling --- src/client/views/nodes/TaskBox.scss | 30 +++++++-- src/client/views/nodes/TaskBox.tsx | 130 ++++++++++++------------------------ 2 files changed, 68 insertions(+), 92 deletions(-) (limited to 'src/client/views/nodes/TaskBox.scss') diff --git a/src/client/views/nodes/TaskBox.scss b/src/client/views/nodes/TaskBox.scss index 6ef0c6454..a7f75acdb 100644 --- a/src/client/views/nodes/TaskBox.scss +++ b/src/client/views/nodes/TaskBox.scss @@ -40,7 +40,7 @@ resize: none; line-height: 1.4; resize: none; - flex-grow: 1 + flex-grow: 1; } .task-manager-checkboxes { @@ -49,7 +49,8 @@ gap: 16px; } -.task-manager-allday, .task-manager-complete { +.task-manager-allday, +.task-manager-complete { display: flex; align-items: center; gap: 6px; @@ -71,11 +72,32 @@ gap: 4px; } -input[type="datetime-local"] { +input[type='datetime-local'] { width: 100%; font-size: 0.9rem; padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; -} \ No newline at end of file +} + +.task-manager-checkboxes { + display: flex; + flex-wrap: wrap; /* allows wrapping on small screens */ + align-items: center; + gap: 16px; + row-gap: 8px; /* optional: tighter vertical spacing if it wraps */ +} + +.task-manager-google { + font-size: 0.85rem; + padding: 6px 12px; + border-radius: 6px; + background-color: #4285f4; + color: white; + border: none; + cursor: pointer; + white-space: nowrap; + transition: background-color 0.2s ease; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); +} diff --git a/src/client/views/nodes/TaskBox.tsx b/src/client/views/nodes/TaskBox.tsx index 8855e43c8..0d4fb622b 100644 --- a/src/client/views/nodes/TaskBox.tsx +++ b/src/client/views/nodes/TaskBox.tsx @@ -255,6 +255,48 @@ export class TaskBox extends React.Component { Complete + + {!allDay && ( @@ -269,94 +311,6 @@ export class TaskBox extends React.Component { )} - - {/** test button */} - {/* */} - - {/* */} - - ); } -- cgit v1.2.3-70-g09d2 From d73f7d9960285aceec01ef41a80bbb19e5d86f8c Mon Sep 17 00:00:00 2001 From: Skitty1238 <157652284+Skitty1238@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:35:57 -0400 Subject: style changes --- src/client/views/nodes/TaskBox.scss | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/client/views/nodes/TaskBox.scss') diff --git a/src/client/views/nodes/TaskBox.scss b/src/client/views/nodes/TaskBox.scss index a7f75acdb..cc04f7973 100644 --- a/src/client/views/nodes/TaskBox.scss +++ b/src/client/views/nodes/TaskBox.scss @@ -1,4 +1,5 @@ .task-manager-container { + color-scheme: light; display: flex; flex-direction: column; padding: 8px; @@ -6,15 +7,6 @@ width: 100%; height: 100%; box-sizing: border-box; - - input, - textarea, - select, - button { - background-color: #fff !important; - color: #000 !important; - border-color: #ccc !important; - } } .task-manager-title { @@ -93,11 +85,17 @@ input[type='datetime-local'] { font-size: 0.85rem; padding: 6px 12px; border-radius: 6px; - background-color: #4285f4; + background-color: #5e88c8; color: white; border: none; cursor: pointer; white-space: nowrap; transition: background-color 0.2s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); + + &:hover { + background-color: #4773b0; // darker shade of your base blue + color: white; + transform: scale(1.01); // subtle hover feel without real size change + } } -- cgit v1.2.3-70-g09d2 From 353fcddb918ee9ccaedd69032f9212fc66c04a7f Mon Sep 17 00:00:00 2001 From: Skitty1238 <157652284+Skitty1238@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:54:09 -0400 Subject: sync button only accessible when a change is made to the task (to counter unnecessary syncing) --- src/client/views/nodes/TaskBox.scss | 8 +++++- src/client/views/nodes/TaskBox.tsx | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) (limited to 'src/client/views/nodes/TaskBox.scss') diff --git a/src/client/views/nodes/TaskBox.scss b/src/client/views/nodes/TaskBox.scss index cc04f7973..071fe1f7c 100644 --- a/src/client/views/nodes/TaskBox.scss +++ b/src/client/views/nodes/TaskBox.scss @@ -92,10 +92,16 @@ input[type='datetime-local'] { white-space: nowrap; transition: background-color 0.2s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); - + &:hover { background-color: #4773b0; // darker shade of your base blue color: white; transform: scale(1.01); // subtle hover feel without real size change } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; + } } diff --git a/src/client/views/nodes/TaskBox.tsx b/src/client/views/nodes/TaskBox.tsx index 7df3876c3..82c22057e 100644 --- a/src/client/views/nodes/TaskBox.tsx +++ b/src/client/views/nodes/TaskBox.tsx @@ -23,6 +23,23 @@ interface TaskBoxProps { */ @observer export class TaskBox extends React.Component { + // contains the last synced task information + lastSyncedTask: { + title: string; + text: string; + due?: string; + completed: boolean; + } = { + title: '', + text: '', + due: '', + completed: false, + }; + + state = { + needsSync: false, + }; + /** * Method to reuturn the * @param fieldStr @@ -234,6 +251,34 @@ export class TaskBox extends React.Component { } } ); + + this._googleTaskCreateDisposer = reaction( + () => { + const { title, text, $task_completed, $task_dateRange, $task_startTime, $task_endTime, $task_allDay } = doc; + + const completed = !!$task_completed; + let due: string | undefined; + + if ($task_allDay && typeof $task_dateRange === 'string') { + const datePart = $task_dateRange.split('|')[0]; + if (datePart && !isNaN(new Date(datePart).getTime())) { + due = new Date(datePart + 'T00:00:00Z').toISOString(); + } + } else if ($task_endTime && $task_endTime instanceof DateField && $task_endTime.date) { + due = $task_endTime.date.toISOString(); + } else if ($task_startTime && $task_startTime instanceof DateField && $task_startTime.date) { + due = $task_startTime.date.toISOString(); + } + + return { title, text, completed, due }; + }, + current => { + const hasChanged = current.title !== this.lastSyncedTask.title || current.text !== this.lastSyncedTask.text || current.due !== this.lastSyncedTask.due || current.completed !== this.lastSyncedTask.completed; + + this.setState({ needsSync: hasChanged }); + }, + { fireImmediately: true } + ); } componentWillUnmount() { @@ -350,6 +395,15 @@ export class TaskBox extends React.Component { if (result?.id) { alert('✅ Task synced with Google Tasks!'); + if (result?.id) { + this.lastSyncedTask = { + title: taskTitle, + text: taskDesc, + due, + completed: isCompleted, + }; + this.setState({ needsSync: false }); + } } else { alert(`❌ Failed: ${result?.error?.message || 'Unknown error'}`); } @@ -402,6 +456,7 @@ export class TaskBox extends React.Component { + + {!allDay && (
- - - +
+ + + +
{!allDay && (
-- cgit v1.2.3-70-g09d2