From a6efa52f782f22d5c1655f0b5044dd7117e11830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Thu, 17 Sep 2026 13:17:37 +0200 Subject: [PATCH] v0.2.77 --- Cargo.lock | 2 +- Cargo.toml | 2 +- lang/en.json | 2 -- lang/pl.json | 2 -- static/js/note-editor.js | 15 +-------------- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b94da93..e81db57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2581,7 +2581,7 @@ dependencies = [ [[package]] name = "rustpad" -version = "0.2.76" +version = "0.2.77" dependencies = [ "argon2", "aws-config", diff --git a/Cargo.toml b/Cargo.toml index 9bc6a31..a314b35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustpad" -version = "0.2.76" +version = "0.2.77" edition = "2024" rust-version = "1.94" description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL" diff --git a/lang/en.json b/lang/en.json index f27ccae..7581e61 100644 --- a/lang/en.json +++ b/lang/en.json @@ -346,8 +346,6 @@ "editor.connectionError": "Editor connection error", "editor.connectionInterrupted": "Connection interrupted", "editor.connectionPersistent": "The live connection is still unavailable. Automatic reconnect continues.", - "editor.interfaceError": "Interface error", - "editor.interfaceError.message": "An interface error occurred. Connection status is monitored separately.", "editor.copyOpen": "Copy its link and open it in a new tab", "editor.copyThisLink": "Copy this link", "editor.currentLocation": "Current location", diff --git a/lang/pl.json b/lang/pl.json index 94e190b..70d63ac 100644 --- a/lang/pl.json +++ b/lang/pl.json @@ -346,8 +346,6 @@ "editor.connectionError": "Błąd połączenia edytora", "editor.connectionInterrupted": "Połączenie przerwane", "editor.connectionPersistent": "Połączenie na żywo nadal jest niedostępne. Automatyczne ponowne łączenie trwa.", - "editor.interfaceError": "Błąd interfejsu", - "editor.interfaceError.message": "Wystąpił błąd interfejsu. Stan połączenia jest monitorowany niezależnie.", "editor.copyOpen": "Skopiuj link i otwórz go w nowej karcie", "editor.copyThisLink": "Kopiuj ten link", "editor.currentLocation": "Bieżąca lokalizacja", diff --git a/static/js/note-editor.js b/static/js/note-editor.js index 04de709..1266d4b 100644 --- a/static/js/note-editor.js +++ b/static/js/note-editor.js @@ -52,7 +52,7 @@ export function startNoteEditor(adapter) { : `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}`; const collaboration = new CollaborationSession(collaborationClientId); let accessToken = shareToken || getAccessToken(adapter.access.kind, adapter.access.key), password = "", nickname = getNickname(), info, socket, saveTimer, applyingRemote = false, applyingHistory = false, resourceUnlocked = false, uiState = readEditorState(), authorship = parseAuthorship("", "[]"), previousContent = "", globalColor = "", noteColor = "", presenceUsers = [], authorshipMode = "simple", authorshipColorsEnabled = true, lastRevealedLineHash = "", flushRequested = false, accountSession = null; - let editorSettingsSaveTimer, editorSettingsSaveInFlight = false, pendingPersonalSettingsSave = false, pendingAuthorshipSettingsSave = false, connectionNoticeTimer = 0, connectionWasInterrupted = false, frontendErrorToastAt = 0; + let editorSettingsSaveTimer, editorSettingsSaveInFlight = false, pendingPersonalSettingsSave = false, pendingAuthorshipSettingsSave = false, connectionNoticeTimer = 0, connectionWasInterrupted = false; let pendingPreviewViewport = null; const editHistory = { entries: [], @@ -420,17 +420,6 @@ export function startNoteEditor(adapter) { } setStatus("connecting", t("status.connecting", {}, "Connecting...")); } - function notifyFrontendError() { - const now = Date.now(); - if (now - frontendErrorToastAt < 30000) return; - frontendErrorToastAt = now; - try { - toast.warning( - t("editor.interfaceError.message", {}, "An interface error occurred. Connection status is monitored separately."), - { title: t("editor.interfaceError", {}, "Interface error"), duration: 6500 }, - ); - } catch { } - } function updateAddressLabel() { document.querySelector(adapter.addressSelector).textContent = `${location.pathname}${location.search}`; } let mermaidRenderVersion = 0; async function renderMermaid() { @@ -2372,7 +2361,5 @@ export function startNoteEditor(adapter) { const historyPanel = document.querySelector("#history-panel"); document.querySelector("#history-button").addEventListener("click", async () => { if (info?.protected && !resourceUnlocked) { if (!passwordDialog.open) passwordDialog.showModal(); document.querySelector("#open-password")?.focus(); return; } historyPanel.classList.add("open"); historyPanel.setAttribute("aria-hidden", "false"); document.body.classList.add("history-open"); const list = document.querySelector("#history-list"); list.innerHTML = '

Loading…

'; try { const revisions = await adapter.loadHistory(accessToken); list.innerHTML = revisions.length ? revisions.map((r, i) => { const snippet = escapeHtml(r.content.trim().split("\n").slice(0, 3).join(" · ").slice(0, 150) || "Empty note"); const author = r.author || "Unknown author"; return `
${escapeHtml(author)}

${snippet}

`; }).join("") : '

No history yet.

'; for (const r of revisions) { list.querySelector(`[data-preview="${r.id}"]`)?.addEventListener("click", () => { const el = list.querySelector(`#preview-${r.id}`); el.hidden = !el.hidden; el.textContent = r.content; }); list.querySelector(`[data-revision="${r.id}"]`)?.addEventListener("click", async () => { await adapter.restoreRevision(r.id, accessToken); toast.success("The selected revision is now the current version.", { title: "Version restored" }); }); } } catch (e) { list.innerHTML = `

${escapeHtml(e.message)}

`; toast.danger(e.message, { title: "Could not load version history" }); } }); document.querySelector("#close-history").addEventListener("click", () => { historyPanel.classList.remove("open"); historyPanel.setAttribute("aria-hidden", "true"); document.body.classList.remove("history-open"); }); const deleteNoteButton = document.querySelector("#delete-note"); if (deleteNoteButton && adapter.deleteNote) deleteNoteButton.addEventListener("click", async () => { try { await adapter.deleteNote(info, accessToken); } catch (error) { toast.danger(error.message, { title: "Could not delete note" }); } }); - window.addEventListener("error", () => notifyFrontendError()); - window.addEventListener("unhandledrejection", () => notifyFrontendError()); initialize(); }