Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(views): keep intro actions clickable after carousel paging (#10813)

catPaw-s4a826aadc012
diff --git a/e2e/skills-intro.spec.ts b/e2e/skills-intro.spec.ts
new file mode 100644
index 0000000000..c52a636da1
--- /dev/null
+++ b/e2e/skills-intro.spec.ts
@@ -0,0 +1,35 @@
+import { expect, test } from "@playwright/test";
+import { loginAsDefault } from "./helpers";
+
+test("keeps the Skills intro actions clickable after paging the carousel", async ({ page }) => {
+ await page.setViewportSize({ width: 1318, height: 870 });
+ await page.emulateMedia({ reducedMotion: "reduce" });
+ const slug = await loginAsDefault(page);
+ await page.route("**/api/skills**", (route) => {
+ const request = route.request();
+ if (request.method() !== "GET" || !new URL(request.url()).pathname.endsWith("/api/skills")) {
+ return route.fallback();
+ }
+ return route.fulfill({ json: [] });
+ });
+ await page.goto(`/${slug}/skills`, { waitUntil: "domcontentloaded" });
+
+ const intro = page.getByRole("region", { name: "Turn how your team works into skills" });
+ const create = intro.getByRole("button", { name: "New skill", exact: true });
+ const docs = intro.getByRole("link", { name: "Read the docs" });
+
+ for (const slide of [1, 2, 3]) {
+ await intro.getByRole("button", { name: `Go to slide ${slide}` }).click();
+ // The transparent carousel track used to intercept clicks over the actions
+ // on the last slide. Browser hit testing is required; jsdom has no layout.
+ await expect.poll(() => docs.evaluate((link) => {
+ const rect = link.getBoundingClientRect();
+ return link.contains(document.elementFromPoint(rect.x + rect.width / 2, rect.y + rect.height / 2));
+ })).toBe(true);
+ await create.click({ timeout: 3000 });
+ await page.getByRole("menuitem", { name: /^Create manually/ }).click();
+ await expect(page.getByRole("dialog", { name: "Create manually" })).toBeVisible();
+ await page.keyboard.press("Escape");
+ await expect(page.getByRole("dialog")).toHaveCount(0);
+ }
+});
diff --git a/packages/views/layout/feature-intro.tsx b/packages/views/layout/feature-intro.tsx
index b6fe0279ae..e52653b308 100644
--- a/packages/views/layout/feature-intro.tsx
+++ b/packages/views/layout/feature-intro.tsx
@@ -206,7 +206,8 @@ export function FeatureIntroCarousel({
className="w-full max-w-[22.5rem]"
>
<div
- className="flex gap-6 transition-transform duration-300 ease-out motion-reduce:transition-none"
+ // The translated track can overlap the intro actions; only slides receive pointer events.
+ className="pointer-events-none flex gap-6 transition-transform duration-300 ease-out motion-reduce:transition-none"
style={{ transform: `translateX(calc(${-index} * (100% + 1.5rem)))` }}
>
{slides.map((slide, i) => {
@@ -223,7 +224,7 @@ export function FeatureIntroCarousel({
aria-hidden={!active}
inert={!active}
className={cn(
- "w-full shrink-0 transition-opacity duration-300 motion-reduce:transition-none",
+ "pointer-events-auto w-full shrink-0 transition-opacity duration-300 motion-reduce:transition-none",
active ? "opacity-100" : i === index + 1 ? "opacity-40" : "opacity-0",
)}
>