diff --git a/packages/pen-core/src/element-builders/tag.ts b/packages/pen-core/src/element-builders/tag.ts index b143011b3..dcf19832b 100644 --- a/packages/pen-core/src/element-builders/tag.ts +++ b/packages/pen-core/src/element-builders/tag.ts @@ -58,6 +58,7 @@ export function buildTag(params: TagParams): ElementTree { iconFontFamily: 'lucide', width: 14, height: 14, + fill: [{ type: 'solid', color: tone.fg }], }); } return { diff --git a/packages/pen-mcp/src/__tests__/add-tag-v0.test.ts b/packages/pen-mcp/src/__tests__/add-tag-v0.test.ts index 91ba462f9..48c5142af 100644 --- a/packages/pen-mcp/src/__tests__/add-tag-v0.test.ts +++ b/packages/pen-mcp/src/__tests__/add-tag-v0.test.ts @@ -107,8 +107,14 @@ describe('add_tag_v0 — structure', () => { await handleAddTagV0({ filePath: fp, label: tone, tone }); const tag = getRoot(await readDoc(fp)); expect((tag.fill as Array<{ color: string }>)[0].color).toBe(bg); - const label = (tag.children as Record[])[0]; + const kids = tag.children as Record[]; + const label = kids[0]; expect((label.fill as Array<{ color: string }>)[0].color).toBe(fg); + // close icon must inherit the tone fg or it stays default-black + // and clashes with the label color (Codex caught this). + const remove = kids[1]; + expect(remove.role).toBe('tag-remove'); + expect((remove.fill as Array<{ color: string }>)[0].color).toBe(fg); invalidateCache(fp); await writeFile(fp, EMPTY_DOC, 'utf-8'); }