Checkpoint Odysseus local update

This commit is contained in:
pewdiepie-archdaemon
2026-07-07 00:50:07 +00:00
parent 5f6e6a2c4a
commit 017903de61
66 changed files with 22349 additions and 982 deletions
+20 -19
View File
@@ -5322,25 +5322,26 @@ async function _initReminders() {
// just opening the panel when the card isn't found (panel still
// loading, note in a different filter, etc.).
async function openNote(noteId) {
// If the panel is already open, openPanel() short-circuits and does
// nothing — including no re-fetch — so a freshly-created note added
// server-side never shows up. Force a refresh by closing first when
// open, then re-opening. Clicking the sidebar Notes button as a
// last resort keeps this working even if the module state got out
// of sync (rare but seen during HMR or after a stuck modal).
try {
if (isPanelOpen && isPanelOpen()) {
closePanel();
// give the close animation a frame to settle
await new Promise(r => setTimeout(r, 30));
}
} catch (_) {}
openPanel();
// openPanel() kicks off _fetchNotes() asynchronously, so the cards
// for newly-created notes may not be in the DOM yet. Also poll the
// _notes module array directly — if the note IS loaded but the
// active filter (e.g. archive view) is hiding it, we can still
// surface a confirmation toast.
const wasOpen = !!(isPanelOpen && isPanelOpen());
_showingArchived = false;
_activeLabel = null;
_activeFilter = null;
_searchQuery = '';
if (!wasOpen) {
openPanel();
} else {
_bringNotesToFront();
const searchEl = document.getElementById('notes-search');
if (searchEl) searchEl.value = '';
const pane = document.getElementById('notes-pane');
if (pane) pane.classList.remove('notes-pane-archive');
const archiveBtn = document.getElementById('notes-archive-toggle');
if (archiveBtn) archiveBtn.classList.remove('active');
await _fetchNotes();
_renderNotes();
}
// openPanel() kicks off _fetchNotes() asynchronously, so the cards for
// newly-created notes may not be in the DOM yet. Poll until the card exists.
if (!noteId) return;
let tries = 0;
const findAndFlash = () => {