Files
multica/packages/views/skills/lib/skill-icon.test.ts
Naiyuan Qing a8c775e94b feat(skills): floating save pill with change summary + one skill icon everywhere (#6177)
* feat(skills): floating change-summary save pill on skill detail

Replace the always-mounted docked save bar with a dirty-only floating
pill matching the skills list batch toolbar: page-root anchored, with a
summary of what changed (name, description, N files — renames counted
once by matching files by id), discard/save actions, and a fade+slide-in
entrance. Editor surfaces gain bottom padding so the last lines stay
readable under the pill.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(skills): one icon for the skill entity everywhere (MUL-5443)

Skills were drawn with four different icons: BookOpenText in the sidebar
and desktop tab bar, BookOpen on the list page header and empty state,
FileText for skill rows in an agent's Skills tab and the skill picker, and
Sparkles on the new detail identity block — where it also already meant
"imported origin" two lines below.

`WORKSPACE_PAGES.skills.icon` already declares the icon name, and
ROUTE_ICON_COMPONENTS already turns it into a component for the sidebar and
tab bar. Derive a `SkillIcon` export from that pair instead of re-declaring
the icon per call site, so the nav and every in-page surface cannot drift
apart again. A test asserts SkillIcon is the same component the tab bar
resolves for a /skills path.

File-type icons inside a skill's file tree are untouched — a file in a
skill is not a skill.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-07-30 16:25:50 +08:00

18 lines
753 B
TypeScript

import { describe, it, expect } from "vitest";
import { routeIconForPath } from "../../layout/route-icon-components";
import { SkillIcon } from "./skill-icon";
describe("SkillIcon", () => {
// The sidebar and desktop tab bar both render the route icon, while every
// in-page surface renders SkillIcon. Before they were derived from one
// declaration the product showed four icons for the same entity
// (BookOpenText, BookOpen, FileText, Sparkles).
it("is the same component the sidebar and tab bar resolve for /skills", () => {
expect(SkillIcon).toBe(routeIconForPath("/acme/skills"));
});
it("keeps matching for a nested skill detail path", () => {
expect(SkillIcon).toBe(routeIconForPath("/acme/skills/skill-1"));
});
});