this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fixes

alice 3b9f7b3d 183533d2

+76 -29
+46 -27
index.ts
··· 138 138 this.updateState(newState); // Call updateState directly 139 139 }); 140 140 document.getElementById("backToPart1")?.addEventListener("click", () => { 141 - const newState = this.undoManager.getState(); 142 - newState.currentPart = "part1"; 143 - // Restore Part1: move cards back to their original positions 144 - // This logic seems potentially flawed - if a card started in 'important' but moved to 'unassigned' in part 2, 145 - // this moves it to 'veryImportant'. Revisiting Part 1 might require storing original Part 1 state. 146 - // For now, keeping the existing logic. 147 - newState.cards.forEach((c) => { 148 - if (c.column === "unassigned") { 149 - c.column = "veryImportant"; 150 - } 151 - }); 152 - this.updateState(newState); // Call updateState directly 141 + // Simply undo the last state change 142 + const prevState = this.undoManager.undo(); 143 + if (prevState) { 144 + this.state = prevState; 145 + this.saveState(); 146 + this.render(); 147 + this.updateUndoRedoButtons(); 148 + } 153 149 }); 154 150 document.getElementById("toPart3")?.addEventListener("click", () => { 155 151 const newState = this.undoManager.getState(); ··· 173 169 this.updateState(newState); // Call updateState directly 174 170 }); 175 171 document.getElementById("backToPart2")?.addEventListener("click", () => { 176 - const newState = this.undoManager.getState(); 177 - newState.currentPart = "part2"; 178 - // Restore Part2: move cards back to their original positions 179 - newState.cards.forEach((c) => { 180 - // This assumes cards in Part 3 only came from 'veryImportant' in Part 2 181 - if (c.column === "core" || c.column === "additional") { 182 - c.column = "veryImportant"; 183 - } 184 - }); 185 - this.updateState(newState); // Call updateState directly 172 + // Simply undo the last state change 173 + const prevState = this.undoManager.undo(); 174 + if (prevState) { 175 + this.state = prevState; 176 + this.saveState(); 177 + this.render(); 178 + this.updateUndoRedoButtons(); 179 + } 186 180 }); 187 181 document.getElementById("toPart4")?.addEventListener("click", () => { 188 182 const newState = this.undoManager.getState(); ··· 195 189 this.updateState(newState); // Call updateState directly 196 190 }); 197 191 document.getElementById("backToPart3")?.addEventListener("click", () => { 198 - const newState = this.undoManager.getState(); 199 - newState.currentPart = "part3"; 200 - this.updateState(newState); // Call updateState directly 192 + // Simply undo the last state change 193 + const prevState = this.undoManager.undo(); 194 + if (prevState) { 195 + this.state = prevState; 196 + this.saveState(); 197 + this.render(); 198 + this.updateUndoRedoButtons(); 199 + } 201 200 }); 202 201 document.getElementById("finish")?.addEventListener("click", () => { 203 202 const newState = this.undoManager.getState(); 203 + // Check if all core values have statements 204 + const coreCards = newState.cards.filter(c => c.column === 'core'); 205 + const missingStatements = coreCards.filter(card => !newState.finalStatements[card.id]?.trim()); 206 + 207 + if (missingStatements.length > 0) { 208 + alert(`Please provide a statement for all core values. Missing: ${missingStatements.map(c => c.name).join(', ')}`); 209 + return; // Prevent transition 210 + } 211 + 212 + // Original transition logic 204 213 newState.currentPart = "review"; 205 214 this.updateState(newState); // Call updateState directly 206 215 }); ··· 492 501 493 502 const values = this.state.cards 494 503 .filter(c => c.column === category.column) 495 - .map(c => c.name); 504 + .map(c => c.name); // Keep getting just the names for this list 496 505 497 506 if (values.length > 0) { 498 507 const list = document.createElement("ul"); 499 508 values.forEach(value => { 500 509 const li = document.createElement("li"); 501 - li.textContent = value; 510 + // Create spans for name and description 511 + const nameSpan = document.createElement('span'); 512 + nameSpan.className = 'review-value-name'; 513 + nameSpan.textContent = value; 514 + 515 + const descSpan = document.createElement('span'); 516 + descSpan.className = 'review-value-description'; 517 + descSpan.textContent = valueDefinitionsMap.get(value) || "(Description not found)"; 518 + 519 + li.appendChild(nameSpan); 520 + li.appendChild(descSpan); 502 521 list.appendChild(li); 503 522 }); 504 523 section.appendChild(list);
+1 -1
package.json
··· 19 19 "dev": "parcel ./index.html", 20 20 "build": "parcel build ./index.html", 21 21 "test": "bun test", 22 - "deploy": "bun run build && bunx wrangler pages deploy dist" 22 + "deploy": "bun test && bun run build && bunx wrangler pages deploy dist" 23 23 } 24 24 }
+29 -1
styles.css
··· 108 108 } 109 109 110 110 .grid-section li { 111 - padding: 0.5em 0; 112 111 border-bottom: 1px solid #eee; 112 + padding: 0.75em 0; 113 113 } 114 114 115 115 .grid-section li:last-child { 116 116 border-bottom: none; 117 + } 118 + 119 + /* Styles for Review Page Lists */ 120 + #reviewContent .grid-section ul li { 121 + margin-bottom: 0; 122 + } 123 + 124 + .review-value-name { 125 + font-weight: bold; 126 + display: block; 127 + } 128 + 129 + .review-value-description { 130 + font-size: 0.9em; 131 + color: #444; 132 + display: block; 133 + margin-left: 0; 134 + margin-top: 2px; 135 + } 136 + 137 + /* Styles for the separate Core Values & Statements list */ 138 + #reviewContent > ul { 139 + list-style: disc; 140 + margin-left: 20px; 141 + } 142 + 143 + #reviewContent > ul li { 144 + margin-bottom: 5px; 117 145 } 118 146