From e51024466b937c372c8ce18a88301a7ebfa69f6e Mon Sep 17 00:00:00 2001
From: C-West8 <125926137+C-West8@users.noreply.github.com>
Date: Tue, 30 Jun 2026 16:35:39 -0500
Subject: [PATCH] first pass at storing data in DB instead of client only
---
html/index.html | 31 +++++++---
html/project-data.js | 101 +++++++++++++++++++++++++++++++++
html/work-package-suite-app.js | 30 +++++++---
html/wp-creation-app.js | 47 +++++++++------
server/app.py | 11 +++-
5 files changed, 187 insertions(+), 33 deletions(-)
diff --git a/html/index.html b/html/index.html
index 5dcc5c7..51fefd6 100644
--- a/html/index.html
+++ b/html/index.html
@@ -595,7 +595,10 @@
if(info) info.innerHTML = `
✓ Active project: ${esc(active.name||'')}${active.number?' ('+esc(active.number)+')':''}
`;
- reflectSOPStatus(active);
+ // Pull the project's shared SOP from the server into the local cache first,
+ // so the SOP "Complete / Review" status reflects what other users have done.
+ if(ProjectData.pullProject){ ProjectData.pullProject(active.id).then(()=>reflectSOPStatus(active)).catch(()=>reflectSOPStatus(active)); }
+ else reflectSOPStatus(active);
}
function clearActiveProject(){ ProjectData.setActive(null); renderProjectPicker(); applyActiveProject(); }
@@ -704,22 +707,36 @@
r.readAsText(f);
}
- function loadComments() {
- const saved = localStorage.getItem('wp_suite_index_comments');
- if (saved) allComments = JSON.parse(saved);
-
+ function renderComments() {
const list = document.getElementById('comments-list');
if (allComments.length === 0) {
list.innerHTML = '