trenesky commited on
Commit
378ec4e
·
verified ·
1 Parent(s): 92c459b

when task is added to be in task page, when note is added to be in notes page - Follow Up Deployment

Browse files
Files changed (2) hide show
  1. index.html +7 -5
  2. prompts.txt +2 -1
index.html CHANGED
@@ -256,13 +256,15 @@
256
  const userName = localStorage.getItem('sharedNotesUserName') || document.getElementById('user-name').value.trim();
257
  if (!text || !userName) return;
258
 
 
 
259
  try {
260
  await addDoc(collection(db, "notes"), {
261
  text,
262
  userName,
263
- done: false,
264
  createdAt: serverTimestamp(),
265
- type: document.querySelector('.tab-content.active').id.split('-')[0] // 'tasks' or 'notes'
266
  });
267
  noteInput.value = '';
268
  } catch (err) {
@@ -284,7 +286,7 @@
284
  li.innerHTML = `
285
  <div class="flex items-center flex-1">
286
  ${note.type === 'tasks' ? `<input type="checkbox" class="done-checkbox w-5 h-5 mr-3 rounded border-gray-300 text-blue-600 focus:ring-blue-500" ${note.done ? "checked" : ""}>` : ''}
287
- <div>
288
  <span class="note-text ${note.done ? "line-through text-gray-400 dark:text-gray-500" : ""}">${note.text}</span>
289
  <div class="text-xs text-gray-500 dark:text-gray-400 mt-1">Added by ${note.userName || 'Anonymous'}</div>
290
  </div>
@@ -324,7 +326,7 @@
324
  const unsubscribeTasks = onSnapshot(tasksQuery, (snapshot) => {
325
  tasksList.innerHTML = "";
326
  if (snapshot.empty) {
327
- notesList.innerHTML = '<div class="text-center py-8"><i data-feather="check-circle" class="w-12 h-12 mx-auto text-gray-400"></i><p class="mt-2 text-gray-500 text-lg">No tasks yet. Add your first task!</p></div>';
328
  feather.replace();
329
  return;
330
  }
@@ -341,7 +343,7 @@
341
  const unsubscribeNotes = onSnapshot(notesQuery, (snapshot) => {
342
  notesList.innerHTML = "";
343
  if (snapshot.empty) {
344
- notesListNotes.innerHTML = '<div class="text-center py-8"><i data-feather="edit" class="w-12 h-12 mx-auto text-gray-400"></i><p class="mt-2 text-gray-500 text-lg">No notes yet. Add your first note!</p></div>';
345
  feather.replace();
346
  return;
347
  }
 
256
  const userName = localStorage.getItem('sharedNotesUserName') || document.getElementById('user-name').value.trim();
257
  if (!text || !userName) return;
258
 
259
+ const activeTab = document.querySelector('.tab-content.active').id.split('-')[0];
260
+
261
  try {
262
  await addDoc(collection(db, "notes"), {
263
  text,
264
  userName,
265
+ done: activeTab === 'tasks', // Only tasks have checkboxes
266
  createdAt: serverTimestamp(),
267
+ type: activeTab
268
  });
269
  noteInput.value = '';
270
  } catch (err) {
 
286
  li.innerHTML = `
287
  <div class="flex items-center flex-1">
288
  ${note.type === 'tasks' ? `<input type="checkbox" class="done-checkbox w-5 h-5 mr-3 rounded border-gray-300 text-blue-600 focus:ring-blue-500" ${note.done ? "checked" : ""}>` : ''}
289
+ <div class="${note.type === 'tasks' ? 'w-[calc(100%-2rem)]' : 'w-full'}">
290
  <span class="note-text ${note.done ? "line-through text-gray-400 dark:text-gray-500" : ""}">${note.text}</span>
291
  <div class="text-xs text-gray-500 dark:text-gray-400 mt-1">Added by ${note.userName || 'Anonymous'}</div>
292
  </div>
 
326
  const unsubscribeTasks = onSnapshot(tasksQuery, (snapshot) => {
327
  tasksList.innerHTML = "";
328
  if (snapshot.empty) {
329
+ tasksList.innerHTML = '<div class="text-center py-8"><i data-feather="check-circle" class="w-12 h-12 mx-auto text-gray-400"></i><p class="mt-2 text-gray-500 text-lg">No tasks yet. Add your first task!</p></div>';
330
  feather.replace();
331
  return;
332
  }
 
343
  const unsubscribeNotes = onSnapshot(notesQuery, (snapshot) => {
344
  notesList.innerHTML = "";
345
  if (snapshot.empty) {
346
+ notesList.innerHTML = '<div class="text-center py-8"><i data-feather="edit" class="w-12 h-12 mx-auto text-gray-400"></i><p class="mt-2 text-gray-500 text-lg">No notes yet. Add your first note!</p></div>';
347
  feather.replace();
348
  return;
349
  }
prompts.txt CHANGED
@@ -15,4 +15,5 @@ lets this be tasks, add tab for notes, and one with calendar so we can note on c
15
  calendar and task not working, should work
16
  fix notes and calendar, make them working tabs, same as tasks
17
  fix notes and calendar, make them working tabs, same as tasks
18
- added notes should remain in notes tab, not in tasks tab
 
 
15
  calendar and task not working, should work
16
  fix notes and calendar, make them working tabs, same as tasks
17
  fix notes and calendar, make them working tabs, same as tasks
18
+ added notes should remain in notes tab, not in tasks tab
19
+ when task is added to be in task page, when note is added to be in notes page