mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-13 04:59:51 +08:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13371e8092 | ||
|
|
55a32af76a | ||
|
|
75ffc32a49 | ||
|
|
65625ba212 | ||
|
|
b2cadfa5bf | ||
|
|
717f7e9445 | ||
|
|
e1c083dae0 | ||
|
|
f811242568 | ||
|
|
e0a196dded | ||
|
|
841efcfea2 | ||
|
|
25a1059648 | ||
|
|
932fd03a7c | ||
|
|
b0e95a5ef4 | ||
|
|
31f4641178 | ||
|
|
2aef9d180c | ||
|
|
9c31481dd7 | ||
|
|
1ef9f3ea3d |
@@ -9,9 +9,6 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
# Run it by hand on main when a push did not trigger it (GitHub drops an
|
|
||||||
# event now and then); it then pushes to ECR like a push to main
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const MCP_URL =
|
|||||||
"https://github.com/DayuanJiang/next-ai-draw-io/tree/main/packages/mcp-server"
|
"https://github.com/DayuanJiang/next-ai-draw-io/tree/main/packages/mcp-server"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the user closed the MCP notice once. Starts as closed so the server
|
* Whether the user closed the MCP video once. Starts as closed so the server
|
||||||
* render and the first client render agree; the stored choice is read after
|
* render and the first client render agree; the stored choice is read after
|
||||||
* mount.
|
* mount.
|
||||||
*/
|
*/
|
||||||
@@ -90,12 +90,25 @@ const cardClass =
|
|||||||
"w-full rounded-xl border border-purple-500/20 bg-gradient-to-r from-purple-500/10 to-blue-500/10"
|
"w-full rounded-xl border border-purple-500/20 bg-gradient-to-r from-purple-500/10 to-blue-500/10"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MCP server notice on the start screen: the card with the promo video. Once
|
* MCP server notice on the start screen. Until the user closes it, the card
|
||||||
* the user closes it, it does not come back.
|
* also plays the promo video; after that it is the plain card for good.
|
||||||
*/
|
*/
|
||||||
export function McpNotice({ className }: { className?: string }) {
|
export function McpNotice({ className }: { className?: string }) {
|
||||||
const [closed, close] = useVideoClosed()
|
const [closed, close] = useVideoClosed()
|
||||||
if (closed) return null
|
if (closed) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
cardClass,
|
||||||
|
"px-4 py-3 transition-colors hover:border-purple-500/40",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
data-testid="mcp-notice"
|
||||||
|
>
|
||||||
|
<NoticeLink />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(cardClass, "p-3", className)}
|
className={cn(cardClass, "p-3", className)}
|
||||||
|
|||||||
+1
-1
@@ -30,6 +30,6 @@ export const STORAGE_KEYS = {
|
|||||||
// Langfuse session id
|
// Langfuse session id
|
||||||
sessionId: "next-ai-draw-io-session-id",
|
sessionId: "next-ai-draw-io-session-id",
|
||||||
|
|
||||||
// The start screen's MCP card with its video was closed (it does not come back)
|
// The start screen's MCP video was closed (it does not come back)
|
||||||
mcpVideoClosed: "next-ai-draw-io-mcp-video-closed",
|
mcpVideoClosed: "next-ai-draw-io-mcp-video-closed",
|
||||||
} as const
|
} as const
|
||||||
|
|||||||
@@ -170,17 +170,18 @@ test.describe("Workspace", () => {
|
|||||||
await expect(getChatInput(page)).toHaveValue("Draw a cat for me")
|
await expect(getChatInput(page)).toHaveValue("Draw a cat for me")
|
||||||
})
|
})
|
||||||
|
|
||||||
test("the MCP card and its video stay away once closed", async ({
|
test("the MCP card's video stays away once closed", async ({ page }) => {
|
||||||
page,
|
|
||||||
}) => {
|
|
||||||
await openApp(page)
|
await openApp(page)
|
||||||
const card = page.locator('[data-testid="mcp-notice"]')
|
const card = page.locator('[data-testid="mcp-notice"]')
|
||||||
|
const video = page.locator('[data-testid="mcp-video"]')
|
||||||
await expect(card.locator('[data-testid="mcp-video"]')).toBeVisible()
|
await expect(card.locator('[data-testid="mcp-video"]')).toBeVisible()
|
||||||
await page.locator('[data-testid="mcp-video-close"]').click()
|
await page.locator('[data-testid="mcp-video-close"]').click()
|
||||||
await expect(card).toHaveCount(0)
|
await expect(video).toHaveCount(0)
|
||||||
|
await expect(card).toBeVisible()
|
||||||
await page.reload({ waitUntil: "networkidle" })
|
await page.reload({ waitUntil: "networkidle" })
|
||||||
await expect(page.locator('[data-testid="lobby-hero"]')).toBeVisible()
|
await expect(page.locator('[data-testid="lobby-hero"]')).toBeVisible()
|
||||||
await expect(card).toHaveCount(0)
|
await expect(card).toBeVisible()
|
||||||
|
await expect(video).toHaveCount(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("each AI change becomes a version card; the latest undoes and redoes it", async ({
|
test("each AI change becomes a version card; the latest undoes and redoes it", async ({
|
||||||
|
|||||||
Reference in New Issue
Block a user