Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions packages/app/src/app/pages/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type {

import type { WorkspaceInfo } from "../lib/tauri";

import { ArrowRight, ChevronDown, HardDrive, Shield, Zap } from "lucide-solid";
import { ArrowRight, ChevronDown, HardDrive, Shield, Sparkles, Zap } from "lucide-solid";

import Button from "../components/button";
import RenameSessionModal from "../components/rename-session-modal";
Expand Down Expand Up @@ -408,6 +408,8 @@ export default function SessionView(props: SessionViewProps) {
const record = part as any;
const tool = typeof record.tool === "string" ? record.tool : "";
switch (tool) {
case "skill":
return "Using skill";
case "task":
return "Delegating";
case "todowrite":
Expand Down Expand Up @@ -481,6 +483,18 @@ export default function SessionView(props: SessionViewProps) {
return null;
});

const activeSkill = createMemo<string | null>(() => {
const part = latestRunPart();
if (!part || part.type !== "tool") return null;
const record = part as any;
const tool = typeof record.tool === "string" ? record.tool : "";
if (tool !== "skill") return null;
const state = record.state ?? {};
const title = typeof state.title === "string" ? state.title : "";
const skillName = state.metadata?.name || title.replace(/^Loaded skill:\s*/i, "").trim();
return skillName || "skill";
});

const runLabel = createMemo(() => {
switch (runPhase()) {
case "sending":
Expand Down Expand Up @@ -1398,15 +1412,26 @@ export default function SessionView(props: SessionViewProps) {
<div class="flex justify-start pl-2">
<div class="w-full max-w-[68ch] space-y-2">
<Show when={thinkingStatus()}>
<div class="rounded-xl border border-gray-6/70 bg-gray-2/40 px-3 py-2 text-xs text-gray-11">
<div class={`rounded-xl border px-3 py-2 text-xs text-gray-11 ${activeSkill()
? "border-purple-6/70 bg-purple-2/40"
: "border-gray-6/70 bg-gray-2/40"
}`}>
<button
type="button"
class="w-full flex items-center justify-between gap-3 text-left"
onClick={() => setThinkingExpanded((prev) => !prev)}
aria-expanded={thinkingExpanded()}
>
<div class="flex items-center gap-2 min-w-0">
<span class="text-[10px] uppercase tracking-wide text-gray-9">Thinking</span>
<Show
when={activeSkill()}
fallback={<span class="text-[10px] uppercase tracking-wide text-gray-9">Thinking</span>}
>
<Sparkles size={12} class="text-purple-10 shrink-0" />
<span class="text-[10px] px-1.5 py-0.5 rounded-full bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300 shrink-0">
{activeSkill()}
</span>
</Show>
<span class="truncate text-gray-12">{thinkingStatus()}</span>
</div>
<ChevronDown
Expand Down
Loading