✓ 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 = '