Skip to content

Commit de790a5

Browse files
feat(app): UI improvements 2 (anomalyco#1759)
1 parent 81b7954 commit de790a5

13 files changed

Lines changed: 832 additions & 152 deletions

File tree

‎apps/app/src/app/constants.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export type ExtensionKind = "mcp" | "plugin" | "skill";
2121

2222
export type McpDirectoryInfo = {
2323
id?: string;
24+
/** Display name shown in the UI. */
2425
name: string;
26+
/** Safe server name for opencode.jsonc (alphanumeric, - and _ only). Auto-derived from name if omitted. */
27+
serverName?: string;
2528
description: string;
2629
url?: string;
2730
type?: "remote" | "local";
@@ -35,9 +38,20 @@ export type McpDirectoryInfo = {
3538
iconSrc?: string;
3639
};
3740

41+
/** Derive a safe MCP server name from a display name or explicit serverName. */
42+
export function getMcpServerName(entry: McpDirectoryInfo): string {
43+
if (entry.serverName) return entry.serverName;
44+
return entry.name
45+
.toLowerCase()
46+
.replace(/[^a-z0-9_-]/g, "-")
47+
.replace(/-+/g, "-")
48+
.replace(/^-|-$/g, "") || "mcp";
49+
}
50+
3851
export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
3952
{
4053
get name() { return t("mcp.quick_connect_notion_title"); },
54+
serverName: "notion",
4155
get description() { return t("mcp.quick_connect_notion_desc"); },
4256
url: "https://mcp.notion.com/mcp",
4357
type: "remote",
@@ -47,6 +61,7 @@ export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
4761
},
4862
{
4963
get name() { return t("mcp.quick_connect_linear_title"); },
64+
serverName: "linear",
5065
get description() { return t("mcp.quick_connect_linear_desc"); },
5166
url: "https://mcp.linear.app/mcp",
5267
type: "remote",
@@ -56,6 +71,7 @@ export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
5671
},
5772
{
5873
get name() { return t("mcp.quick_connect_sentry_title"); },
74+
serverName: "sentry",
5975
get description() { return t("mcp.quick_connect_sentry_desc"); },
6076
url: "https://mcp.sentry.dev/mcp",
6177
type: "remote",
@@ -65,6 +81,7 @@ export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
6581
},
6682
{
6783
get name() { return t("mcp.quick_connect_stripe_title"); },
84+
serverName: "stripe",
6885
get description() { return t("mcp.quick_connect_stripe_desc"); },
6986
url: "https://mcp.stripe.com",
7087
type: "remote",
@@ -74,6 +91,7 @@ export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
7491
},
7592
{
7693
get name() { return t("mcp.quick_connect_context7_title"); },
94+
serverName: "context7",
7795
get description() { return t("mcp.quick_connect_context7_desc"); },
7896
url: "https://mcp.context7.com/mcp",
7997
type: "remote",
@@ -83,6 +101,7 @@ export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
83101
},
84102
{
85103
get name() { return t("mcp.quick_connect_openwork_cloud_title"); },
104+
serverName: "openwork-cloud",
86105
get description() { return t("mcp.quick_connect_openwork_cloud_desc"); },
87106
get url() {
88107
try {
@@ -96,4 +115,13 @@ export const MCP_QUICK_CONNECT: McpDirectoryInfo[] = [
96115
kind: "mcp",
97116
iconSrc: "/openwork-mark.svg",
98117
},
118+
{
119+
get name() { return t("mcp.quick_connect_openwork_ui_title"); },
120+
serverName: "openwork-ui",
121+
get description() { return t("mcp.quick_connect_openwork_ui_desc"); },
122+
type: "remote",
123+
oauth: false,
124+
kind: "mcp",
125+
iconSrc: "/openwork-mark.svg",
126+
},
99127
];

‎apps/app/src/react-app/design-system/extension-card.tsx‎

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function ExtensionCard(props: ExtensionCardProps) {
6161
return (
6262
<button
6363
type="button"
64-
disabled={disabled || connected || connecting}
64+
disabled={disabled || connecting}
6565
onClick={onClick}
6666
className={`group w-full rounded-xl border p-4 text-left transition-all ${
6767
connected
@@ -71,22 +71,27 @@ export function ExtensionCard(props: ExtensionCardProps) {
7171
>
7272
<div className="flex items-start gap-3">
7373
{/* Icon */}
74-
<div
75-
className={`flex size-10 shrink-0 items-center justify-center rounded-lg border ${
76-
connected ? "border-green-6 bg-green-3" : "border-dls-border bg-dls-hover"
77-
}`}
78-
>
79-
{connecting ? (
80-
<Loader2 size={18} className="animate-spin text-dls-secondary" />
81-
) : connected ? (
82-
<CheckCircle2 size={18} className="text-green-11" />
83-
) : iconSrc ? (
84-
<img src={iconSrc} alt="" width={18} height={18} loading="lazy" style={{ display: "block" }} />
85-
) : iconSlug ? (
86-
<img src={`https://cdn.simpleicons.org/${iconSlug}`} alt="" width={18} height={18} loading="lazy" style={{ display: "block" }} />
87-
) : (
88-
<FallbackIcon size={18} className="text-dls-secondary" />
89-
)}
74+
<div className="relative shrink-0">
75+
<div
76+
className={`flex size-10 items-center justify-center rounded-lg border ${
77+
connected ? "border-green-6 bg-green-2" : "border-dls-border bg-dls-hover"
78+
}`}
79+
>
80+
{connecting ? (
81+
<Loader2 size={18} className="animate-spin text-dls-secondary" />
82+
) : iconSrc ? (
83+
<img src={iconSrc} alt="" width={18} height={18} loading="lazy" style={{ display: "block" }} />
84+
) : iconSlug ? (
85+
<img src={`https://cdn.simpleicons.org/${iconSlug}`} alt="" width={18} height={18} loading="lazy" style={{ display: "block" }} />
86+
) : (
87+
<FallbackIcon size={18} className="text-dls-secondary" />
88+
)}
89+
</div>
90+
{connected ? (
91+
<div className="absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full border-2 border-white bg-green-9">
92+
<CheckCircle2 size={9} className="text-white" strokeWidth={3} />
93+
</div>
94+
) : null}
9095
</div>
9196

9297
{/* Content */}

0 commit comments

Comments
 (0)