diff --git a/enhancements/forge-sandbox-status.js b/enhancements/forge-sandbox-status.js deleted file mode 100644 index 52a6c59..0000000 --- a/enhancements/forge-sandbox-status.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Ended sandboxes in the Forge list read as a grey "Terminated" instead of a green "Completed". - * - * Targets data- attributes only: Forge's class names are build-hashed and change between - * releases. The grey reuses the pill's own colour variables with Forge's neutral values, so - * the proposed state looks native; fallbacks cover a page where those variables are missing. - * - * The overrides are !important because Forge raises its colour rules' specificity by - * repeating the class (`._green_x._green_x._green_x`), which outranks any plain selector here. - * They only exist while the enhancement is on, so the shipped page is untouched when off. - */ - -import { createRelabel } from "../src/lib/relabel.js"; - -const CLASS = "presenter-sandbox-ended"; - -// A ring with a short horizontal dash, like the European no-entry sign — calmer than a -// diagonal bar, and read as "ended" rather than "error". Drawn as a mask so it takes -// the pill's text colour, at the same 24-unit grid and size as the checkmark it replaces. -const ENDED_ICON = encodeURIComponent( - '' + - '' + - '' + - "", -); - -const relabel = createRelabel({ - selector: 'td[data-key$=":status"] [data-component="Pill"]', - from: "Completed", - to: "Terminated", - className: CLASS, -}); - -export const forgeSandboxStatus = { - id: "forge-sandbox-status", - title: "Ended sandboxes read as grey Terminated", - problem: - "An ended sandbox shows a green Completed, which reads as healthy or running; it cannot be started again, so Terminated in neutral grey says what it is.", - matches: ["https://forge.coreweave.com/sandboxes/*"], - css: ` -[data-component="Pill"].${CLASS} { - --tag-text-color: var(--secondary-text, #5f6368) !important; - --tag-background-color: light-dark(var(--moon-200, #e8eaed), var(--moon-800, #3c4043)) !important; -} -[data-component="Pill"].${CLASS} [data-icon] { - --icon-color: var(--secondary-text, #5f6368) !important; - position: relative; -} -[data-component="Pill"].${CLASS} [data-icon] svg { - visibility: hidden; -} -[data-component="Pill"].${CLASS} [data-icon]::before { - content: ""; - position: absolute; - inset: 0; - background-color: var(--icon-color); - -webkit-mask: url("data:image/svg+xml,${ENDED_ICON}") center / contain no-repeat; - mask: url("data:image/svg+xml,${ENDED_ICON}") center / contain no-repeat; -} -`, - apply: relabel.apply, - revert: relabel.revert, -}; diff --git a/enhancements/index.js b/enhancements/index.js index 8195d49..53bd9ef 100644 --- a/enhancements/index.js +++ b/enhancements/index.js @@ -15,6 +15,4 @@ * Add the new file's export to the list below. */ -import { forgeSandboxStatus } from "./forge-sandbox-status.js"; - -export const ENHANCEMENTS = [forgeSandboxStatus]; +export const ENHANCEMENTS = []; diff --git a/manifest.json b/manifest.json index 21c1a6d..fc1010d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "presenter", - "version": "1.2.2", + "version": "1.2.3", "description": "Pointer and fading highlights for live demos, plus toggleable UX enhancements for before/after clips.", "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzSA8AU/9KdGceK/m1e9ke5Gi7B4HObymgejDydm3gAlJXrqcAys1TV5HsphZF/XG4ZNew/Ui2EzRGpJ3ryN9vP90EklOAgHIT4QLSL8zwTarwubELnoLHhqDFtxX/xe8fBb7zQsbXcZbcPHHlj0Fm2qkZgWHjrR1M+6/YzrxkFWOl0tgPibihEarn33hCCBvej/8AXDjF0JEV+farFxSc1f7jVNAgSe7O976GKlrXY6mYurJnXGv6G4EhPG1VGrsrVY/HcKHR3dotAcgp4qPIMHSNOfScxc75UWUKJarqCXKlX5NL9H3Vb84MmMwpOvo01SpDJZc/ZQRrxPOtMCRzQIDAQAB", "permissions": [ diff --git a/test/fixtures/forge-sandbox-list.html b/test/fixtures/forge-sandbox-list.html deleted file mode 100644 index de39031..0000000 --- a/test/fixtures/forge-sandbox-list.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - -
00000000-0000-0000-0000-000000000000Completed
00000000-0000-0000-0000-000000000001Running
Completed
diff --git a/test/forge-sandbox-status.test.js b/test/forge-sandbox-status.test.js deleted file mode 100644 index a6e92e6..0000000 --- a/test/forge-sandbox-status.test.js +++ /dev/null @@ -1,57 +0,0 @@ -// @vitest-environment jsdom -import { readFileSync } from "node:fs"; -import { join } from "node:path"; -import { beforeEach, describe, expect, it } from "vitest"; -import { createEnhancer } from "../src/content/enhancer.js"; -import { forgeSandboxStatus } from "../enhancements/forge-sandbox-status.js"; -import { urlMatches } from "../src/lib/match.js"; - -const fixture = readFileSync(join(import.meta.dirname, "fixtures", "forge-sandbox-list.html"), "utf8"); -const statusPills = () => [...document.querySelectorAll('td[data-key$=":status"] [data-component="Pill"]')]; - -describe("forge-sandbox-status", () => { - let original; - - beforeEach(() => { - document.head.innerHTML = ""; - document.body.innerHTML = fixture; - original = document.documentElement.outerHTML; - }); - - it("targets the sandboxes pages only", () => { - expect(urlMatches("https://forge.coreweave.com/sandboxes/example-sandboxes", forgeSandboxStatus.matches)).toBe(true); - expect(urlMatches("https://forge.coreweave.com/notebooks", forgeSandboxStatus.matches)).toBe(false); - }); - - it("relabels a Completed status pill and keeps its icon", () => { - const [ended] = statusPills(); - const icon = ended.querySelector("[data-icon]"); - forgeSandboxStatus.apply(document); - expect(ended.textContent.trim()).toBe("Terminated"); - expect(ended.classList.contains("presenter-sandbox-ended")).toBe(true); - expect(ended.querySelector("[data-icon]")).toBe(icon); - }); - - it("leaves other statuses and Completed pills outside the status column alone", () => { - forgeSandboxStatus.apply(document); - const [, running] = statusPills(); - expect(running.textContent.trim()).toBe("Running"); - expect(document.querySelector('[data-key$=":displayName"] [data-component="Pill"]').textContent).toBe("Completed"); - }); - - it("restores the shipped page exactly when switched off", () => { - const enhancer = createEnhancer(document); - enhancer.sync([forgeSandboxStatus]); - expect(document.documentElement.outerHTML).not.toBe(original); - enhancer.sync([]); - expect(document.documentElement.outerHTML).toBe(original); - }); - - it("is idempotent across repeated syncs", () => { - const enhancer = createEnhancer(document); - enhancer.sync([forgeSandboxStatus]); - const once = document.documentElement.outerHTML; - enhancer.sync([forgeSandboxStatus]); - expect(document.documentElement.outerHTML).toBe(once); - }); -});