Skip to content

Commit b850cd4

Browse files
committed
Remove warnings from Live Report
- Remove isFieldMissing logic and warning badges entirely from the live report - Clean up warning-card and warning-badge CSS (including dark mode variants) - Remove unused --warning CSS variables - Live Report cards are now always clean/neutral
1 parent 9f40a17 commit b850cd4

2 files changed

Lines changed: 1 addition & 79 deletions

File tree

app.js

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -187,41 +187,15 @@ const getReportCardClass = (label) => {
187187
return `report-card ${label.toLowerCase().replace(/\s+/g, '-')}-card${wideClass}`;
188188
};
189189

190-
const isFieldMissing = (label, state) => {
191-
switch (label) {
192-
case 'Topic':
193-
return !state.topic || !state.topic.trim();
194-
case 'Type':
195-
return !state.type;
196-
case 'Presenter':
197-
return state.type !== 'Practical' && !state.presenter;
198-
case 'Senior Resident':
199-
return !state.seniorResident;
200-
case 'Moderator':
201-
return !state.moderator;
202-
case 'Resident Present':
203-
return !state.residentsPresent || state.residentsPresent.length === 0;
204-
default:
205-
return false;
206-
}
207-
};
208-
209190
const initializeReportDOM = () => {
210191
liveReport.innerHTML = `
211192
<div class="report-block">
212193
${getReportRows(state).map(([label, value]) => {
213-
const isMissing = isFieldMissing(label, state);
214-
const cardClass = getReportCardClass(label) + (isMissing ? ' warning-card' : '');
194+
const cardClass = getReportCardClass(label);
215195
return `
216196
<div id="card-${label.toLowerCase().replace(/\s+/g, '-')}" class="${cardClass}">
217197
<div class="report-card-header">
218198
<p class="report-label">${escapeHtml(label)}</p>
219-
<span class="warning-badge ${isMissing ? '' : 'hidden'}">
220-
<svg class="warning-icon" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
221-
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
222-
</svg>
223-
Missing
224-
</span>
225199
</div>
226200
<p class="report-value">${escapeHtml(value)}</p>
227201
</div>
@@ -252,13 +226,6 @@ const renderReport = () => {
252226
card.classList.add('flash');
253227
}
254228
}
255-
256-
const isMissing = isFieldMissing(label, state);
257-
card.classList.toggle('warning-card', isMissing);
258-
const badge = card.querySelector('.warning-badge');
259-
if (badge) {
260-
badge.classList.toggle('hidden', !isMissing);
261-
}
262229
}
263230
});
264231
};

styles.css

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
--border-strong: rgba(23, 64, 129, 0.3);
2323
--shadow: 0 16px 36px rgba(23, 64, 129, 0.1);
2424
--control-shadow: 0 10px 24px rgba(23, 64, 129, 0.08);
25-
--warning: #b45309;
26-
--warning-soft: rgba(217, 119, 6, 0.14);
2725
}
2826

2927
.dark {
@@ -50,8 +48,6 @@
5048
--border-strong: rgba(132, 151, 184, 0.5);
5149
--shadow: 0 12px 24px rgba(0,0,0,0.38);
5250
--control-shadow: 0 8px 18px rgba(0,0,0,0.34);
53-
--warning: #f59e0b;
54-
--warning-soft: rgba(245, 158, 11, 0.12);
5551
}
5652

5753
* {
@@ -719,47 +715,6 @@ select.form-input-m3 {
719715
gap: 0.5rem;
720716
}
721717

722-
.warning-badge {
723-
display: inline-flex;
724-
align-items: center;
725-
gap: 0.25rem;
726-
background-color: var(--warning-soft);
727-
color: var(--warning);
728-
border: 1px solid rgba(217, 119, 6, 0.24);
729-
padding: 0.15rem 0.45rem;
730-
border-radius: 0.5rem;
731-
font-size: 0.68rem;
732-
font-weight: 800;
733-
text-transform: uppercase;
734-
letter-spacing: 0.02em;
735-
line-height: 1;
736-
}
737-
738-
.dark .warning-badge {
739-
border-color: rgba(245, 158, 11, 0.24);
740-
}
741-
742-
.warning-icon {
743-
width: 0.85rem;
744-
height: 0.85rem;
745-
color: var(--warning);
746-
flex-shrink: 0;
747-
}
748-
749-
.report-card.warning-card {
750-
border-color: rgba(217, 119, 6, 0.35);
751-
box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.02),
752-
0 10px 24px -3px rgba(217, 119, 6, 0.03),
753-
0 0 0 1px rgba(217, 119, 6, 0.25);
754-
}
755-
756-
.dark .report-card.warning-card {
757-
border-color: rgba(245, 158, 11, 0.35);
758-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2),
759-
0 12px 28px -3px rgba(0, 0, 0, 0.35),
760-
0 0 0 1px rgba(245, 158, 11, 0.2);
761-
}
762-
763718
.report-label {
764719
margin: 0;
765720
color: var(--muted);

0 commit comments

Comments
 (0)