Skip to content
Merged
Show file tree
Hide file tree
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
220 changes: 0 additions & 220 deletions apps/web/src/pages/plugin-skill-detail-panel.tsx

This file was deleted.

26 changes: 12 additions & 14 deletions apps/web/src/pages/plugins-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
// Connections surface. See this ticket's report for the full grounding.
//
// Skills gets the same gallery treatment as plugins (owner ruling): cards,
// not the Settings section's list rows — reusing `../skills-api.ts`'s data
// and mutations through `PluginSkillDetailPanel`, never forking
// `SkillsPage` itself.
// not the Skills roster's list rows. Opening a card (or creating a skill)
// navigates to `/skills/<name>` — the same path `SkillsPage.open` already
// uses. Mutations live there; this gallery never mounts a twin editor.

import { Button, PageShell, RichEmptyState } from "@corbits/react-ui";
import { WorkbenchLoadingState } from "@corbits/chat-ui";
Expand All @@ -27,6 +27,7 @@ import { Plus, SquaresFour, Warning } from "@corbits/icons";
import { useCallback, useEffect, useState } from "react";

import { useBench } from "../bench-context";
import { SKILLS_PATH_PREFIX } from "../path-ids";
import {
useClearPendingConnectProvider,
usePendingConnectProvider,
Expand All @@ -42,7 +43,6 @@ import {
CreateSkillDialog,
type SkillCreateInput,
} from "./create-skill-dialog";
import { PluginSkillDetailPanel } from "./plugin-skill-detail-panel";

type PluginsState =
| { readonly status: "loading" }
Expand All @@ -64,9 +64,10 @@ function canOpenPluginPanel(plugin: ResolvedPlugin): boolean {

export function PluginsRoute({
path: _path,
navigate,
}: {
readonly path: string;
readonly navigate?: (to: string) => void;
readonly navigate: (to: string) => void;
}) {
const { selectedTenantId } = useBench();
const [pluginsState, setPluginsState] = useState<PluginsState>({
Expand All @@ -76,7 +77,6 @@ export function PluginsRoute({
status: "loading",
});
const [openPlugin, setOpenPlugin] = useState<ResolvedPlugin | null>(null);
const [openSkillName, setOpenSkillName] = useState<string | null>(null);
const [createSkillOpen, setCreateSkillOpen] = useState(false);
const [activeTab, setActiveTab] = useState<PluginsGalleryTab>("plugins");
const [galleryQuery, setGalleryQuery] = useState("");
Expand Down Expand Up @@ -143,6 +143,10 @@ export function PluginsRoute({
openPluginPanel,
]);

function openSkill(name: string) {
navigate(`${SKILLS_PATH_PREFIX}/${encodeURIComponent(name)}`);
}

async function handleCreateSkill(input: SkillCreateInput) {
if (selectedTenantId === null) return;
const skill =
Expand All @@ -155,7 +159,7 @@ export function PluginsRoute({
});
setCreateSkillOpen(false);
reloadSkills();
setOpenSkillName(skill.name);
openSkill(skill.name);
}

if (selectedTenantId === null) {
Expand Down Expand Up @@ -248,7 +252,7 @@ export function PluginsRoute({
plugins={pluginsState.plugins}
skills={skillCards}
onOpenPlugin={openPluginPanel}
onOpenSkill={(skill) => setOpenSkillName(skill.name)}
onOpenSkill={(skill) => openSkill(skill.name)}
activeTab={activeTab}
onTabChange={setActiveTab}
query={galleryQuery}
Expand All @@ -260,12 +264,6 @@ export function PluginsRoute({
onClose={() => setOpenPlugin(null)}
onChanged={reloadPlugins}
/>
<PluginSkillDetailPanel
tenantId={tenantId}
skillName={openSkillName}
onClose={() => setOpenSkillName(null)}
onChanged={reloadSkills}
/>
<CreateSkillDialog
open={createSkillOpen}
onOpenChange={setCreateSkillOpen}
Expand Down
Loading
Loading