feat(meta): colourise the plugin artwork and say what it actually is

Two things the Plugins list made obvious once the icon rendered beside the
built-ins.

The artwork was flat: one blue panel, one darker blue rail. The built-ins
each carry their own two-hue palette — the file header says so outright
("these glyphs carry their own brand colors and gradients instead of riding
currentColor") — and at the 30px a row renders at, a single-hue mark reads as
a plain block. Three candidates were rendered next to the real built-in
artwork at the real sizes (30 / 36 / 72, light and dark) before picking one: a
violet rail sat too close to the panel's deep blue to read as a second colour,
and a pale teal panel washed out. The shipped pair is blue for the panel
(gradient) and teal-green for the rail (gradient), which stays legible at row
size and matches the Subagent artwork's proven blue/green combination without
sharing its silhouette.

The description sold the plugin as someone else's sidebar. It now leads with
what it is — better — in one sentence rather than a colon and a feature list,
in both locales, and both `package.json` (the npm blurb and the list's
fallback label) and `dsh.plugin.json` say the same thing. The README never
framed it that way, so nothing there changed.

The artwork guard gained the two properties this decision rests on: the mark
must be colourised (two gradients, no currentColor) and must not use a
CSS-only paint, since the icon ships as an <img> and the search artwork's
foreignObject technique would stay empty there. Red/green verified — a flat
single-hue redraw fails it.

Verified on the live 3080 instance: the row renders the new artwork and
"更好用的右侧边栏——文件树、编辑器、文件变动、任务和侧边对话都收在这一栏里,每个会话互不干扰。"
with no VSCode framing anywhere in the copy.
This commit is contained in:
Menghuan1918
2026-09-23 20:46:11 +08:00
parent 3ee2d40ff9
commit 2d2d78f3f2
7 changed files with 28 additions and 12 deletions
+14 -2
View File
@@ -91,8 +91,9 @@ describe('DSH plugin presentation metadata', () => {
it('keeps the icon in the built-in house style', () => {
const svg = readFileSync(iconPath(), 'utf8')
// Every icon DSH ships for this feature is a 36x36, fill-only geometric
// mark (see packages/experimental/*/icon.svg). Pinning the frame keeps a
// later redraw from silently changing how the mark scales in the list.
// mark (see packages/experimental/*/icon.svg and the artwork in
// ui-primitives/src/plugin-artwork.tsx). Pinning the frame keeps a later
// redraw from silently changing how the mark scales in the list.
expect(svg).toMatch(/viewBox="0 0 36 36"/u)
expect(svg).toMatch(/width="36"/u)
expect(svg).toMatch(/height="36"/u)
@@ -101,6 +102,17 @@ describe('DSH plugin presentation metadata', () => {
// a <text> node would also render in whatever font the browser picks.
expect(svg, 'no stroked outlines in the built-in style').not.toMatch(/stroke=/u)
expect(svg, 'no <text> in an icon').not.toMatch(/<text[\s>]/u)
// The built-ins "carry their own brand colors and gradients instead of
// riding currentColor" (their file header), and each is genuinely
// multi-hue — a flat single-colour redraw reads as a plain block beside
// them at the 30px row size.
expect(svg, 'the mark must be colourised, not flat').toMatch(/<linearGradient/u)
expect((svg.match(/<linearGradient/gu) ?? []).length, 'at least two gradients = two hues').toBeGreaterThanOrEqual(2)
expect(svg, 'no currentColor: plugin artwork owns its palette').not.toMatch(/currentColor/u)
// A CSS-only paint (conic-gradient via foreignObject, as the search
// artwork uses) renders inline but stays EMPTY inside the `<img>` this
// feature delivers the icon through.
expect(svg, 'no foreignObject: the icon ships as an <img>').not.toMatch(/foreignObject/u)
})
it('actually packs the icon and locales into the tarball', () => {