trenesky commited on
Commit
92c459b
·
verified ·
1 Parent(s): 989ba3c

added notes should remain in notes tab, not in tasks tab - Follow Up Deployment

Browse files
Files changed (2) hide show
  1. index.html +11 -9
  2. prompts.txt +2 -1
index.html CHANGED
@@ -37,12 +37,12 @@
37
  <main class="flex-1 p-4 max-w-2xl w-full mx-auto">
38
  <!-- Tasks Section -->
39
  <div id="tasks-section" class="tab-content active">
40
- <ul id="notes-list" class="space-y-3"></ul>
41
  </div>
42
 
43
  <!-- Notes Section -->
44
  <div id="notes-section" class="tab-content hidden">
45
- <ul id="notes-list-notes" class="space-y-3"></ul>
46
  </div>
47
 
48
  <!-- Calendar Section -->
@@ -219,8 +219,8 @@
219
  const db = getFirestore(app);
220
 
221
  // DOM Elements
 
222
  const notesList = document.getElementById('notes-list');
223
- const notesListNotes = document.getElementById('notes-list-notes');
224
  const noteInput = document.getElementById('note-input');
225
  const addNoteBtn = document.getElementById('add-note');
226
  const connectionStatus = document.getElementById('connection-status');
@@ -319,32 +319,34 @@
319
 
320
  // Live updates for tasks
321
  const tasksQuery = query(collection(db, "notes"), where("type", "==", "tasks"), orderBy("createdAt", "asc"));
322
- notesList.innerHTML = '<div class="text-center py-8"><div class="inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-blue-500"></div><p class="mt-2 text-gray-500 text-lg">Loading tasks...</p></div>';
 
323
  const unsubscribeTasks = onSnapshot(tasksQuery, (snapshot) => {
324
- notesList.innerHTML = "";
325
  if (snapshot.empty) {
326
  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>';
327
  feather.replace();
328
  return;
329
  }
330
  snapshot.forEach((docSnap) => {
331
- renderNoteItem({ id: docSnap.id, ...docSnap.data() }, notesList);
332
  });
333
  feather.replace();
334
  });
335
 
336
  // Live updates for notes
337
  const notesQuery = query(collection(db, "notes"), where("type", "==", "notes"), orderBy("createdAt", "asc"));
338
- notesListNotes.innerHTML = '<div class="text-center py-8"><div class="inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-blue-500"></div><p class="mt-2 text-gray-500 text-lg">Loading notes...</p></div>';
 
339
  const unsubscribeNotes = onSnapshot(notesQuery, (snapshot) => {
340
- notesListNotes.innerHTML = "";
341
  if (snapshot.empty) {
342
  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>';
343
  feather.replace();
344
  return;
345
  }
346
  snapshot.forEach((docSnap) => {
347
- renderNoteItem({ id: docSnap.id, ...docSnap.data() }, notesListNotes);
348
  });
349
  feather.replace();
350
  });
 
37
  <main class="flex-1 p-4 max-w-2xl w-full mx-auto">
38
  <!-- Tasks Section -->
39
  <div id="tasks-section" class="tab-content active">
40
+ <ul id="tasks-list" class="space-y-3"></ul>
41
  </div>
42
 
43
  <!-- Notes Section -->
44
  <div id="notes-section" class="tab-content hidden">
45
+ <ul id="notes-list" class="space-y-3"></ul>
46
  </div>
47
 
48
  <!-- Calendar Section -->
 
219
  const db = getFirestore(app);
220
 
221
  // DOM Elements
222
+ const tasksList = document.getElementById('tasks-list');
223
  const notesList = document.getElementById('notes-list');
 
224
  const noteInput = document.getElementById('note-input');
225
  const addNoteBtn = document.getElementById('add-note');
226
  const connectionStatus = document.getElementById('connection-status');
 
319
 
320
  // Live updates for tasks
321
  const tasksQuery = query(collection(db, "notes"), where("type", "==", "tasks"), orderBy("createdAt", "asc"));
322
+ const tasksList = document.getElementById('tasks-list');
323
+ tasksList.innerHTML = '<div class="text-center py-8"><div class="inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-blue-500"></div><p class="mt-2 text-gray-500 text-lg">Loading tasks...</p></div>';
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
  }
331
  snapshot.forEach((docSnap) => {
332
+ renderNoteItem({ id: docSnap.id, ...docSnap.data() }, tasksList);
333
  });
334
  feather.replace();
335
  });
336
 
337
  // Live updates for notes
338
  const notesQuery = query(collection(db, "notes"), where("type", "==", "notes"), orderBy("createdAt", "asc"));
339
+ const notesList = document.getElementById('notes-list');
340
+ notesList.innerHTML = '<div class="text-center py-8"><div class="inline-block animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-blue-500"></div><p class="mt-2 text-gray-500 text-lg">Loading notes...</p></div>';
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
  }
348
  snapshot.forEach((docSnap) => {
349
+ renderNoteItem({ id: docSnap.id, ...docSnap.data() }, notesList);
350
  });
351
  feather.replace();
352
  });
prompts.txt CHANGED
@@ -14,4 +14,5 @@ when I enter name once, remember it (so no need to add on that device again) (as
14
  lets this be tasks, add tab for notes, and one with calendar so we can note on calendar dates etc
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
 
 
14
  lets this be tasks, add tab for notes, and one with calendar so we can note on calendar dates etc
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