Skip to content

Commit 3f37b43

Browse files
committed
Merge branch 'dev' into feat/canceled-prompts-in-history
2 parents 8805dfc + fbabce1 commit 3f37b43

477 files changed

Lines changed: 15502 additions & 13228 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/VOUCHED.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ kitlangton
1515
kommander
1616
r44vc0rp
1717
rekram1-node
18+
-spider-yamet clawdbot/llm psychosis, spam pinging the team
1819
thdxr

bun.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/console.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,10 @@ const bucketNew = new sst.cloudflare.Bucket("ZenDataNew")
166166
const AWS_SES_ACCESS_KEY_ID = new sst.Secret("AWS_SES_ACCESS_KEY_ID")
167167
const AWS_SES_SECRET_ACCESS_KEY = new sst.Secret("AWS_SES_SECRET_ACCESS_KEY")
168168

169-
let logProcessor
170-
if ($app.stage === "production" || $app.stage === "frank") {
171-
const HONEYCOMB_API_KEY = new sst.Secret("HONEYCOMB_API_KEY")
172-
logProcessor = new sst.cloudflare.Worker("LogProcessor", {
173-
handler: "packages/console/function/src/log-processor.ts",
174-
link: [HONEYCOMB_API_KEY],
175-
})
176-
}
169+
const logProcessor = new sst.cloudflare.Worker("LogProcessor", {
170+
handler: "packages/console/function/src/log-processor.ts",
171+
link: [new sst.Secret("HONEYCOMB_API_KEY")],
172+
})
177173

178174
new sst.cloudflare.x.SolidStart("Console", {
179175
domain,
@@ -211,7 +207,7 @@ new sst.cloudflare.x.SolidStart("Console", {
211207
transform: {
212208
worker: {
213209
placement: { mode: "smart" },
214-
tailConsumers: logProcessor ? [{ service: logProcessor.nodes.worker.scriptName }] : [],
210+
tailConsumers: [{ service: logProcessor.nodes.worker.scriptName }],
215211
},
216212
},
217213
},

packages/app/e2e/app/titlebar-history.spec.ts

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { test, expect } from "../fixtures"
2-
import { openSidebar, withSession } from "../actions"
2+
import { defocus, openSidebar, withSession } from "../actions"
33
import { promptSelector } from "../selectors"
4+
import { modKey } from "../utils"
45

56
test("titlebar back/forward navigates between sessions", async ({ page, slug, sdk, gotoSession }) => {
67
await page.setViewportSize({ width: 1400, height: 800 })
@@ -40,3 +41,84 @@ test("titlebar back/forward navigates between sessions", async ({ page, slug, sd
4041
})
4142
})
4243
})
44+
45+
test("titlebar forward is cleared after branching history from sidebar", async ({ page, slug, sdk, gotoSession }) => {
46+
await page.setViewportSize({ width: 1400, height: 800 })
47+
48+
const stamp = Date.now()
49+
50+
await withSession(sdk, `e2e titlebar history a ${stamp}`, async (a) => {
51+
await withSession(sdk, `e2e titlebar history b ${stamp}`, async (b) => {
52+
await withSession(sdk, `e2e titlebar history c ${stamp}`, async (c) => {
53+
await gotoSession(a.id)
54+
55+
await openSidebar(page)
56+
57+
const second = page.locator(`[data-session-id="${b.id}"] a`).first()
58+
await expect(second).toBeVisible()
59+
await second.scrollIntoViewIfNeeded()
60+
await second.click()
61+
62+
await expect(page).toHaveURL(new RegExp(`/${slug}/session/${b.id}(?:\\?|#|$)`))
63+
await expect(page.locator(promptSelector)).toBeVisible()
64+
65+
const back = page.getByRole("button", { name: "Back" })
66+
const forward = page.getByRole("button", { name: "Forward" })
67+
68+
await expect(back).toBeVisible()
69+
await expect(back).toBeEnabled()
70+
await back.click()
71+
72+
await expect(page).toHaveURL(new RegExp(`/${slug}/session/${a.id}(?:\\?|#|$)`))
73+
await expect(page.locator(promptSelector)).toBeVisible()
74+
75+
await openSidebar(page)
76+
77+
const third = page.locator(`[data-session-id="${c.id}"] a`).first()
78+
await expect(third).toBeVisible()
79+
await third.scrollIntoViewIfNeeded()
80+
await third.click()
81+
82+
await expect(page).toHaveURL(new RegExp(`/${slug}/session/${c.id}(?:\\?|#|$)`))
83+
await expect(page.locator(promptSelector)).toBeVisible()
84+
85+
await expect(forward).toBeVisible()
86+
await expect(forward).toBeDisabled()
87+
})
88+
})
89+
})
90+
})
91+
92+
test("keyboard shortcuts navigate titlebar history", async ({ page, slug, sdk, gotoSession }) => {
93+
await page.setViewportSize({ width: 1400, height: 800 })
94+
95+
const stamp = Date.now()
96+
97+
await withSession(sdk, `e2e titlebar shortcuts 1 ${stamp}`, async (one) => {
98+
await withSession(sdk, `e2e titlebar shortcuts 2 ${stamp}`, async (two) => {
99+
await gotoSession(one.id)
100+
101+
await openSidebar(page)
102+
103+
const link = page.locator(`[data-session-id="${two.id}"] a`).first()
104+
await expect(link).toBeVisible()
105+
await link.scrollIntoViewIfNeeded()
106+
await link.click()
107+
108+
await expect(page).toHaveURL(new RegExp(`/${slug}/session/${two.id}(?:\\?|#|$)`))
109+
await expect(page.locator(promptSelector)).toBeVisible()
110+
111+
await defocus(page)
112+
await page.keyboard.press(`${modKey}+[`)
113+
114+
await expect(page).toHaveURL(new RegExp(`/${slug}/session/${one.id}(?:\\?|#|$)`))
115+
await expect(page.locator(promptSelector)).toBeVisible()
116+
117+
await defocus(page)
118+
await page.keyboard.press(`${modKey}+]`)
119+
120+
await expect(page).toHaveURL(new RegExp(`/${slug}/session/${two.id}(?:\\?|#|$)`))
121+
await expect(page.locator(promptSelector)).toBeVisible()
122+
})
123+
})
124+
})
Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,49 @@
11
import { test, expect } from "../fixtures"
22

3-
test.skip("file tree can expand folders and open a file", async ({ page, gotoSession }) => {
3+
test("file tree can expand folders and open a file", async ({ page, gotoSession }) => {
44
await gotoSession()
55

66
const toggle = page.getByRole("button", { name: "Toggle file tree" })
7-
const treeTabs = page.locator('[data-component="tabs"][data-variant="pill"][data-scope="filetree"]')
7+
const panel = page.locator("#file-tree-panel")
8+
const treeTabs = panel.locator('[data-component="tabs"][data-variant="pill"][data-scope="filetree"]')
89

10+
await expect(toggle).toBeVisible()
911
if ((await toggle.getAttribute("aria-expanded")) !== "true") await toggle.click()
12+
await expect(toggle).toHaveAttribute("aria-expanded", "true")
13+
await expect(panel).toBeVisible()
1014
await expect(treeTabs).toBeVisible()
1115

12-
await treeTabs.locator('[data-slot="tabs-trigger"]').nth(1).click()
16+
const allTab = treeTabs.getByRole("tab", { name: /^all files$/i })
17+
await expect(allTab).toBeVisible()
18+
await allTab.click()
19+
await expect(allTab).toHaveAttribute("aria-selected", "true")
1320

14-
const node = (name: string) => treeTabs.getByRole("button", { name, exact: true })
21+
const tree = treeTabs.locator('[data-slot="tabs-content"]:not([hidden])')
22+
await expect(tree).toBeVisible()
1523

16-
await expect(node("packages")).toBeVisible()
17-
await node("packages").click()
24+
const expand = async (name: string) => {
25+
const folder = tree.getByRole("button", { name, exact: true }).first()
26+
await expect(folder).toBeVisible()
27+
await expect(folder).toHaveAttribute("aria-expanded", /true|false/)
28+
if ((await folder.getAttribute("aria-expanded")) === "false") await folder.click()
29+
await expect(folder).toHaveAttribute("aria-expanded", "true")
30+
}
1831

19-
await expect(node("app")).toBeVisible()
20-
await node("app").click()
32+
await expand("packages")
33+
await expand("app")
34+
await expand("src")
35+
await expand("components")
2136

22-
await expect(node("src")).toBeVisible()
23-
await node("src").click()
24-
25-
await expect(node("components")).toBeVisible()
26-
await node("components").click()
27-
28-
await expect(node("file-tree.tsx")).toBeVisible()
29-
await node("file-tree.tsx").click()
37+
const file = tree.getByRole("button", { name: "file-tree.tsx", exact: true }).first()
38+
await expect(file).toBeVisible()
39+
await file.click()
3040

3141
const tab = page.getByRole("tab", { name: "file-tree.tsx" })
3242
await expect(tab).toBeVisible()
3343
await tab.click()
44+
await expect(tab).toHaveAttribute("aria-selected", "true")
3445

3546
const code = page.locator('[data-component="code"]').first()
36-
await expect(code.getByText("export default function FileTree")).toBeVisible()
47+
await expect(code).toBeVisible()
48+
await expect(code).toContainText("export default function FileTree")
3749
})

packages/app/e2e/projects/projects-close.spec.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test, expect } from "../fixtures"
2-
import { createTestProject, cleanupTestProject, openSidebar, clickMenuItem } from "../actions"
3-
import { projectCloseHoverSelector, projectCloseMenuSelector, projectSwitchSelector } from "../selectors"
2+
import { createTestProject, cleanupTestProject, openSidebar, clickMenuItem, openProjectMenu } from "../actions"
3+
import { projectCloseHoverSelector, projectSwitchSelector } from "../selectors"
44
import { dirSlug } from "../utils"
55

66
test("can close a project via hover card close button", async ({ page, withProject }) => {
@@ -31,16 +31,15 @@ test("can close a project via hover card close button", async ({ page, withProje
3131
}
3232
})
3333

34-
test("can close a project via project header more options menu", async ({ page, withProject }) => {
34+
test("closing active project navigates to another open project", async ({ page, withProject }) => {
3535
await page.setViewportSize({ width: 1400, height: 800 })
3636

3737
const other = await createTestProject()
38-
const otherName = other.split("/").pop() ?? other
3938
const otherSlug = dirSlug(other)
4039

4140
try {
4241
await withProject(
43-
async () => {
42+
async ({ slug }) => {
4443
await openSidebar(page)
4544

4645
const otherButton = page.locator(projectSwitchSelector(otherSlug)).first()
@@ -49,21 +48,20 @@ test("can close a project via project header more options menu", async ({ page,
4948

5049
await expect(page).toHaveURL(new RegExp(`/${otherSlug}/session`))
5150

52-
const header = page
53-
.locator(".group\\/project")
54-
.filter({ has: page.locator(`[data-action="project-menu"][data-project="${otherSlug}"]`) })
55-
.first()
56-
await expect(header).toContainText(otherName)
51+
const menu = await openProjectMenu(page, otherSlug)
5752

58-
const trigger = header.locator(`[data-action="project-menu"][data-project="${otherSlug}"]`).first()
59-
await expect(trigger).toHaveCount(1)
60-
await trigger.focus()
61-
await page.keyboard.press("Enter")
53+
await clickMenuItem(menu, /^Close$/i, { force: true })
6254

63-
const menu = page.locator('[data-component="dropdown-menu-content"]').first()
64-
await expect(menu).toBeVisible({ timeout: 10_000 })
55+
await expect
56+
.poll(() => {
57+
const pathname = new URL(page.url()).pathname
58+
if (new RegExp(`^/${slug}/session(?:/[^/]+)?/?$`).test(pathname)) return "project"
59+
if (pathname === "/") return "home"
60+
return ""
61+
})
62+
.toMatch(/^(project|home)$/)
6563

66-
await clickMenuItem(menu, /^Close$/i, { force: true })
64+
await expect(page).not.toHaveURL(new RegExp(`/${otherSlug}/session(?:[/?#]|$)`))
6765
await expect(otherButton).toHaveCount(0)
6866
},
6967
{ extra: [other] },

0 commit comments

Comments
 (0)