sanity-plugin-seo-copilot 0.2.12 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,13 +60,23 @@ function scoreColors(score: number): { bg: string; text: string; label: string }
60
60
  return { bg: "rgba(220,38,38,0.08)", text: "#dc2626", label: "Needs work" };
61
61
  }
62
62
 
63
- // The score card. The breakdown is ALWAYS visible - the score is just a roll-up
64
- // of the six visible components below it. No hidden state, no "click to see why".
63
+ // Qualitative tier for a single score component. We deliberately show a word + color,
64
+ // not "points / max" - the underlying numbers are coarse heuristics, and a precise-looking
65
+ // "17 / 25" implies an accuracy the rubric doesn't actually have.
66
+ function componentTier(pct: number): { label: string; color: string; bar: string } {
67
+ if (pct >= 75) return { label: "Strong", color: "#16a34a", bar: "#16a34a" };
68
+ if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
69
+ return { label: "Low", color: "#dc2626", bar: "#dc2626" };
70
+ }
71
+
72
+ // The score card. The breakdown is ALWAYS visible - the overall tier is just a roll-up
73
+ // of the components below it. No raw numbers: each row reads as a colored "vibe" (Strong /
74
+ // OK / Low) so editors focus on what's weak, not on chasing an arbitrary point total.
65
75
  function ScoreBadge({ score, breakdown }: { score: number; breakdown: ContentScore["components"] }) {
66
76
  const c = scoreColors(score);
67
77
  return (
68
78
  <div style={cardStyle}>
69
- {/* Top row: number + label */}
79
+ {/* Top row: qualitative tier + label (no number) */}
70
80
  <div style={{ display: "flex", alignItems: "center", gap: 14 }}>
71
81
  <div
72
82
  style={{
@@ -75,42 +85,38 @@ function ScoreBadge({ score, breakdown }: { score: number; breakdown: ContentSco
75
85
  borderRadius: "50%",
76
86
  background: c.bg,
77
87
  display: "flex",
78
- flexDirection: "column",
79
88
  alignItems: "center",
80
89
  justifyContent: "center",
81
90
  flexShrink: 0,
82
- lineHeight: 1,
83
91
  }}
84
92
  >
85
- <span style={{ fontSize: 20, fontWeight: 700, color: c.text }}>{score}</span>
86
- <span style={{ fontSize: 8, fontWeight: 700, color: c.text, opacity: 0.7, letterSpacing: "0.06em", marginTop: 2 }}>
87
- / 100
88
- </span>
93
+ {/* Solid status disc - a color cue, not a number */}
94
+ <div style={{ width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 }} />
89
95
  </div>
90
96
  <div style={{ flex: 1, minWidth: 0 }}>
91
97
  <div style={{ fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }}>
92
98
  Content Score
93
99
  </div>
94
- <div style={{ fontSize: 14, fontWeight: 700, color: c.text }}>{c.label}</div>
100
+ <div style={{ fontSize: 16, fontWeight: 700, color: c.text }}>{c.label}</div>
95
101
  </div>
96
102
  </div>
97
103
 
98
- {/* Always-visible breakdown - each row shows what's driving the score */}
104
+ {/* Always-visible breakdown - each row shows what's driving the score, as a vibe */}
99
105
  {breakdown.length > 0 && (
100
106
  <div style={{ marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }}>
101
107
  {breakdown.map((comp, i) => {
102
108
  const pct = comp.max > 0 ? (comp.points / comp.max) * 100 : 0;
103
- const barColor = pct >= 75 ? "#16a34a" : pct >= 40 ? "#E6C01B" : "#dc2626";
109
+ const tier = componentTier(pct);
104
110
  return (
105
111
  <div key={i}>
106
112
  <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }}>
107
113
  <span style={{ fontSize: 11, fontWeight: 600, color: "#1f2937" }}>{comp.label}</span>
108
- <span style={{ fontSize: 11, color: "#4b5563", fontVariantNumeric: "tabular-nums" }}>
109
- {comp.points} / {comp.max}
114
+ <span style={{ fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }}>
115
+ {tier.label}
110
116
  </span>
111
117
  </div>
112
118
  <div style={{ height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }}>
113
- <div style={{ width: `${pct}%`, height: "100%", background: barColor, transition: "width 200ms" }} />
119
+ <div style={{ width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" }} />
114
120
  </div>
115
121
  <div style={{ fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }}>{comp.detail}</div>
116
122
  </div>