Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Add skills icon to "Skill Ready" toggle in chat (#571)

Vasco Schiavo417e26b1a6f1
diff --git a/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx b/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx
index 2ac9128191..b02837f733 100644
--- a/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx
+++ b/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx
@@ -16,6 +16,7 @@ import {
} from "../event-content-helpers/create-skill-ready-event";
import { ConversationConfirmationButtons } from "#/components/shared/buttons/conversation-confirmation-buttons";
import { SkillReadyContentList } from "./skill-ready-content-list";
+import SkillsIcon from "#/icons/skills.svg?react";
interface GenericEventMessageWrapperProps {
event: OpenHandsEvent | SkillReadyEvent;
@@ -50,8 +51,9 @@ export function GenericEventMessageWrapper({
}
// For Skill Ready events with items, render expandable skill list
+ const isSkillReady = isSkillReadyEvent(event);
const skillReadyDetails =
- isSkillReadyEvent(event) && event._skillReadyItems.length > 0 ? (
+ isSkillReady && event._skillReadyItems.length > 0 ? (
<SkillReadyContentList items={event._skillReadyItems} />
) : (
details
@@ -64,6 +66,11 @@ export function GenericEventMessageWrapper({
details={skillReadyDetails}
success={success}
initiallyExpanded={false}
+ titleIcon={
+ isSkillReady ? (
+ <SkillsIcon className="h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2" />
+ ) : undefined
+ }
/>
{isLastMessage && <ConversationConfirmationButtons />}
</div>
diff --git a/src/components/features/chat/generic-event-message.tsx b/src/components/features/chat/generic-event-message.tsx
index 9fecfe91cc..26bba392b7 100644
--- a/src/components/features/chat/generic-event-message.tsx
+++ b/src/components/features/chat/generic-event-message.tsx
@@ -15,6 +15,8 @@ interface GenericEventMessageProps {
chevronPosition?: "before" | "after";
/** Extra content rendered at the end of the title row (right side). */
titleTrailing?: React.ReactNode;
+ /** Optional icon rendered before the title text. */
+ titleIcon?: React.ReactNode;
}
export function GenericEventMessage({
@@ -24,6 +26,7 @@ export function GenericEventMessage({
initiallyExpanded = false,
chevronPosition = "after",
titleTrailing,
+ titleIcon,
}: GenericEventMessageProps) {
const [showDetails, setShowDetails] = React.useState(initiallyExpanded);
@@ -57,6 +60,7 @@ export function GenericEventMessage({
<div className="flex items-center justify-between font-normal text-[var(--oh-muted)]">
<div className="flex items-center">
{chevronPosition === "before" && chevron}
+ {titleIcon}
{/* Wrap the title in a span so any whitespace inside Trans-rendered
fragments (e.g. "Editing <path>...</path>") is preserved by
normal inline flow instead of being collapsed between
diff --git a/src/components/features/skills/extensions-navigation.tsx b/src/components/features/skills/extensions-navigation.tsx
index 7742bda6e0..df3b1c5408 100644
--- a/src/components/features/skills/extensions-navigation.tsx
+++ b/src/components/features/skills/extensions-navigation.tsx
@@ -4,6 +4,7 @@ import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";
import { useSettings } from "#/hooks/query/use-settings";
import { ACP_PROVIDERS } from "#/constants/acp-providers";
import { cn } from "#/utils/utils";
+import SkillsIcon from "#/icons/skills.svg?react";
import ServerProcessIcon from "#/icons/server-process.svg?react";
import { BackendSyncedSettingsBadge } from "#/components/features/settings/backend-synced-settings-badge";
import { I18nKey } from "#/i18n/declaration";
@@ -28,26 +29,7 @@ const EXTENSIONS_NAV_ITEMS: ExtensionNavItem[] = [
{
to: "/skills",
label: "Skills",
- icon: (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 19.13 24.62"
- fill="none"
- stroke="currentColor"
- strokeLinecap="round"
- strokeLinejoin="round"
- width={16}
- height={16}
- aria-hidden="true"
- >
- <path d="M.86,7.26l5.74,3.3,11.68-6.6" />
- <path d="M6.6,17.15v-6.6" />
- <path d="M1.32,14.34l4.62,2.64c.41.24.91.24,1.32,0l10.56-5.94" />
- <path d="M.66,20c0,.47.25.91.66,1.14l4.62,2.64c.41.24.91.24,1.32,0l10.56-5.94c.41-.24.66-.67.66-1.14V4.62c0-.47-.25-.91-.66-1.14L13.2.84c-.41-.24-.91-.24-1.32,0L1.32,6.78c-.41.24-.66.67-.66,1.14v12.08Z" />
- <path d="M.86,14.06l5.74,3.3,11.68-6.6" />
- <path d="M6.6,23.96v-6.6" />
- </svg>
- ),
+ icon: <SkillsIcon width={16} height={16} aria-hidden="true" />,
end: true,
},
{
diff --git a/src/icons/skills.svg b/src/icons/skills.svg
new file mode 100644
index 0000000000..7942464212
--- /dev/null
+++ b/src/icons/skills.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.13 24.62" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">
+ <path d="M.86,7.26l5.74,3.3,11.68-6.6" />
+ <path d="M6.6,17.15v-6.6" />
+ <path d="M1.32,14.34l4.62,2.64c.41.24.91.24,1.32,0l10.56-5.94" />
+ <path d="M.66,20c0,.47.25.91.66,1.14l4.62,2.64c.41.24.91.24,1.32,0l10.56-5.94c.41-.24.66-.67.66-1.14V4.62c0-.47-.25-.91-.66-1.14L13.2.84c-.41-.24-.91-.24-1.32,0L1.32,6.78c-.41.24-.66.67-.66,1.14v12.08Z" />
+ <path d="M.86,14.06l5.74,3.3,11.68-6.6" />
+ <path d="M6.6,23.96v-6.6" />
+</svg>