pi-mega-compact 0.8.3 โ†’ 0.8.4

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.
@@ -932,7 +932,7 @@ export function dashboardHtml(tierName) {
932
932
  if (best != null && best > 100) {
933
933
  tile.style.display = 'block';
934
934
  tile.className = 'achievement-tile unlocked';
935
- tile.innerHTML = '๐Ÿ† Opie\'s Wild Ride<span class="ach-detail">best ' + sanitize(fmtPct(best)) + ' ยท first ' + sanitize(fmtDate(firstSeen)) + '</span>';
935
+ tile.innerHTML = '๐Ÿ† Opie\\'s Wild Ride<span class="ach-detail">best ' + sanitize(fmtPct(best)) + ' ยท first ' + sanitize(fmtDate(firstSeen)) + '</span>';
936
936
  } else { tile.style.display = 'none'; tile.className = 'achievement-tile'; }
937
937
  }
938
938
  // transient oopsie toast: a NEW mega_cache trophy row since the last poll
@@ -39,3 +39,14 @@ describe("S35 dashboard HTML achievements", () => {
39
39
  assert.ok(html.includes("??? "), "??? teaser present");
40
40
  });
41
41
  });
42
+ describe("S35 dashboard HTML achievements escaping (v0.8.4 fix)", () => {
43
+ const html = dashboardHtml("custom");
44
+ test("Opie's Wild Ride JS string is backslash-escaped (no bare apostrophe)", () => {
45
+ // The served <script> uses single-quoted JS strings: '๐Ÿ† Opie\'s Wild Ride...'.
46
+ // A bare apostrophe (Opie's) would terminate the string and halt the script,
47
+ // breaking .tab click bindings. The served HTML MUST contain the escaped
48
+ // form Opie\'s and MUST NOT contain the bare form '๐Ÿ† Opie's'.
49
+ assert.ok(html.includes("๐Ÿ† Opie\\'s Wild Ride"), "served JS contains Opie\\'s (escaped)");
50
+ assert.ok(!html.includes("๐Ÿ† Opie's Wild Ride"), "no bare Opie's in served JS");
51
+ });
52
+ });
@@ -48,3 +48,15 @@ describe("S35 dashboard HTML achievements", () => {
48
48
  assert.ok(html.includes("??? "), "??? teaser present");
49
49
  });
50
50
  });
51
+
52
+ describe("S35 dashboard HTML achievements escaping (v0.8.4 fix)", () => {
53
+ const html = dashboardHtml("custom");
54
+ test("Opie's Wild Ride JS string is backslash-escaped (no bare apostrophe)", () => {
55
+ // The served <script> uses single-quoted JS strings: '๐Ÿ† Opie\'s Wild Ride...'.
56
+ // A bare apostrophe (Opie's) would terminate the string and halt the script,
57
+ // breaking .tab click bindings. The served HTML MUST contain the escaped
58
+ // form Opie\'s and MUST NOT contain the bare form '๐Ÿ† Opie's'.
59
+ assert.ok(html.includes("๐Ÿ† Opie\\'s Wild Ride"), "served JS contains Opie\\'s (escaped)");
60
+ assert.ok(!html.includes("๐Ÿ† Opie's Wild Ride"), "no bare Opie's in served JS");
61
+ });
62
+ });
@@ -935,7 +935,7 @@ export function dashboardHtml(tierName: string): string {
935
935
  if (best != null && best > 100) {
936
936
  tile.style.display = 'block';
937
937
  tile.className = 'achievement-tile unlocked';
938
- tile.innerHTML = '๐Ÿ† Opie\'s Wild Ride<span class="ach-detail">best ' + sanitize(fmtPct(best)) + ' ยท first ' + sanitize(fmtDate(firstSeen)) + '</span>';
938
+ tile.innerHTML = '๐Ÿ† Opie\\'s Wild Ride<span class="ach-detail">best ' + sanitize(fmtPct(best)) + ' ยท first ' + sanitize(fmtDate(firstSeen)) + '</span>';
939
939
  } else { tile.style.display = 'none'; tile.className = 'achievement-tile'; }
940
940
  }
941
941
  // transient oopsie toast: a NEW mega_cache trophy row since the last poll
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mega-compact",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Layered, local, vector-backed context compressor for pi โ€” supersede/collapse/cluster compaction with deduped inline recall.",
5
5
  "type": "module",
6
6
  "license": "BSD-2-Clause",