feat(offline): open entry details from the saved snapshot

Opening an entry while offline needed a request that could not be made. Read it
from the snapshot claimed by the signed-in account instead, re-checking
ownership after the read so a sign-in mid-read cannot surface another account's
data, and let controls marked data-offline-action stay usable in read-only mode.
This commit is contained in:
Josh Creek
2026-09-15 17:48:57 +01:00
parent 56b676b04a
commit 03b74089a0
3 changed files with 87 additions and 4 deletions
+5 -4
View File
@@ -52,6 +52,7 @@
if (navigator.onLine) return;
const target = event.target instanceof Element ? event.target : null;
if (!target?.closest('button, input, textarea, select, form')) return;
if (target.closest('[data-offline-action]')) return;
event.preventDefault();
event.stopImmediatePropagation();
};
@@ -313,10 +314,10 @@
</div>
<style>
:global(.offline-readonly button),
:global(.offline-readonly input),
:global(.offline-readonly textarea),
:global(.offline-readonly select) {
:global(.offline-readonly button:not([data-offline-action])),
:global(.offline-readonly input:not([data-offline-action])),
:global(.offline-readonly textarea:not([data-offline-action])),
:global(.offline-readonly select:not([data-offline-action])) {
pointer-events: none;
opacity: 0.65;
}