fix: address code-review findings from pass 1 + 2 (#8)
- Fix saveCourseToDB returning 0 on conflict by falling back to SELECT
- Fix inactive layouts showing 'Never played' when last_played exists
- Add .icon-btn.spinning to courses.css for refresh button feedback
- Remove duplicate .btn-primary from courses.css (use shared.css version)
- Tokenize rating tier colors into --rating-tier-{high,mid,low} CSS vars
- Convert var to const/let throughout courses.js
- Fix logger.error calls to use {err} object form (pino convention)
- Extract RATING_TIER_HIGH/MID constants in course-layouts.ejs scriptlet
- Remove dead href='#' View all link from courses.ejs (deferred)
- Pass total prop explicitly from course-table.ejs to course-cards.ejs
- Remove dead #search-results-info selector from mobile.css
- Remove redundant .replace(/"/g, '"') from data attributes in course-table.ejs
This commit is contained in:
+13
-26
@@ -78,26 +78,7 @@
|
||||
|
||||
/* ── Buttons ──────────────────────────────────────── */
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
border: 0;
|
||||
height: 40px;
|
||||
padding: 0 16px;
|
||||
border-radius: var(--radius-sm);
|
||||
font: 600 14px/1 var(--font-sans);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
filter: brightness(1.05);
|
||||
}
|
||||
|
||||
.btn-primary:disabled {
|
||||
opacity: .6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
/* .btn-primary is defined in shared.css — no override needed here */
|
||||
|
||||
.btn-pill {
|
||||
padding: 6px 12px;
|
||||
@@ -332,18 +313,18 @@
|
||||
}
|
||||
|
||||
.chip-rating--green {
|
||||
color: oklch(0.55 0.15 150);
|
||||
background: color-mix(in oklch, oklch(0.55 0.15 150) 10%, transparent);
|
||||
color: var(--rating-tier-high);
|
||||
background: color-mix(in oklch, var(--rating-tier-high) 10%, transparent);
|
||||
}
|
||||
|
||||
.chip-rating--amber {
|
||||
color: oklch(0.55 0.12 100);
|
||||
background: color-mix(in oklch, oklch(0.55 0.12 100) 10%, transparent);
|
||||
color: var(--rating-tier-mid);
|
||||
background: color-mix(in oklch, var(--rating-tier-mid) 10%, transparent);
|
||||
}
|
||||
|
||||
.chip-rating--orange {
|
||||
color: oklch(0.55 0.10 50);
|
||||
background: color-mix(in oklch, oklch(0.55 0.10 50) 10%, transparent);
|
||||
color: var(--rating-tier-low);
|
||||
background: color-mix(in oklch, var(--rating-tier-low) 10%, transparent);
|
||||
}
|
||||
|
||||
/* ── Inactive layouts collapsible ────────────────── */
|
||||
@@ -386,6 +367,12 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ── Icon button spin state (keyframes defined in shared.css) ─── */
|
||||
|
||||
.icon-btn.spinning {
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
/* ── Tjing results ───────────────────────────────── */
|
||||
|
||||
#tjing-results {
|
||||
|
||||
@@ -64,9 +64,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hide search result info text on courses (mobile has section-head) */
|
||||
#search-results-info { display: none; }
|
||||
|
||||
/* ── Container ──────────────────────────────────── */
|
||||
|
||||
.container {
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
--font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
|
||||
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
||||
|
||||
/* ── Rating tier tokens ───────────────────────── */
|
||||
--rating-tier-high: oklch(0.55 0.15 150);
|
||||
--rating-tier-mid: oklch(0.55 0.12 100);
|
||||
--rating-tier-low: oklch(0.55 0.10 50);
|
||||
|
||||
/* legacy token aliases — remove as components migrate */
|
||||
--surface-0: var(--bg);
|
||||
--surface-1: var(--paper);
|
||||
|
||||
Reference in New Issue
Block a user