Files
multica/packages/views/skills/lib/skill-icon.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

19 lines
841 B
TypeScript

import type { LucideIcon } from "lucide-react";
import { WORKSPACE_PAGES } from "@multica/core/paths";
import { ROUTE_ICON_COMPONENTS } from "../../layout/route-icon-components";
/**
* The icon that means "a skill", anywhere one is rendered as an entity: list
* header, empty states, detail identity, agent skill rows, skill pickers.
*
* Derived from the skills route icon rather than re-declared, so the sidebar,
* the desktop tab bar, and every in-page surface can never drift apart again
* — they previously showed four different icons (BookOpenText, BookOpen,
* FileText, Sparkles) for the same thing.
*
* This is for the skill *entity*. A file inside a skill is not a skill; those
* keep the file-type icons in `file-tree.tsx`.
*/
export const SkillIcon: LucideIcon =
ROUTE_ICON_COMPONENTS[WORKSPACE_PAGES.skills.icon];