Add file preloading, branded file icons, instant card clicks, and live reload dev mode

This commit is contained in:
2025-12-22 22:06:51 +00:00
parent 94e5079a60
commit 611bccbc51
3 changed files with 24 additions and 1 deletions
+1
View File
@@ -219,6 +219,7 @@ app.onError((err, c) => {
return c.text('Internal Server Error', 500);
});
// Default to 3003; can be overridden by Environment=PORT
const PORT = Number(process.env.PORT || 3003);
logLine('logs/server.log', `Starting frontend server on port ${PORT}`);
+22
View File
@@ -10,6 +10,28 @@
</script><script src="https://cdn.jsdelivr.net/npm/pocketbase@0.26.5/dist/pocketbase.umd.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
<script src="auth.js"></script>
<script>
// Live reload for development
(function() {
let lastCheck = Date.now();
setInterval(async () => {
try {
const res = await fetch('/version?t=' + Date.now(), { cache: 'no-store' });
if (res.ok) {
const data = await res.json();
const currentVersion = sessionStorage.getItem('appVersion');
if (currentVersion && data.version && currentVersion !== data.version) {
console.log('Changes detected, reloading...');
window.location.reload();
}
sessionStorage.setItem('appVersion', data.version || '');
}
} catch (e) {
console.log('Live reload check failed:', e);
}
}, 1000);
})();
</script>
</head>
<body class="font-sans bg-gray-100 m-0 text-gray-900 overflow-hidden touch-pan-y h-screen flex flex-col">
<div class="max-w-full md:max-w-2xl mx-auto p-4 sm:p-3 text-[17px] flex flex-col flex-1 overflow-hidden">
+1 -1
View File
@@ -4,7 +4,7 @@
"type": "module",
"private": true,
"scripts": {
"dev": "bun run backend/server.ts",
"dev": "bun --watch backend/server.ts",
"start": "bun run backend/server.ts",
"build:css": "tailwindcss -i input.css -o frontend/output.css --watch"
},