fix(linear): clarify setup actions and MCP configuration

This commit is contained in:
chengyongru authored and chengyongru committed 2026-09-23 18:29:52 +08:00
1 parent d699088705
commit 1fc44e091b
20 files changed
+228 -121

No files matched your search

@@ -1,5 +1,6 @@
import {
forwardRef,
useEffect,
useId,
useMemo,
useState,
@@ -94,6 +95,8 @@ export const DEFAULT_CUSTOM_MCP_FORM: CustomMcpForm = {
};
export function AppsCatalogSettings({
setupName,
onSetupOpened,
cliApps,
mcpPresets,
cliAppsLoading,
@@ -137,6 +140,8 @@ export function AppsCatalogSettings({
onRestart,
isRestarting,
}: {
setupName?: string | null;
onSetupOpened?: () => void;
cliApps: CliAppsPayload | null;
mcpPresets: McpPresetsPayload | null;
cliAppsLoading: boolean;
@@ -321,6 +326,8 @@ export function AppsCatalogSettings({
<McpAppsCatalogRow
key={item.id}
preset={item.preset}
openConnection={setupName === item.preset.name}
onConnectionOpened={onSetupOpened}
values={mcpFieldValues[item.preset.name] ?? {}}
actionKey={mcpActionKey}
oauthFlow={mcpOAuthFlow?.name === item.preset.name ? mcpOAuthFlow : null}
@@ -484,6 +491,8 @@ function CliAppsCatalogRow({
}
function McpAppsCatalogRow({
openConnection = false,
onConnectionOpened,
preset,
values,
actionKey,
@@ -503,6 +512,8 @@ function McpAppsCatalogRow({
onOAuthComplete,
onToolsChange,
}: {
openConnection?: boolean;
onConnectionOpened?: () => void;
preset: McpPresetInfo;
values: Record<string, string>;
actionKey: string | null;
@@ -526,6 +537,12 @@ function McpAppsCatalogRow({
const tx = (key: string, fallback: string) => t(key, { defaultValue: fallback });
const [managementOpen, setManagementOpen] = useState(false);
const [managementTab, setManagementTab] = useState<McpManagementTab>("overview");
useEffect(() => {
if (!openConnection) return;
setManagementTab("connection");
setManagementOpen(true);
onConnectionOpened?.();
}, [openConnection, onConnectionOpened]);
const enableBusy = actionKey === `enable:${preset.name}`;
const disableBusy = actionKey === `disable:${preset.name}`;
const removeBusy = actionKey === `remove:${preset.name}`;
@@ -19,7 +19,7 @@ type ChannelFilter = "all" | "enabled";
export function ChannelsSettings({
token, nanobotFeatures, loading, actionKey, chatAppsDocsUrl, showBrandLogos,
error, requiresRestartPending, onAction, onFeaturesUpdate, onDismissStatus,
onRestart, isRestarting,
onRestart, isRestarting, onConfigureMcp,
}: {
token: string;
nanobotFeatures: NanobotFeaturesPayload | null;
@@ -32,6 +32,7 @@ export function ChannelsSettings({
onAction: ChannelFeatureAction;
onFeaturesUpdate: (payload: NanobotFeaturesPayload) => void;
onDismissStatus: () => void;
onConfigureMcp?: (name: string) => void;
onRestart?: () => void;
isRestarting?: boolean;
}) {
@@ -176,6 +177,7 @@ export function ChannelsSettings({
{selectedChannel ? <ChannelSetupPanel token={token} feature={selectedChannel} actionKey={actionKey}
showBrandLogos={showBrandLogos}
onAction={onAction} onFeaturesUpdate={onFeaturesUpdate} connectRequestId={connectRequestId}
onConfigureMcp={onConfigureMcp}
onBeforeCloseChange={setBeforeChannelClose} /> : null}
</div>
</div>