From 13b65421ff967499c6067ce31607c4ef37a85fa5 Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Thu, 12 Nov 2026 15:25:13 +0100 Subject: [PATCH 1/3] feat(home): prev/next arrows and an Open button on the workflow carousel Bare chevrons at both ends of the arc, dimmed until the pointer is on the carousel, and a white Open pill on the front card on hover or focus that opens the same workflow as clicking the card. Co-Authored-By: Claude Opus 5.5 --- locales/en.json | 3 + locales/zh.json | 3 + src/renderer/src/panel/HomeView.test.ts | 59 +++++- .../src/panel/home/HomeWorkflowCarousel.vue | 180 +++++++++++------- 4 files changed, 175 insertions(+), 70 deletions(-) diff --git a/locales/en.json b/locales/en.json index eb46da807..426e1c8f3 100644 --- a/locales/en.json +++ b/locales/en.json @@ -38,6 +38,9 @@ "seeAllWorkflows": "See all workflows", "showWorkflow": "Show {title}", "openWorkflow": "Open {title} on Comfy Hub", + "openWorkflowCta": "Open", + "previousWorkflow": "Previous workflow", + "nextWorkflow": "Next workflow", "workflowsUnavailable": "Example workflows couldn't be loaded. Check your connection and try again.", "retry": "Try again" }, diff --git a/locales/zh.json b/locales/zh.json index f17ba0975..78540d9a3 100644 --- a/locales/zh.json +++ b/locales/zh.json @@ -38,6 +38,9 @@ "seeAllWorkflows": "查看全部工作流", "showWorkflow": "显示 {title}", "openWorkflow": "在 Comfy Hub 打开 {title}", + "openWorkflowCta": "打开", + "previousWorkflow": "上一个工作流", + "nextWorkflow": "下一个工作流", "workflowsUnavailable": "无法加载示例工作流。请检查网络连接后重试。", "retry": "重试" }, diff --git a/src/renderer/src/panel/HomeView.test.ts b/src/renderer/src/panel/HomeView.test.ts index 53e282f90..b58a31e00 100644 --- a/src/renderer/src/panel/HomeView.test.ts +++ b/src/renderer/src/panel/HomeView.test.ts @@ -88,7 +88,10 @@ async function openHome() { function arc(wrapper: VueWrapper): string[] { return wrapper .findAll('[data-testid="home-workflow-card"]:not([aria-hidden="true"])') - .map((card) => ({ offset: Number(card.attributes('data-arc-offset')), text: card.text() })) + .map((card) => ({ + offset: Number(card.attributes('data-arc-offset')), + text: card.get('[data-testid="home-workflow-name"]').text() + })) .sort((left, right) => left.offset - right.offset) .map((card) => `${card.offset}:${card.text}`) } @@ -201,6 +204,60 @@ describe('Home example workflows', () => { expect(cardAt(wrapper, 0).text()).toContain('Workflow 1') }) + it('turns the carousel with the previous and next arrows', async () => { + listHomeWorkflows.mockResolvedValue(SEVEN_WORKFLOWS) + const wrapper = await openHome() + const next = wrapper.get('[data-testid="home-workflow-next"]') + const previous = wrapper.get('[data-testid="home-workflow-previous"]') + + expect(next.attributes('aria-label')).toBe('Next workflow') + expect(previous.attributes('aria-label')).toBe('Previous workflow') + + await next.trigger('click') + await next.trigger('click') + expect(cardAt(wrapper, 0).text()).toContain('Workflow 2') + + await previous.trigger('click') + await previous.trigger('click') + await previous.trigger('click') + expect(cardAt(wrapper, 0).text()).toContain('Workflow 6') + expect(openCatalogWorkflow).not.toHaveBeenCalled() + }) + + it('stops the arrows at the ends of a short list and leaves them out for a single card', async () => { + listHomeWorkflows.mockResolvedValue([UPSCALE, TALK]) + const wrapper = await openHome() + const next = wrapper.get('[data-testid="home-workflow-next"]') + const previous = wrapper.get('[data-testid="home-workflow-previous"]') + + expect(previous.attributes('disabled')).toBeDefined() + expect(next.attributes('disabled')).toBeUndefined() + + await next.trigger('click') + expect(cardAt(wrapper, 0).text()).toContain('Make your character talk') + expect(next.attributes('disabled')).toBeDefined() + expect(previous.attributes('disabled')).toBeUndefined() + + listHomeWorkflows.mockResolvedValue([UPSCALE]) + const single = await openHome() + expect(single.find('[data-testid="home-workflow-next"]').exists()).toBe(false) + expect(single.find('[data-testid="home-workflow-previous"]').exists()).toBe(false) + }) + + it('offers Open on the front card only, and opens that workflow from it', async () => { + listHomeWorkflows.mockResolvedValue(SEVEN_WORKFLOWS) + const wrapper = await openHome() + const ctas = wrapper.findAll('[data-testid="home-workflow-cta"]') + + expect(ctas).toHaveLength(1) + expect(cardAt(wrapper, 0).find('[data-testid="home-workflow-cta"]').text()).toBe('Open') + expect(ctas[0]!.attributes('aria-hidden')).toBe('true') + + await ctas[0]!.trigger('click') + + expect(openCatalogWorkflow).toHaveBeenCalledExactlyOnceWith('workflow-0') + }) + it('turns the carousel when it is dragged, and does not open the card the drag ends on', async () => { listHomeWorkflows.mockResolvedValue(SEVEN_WORKFLOWS) const wrapper = await openHome() diff --git a/src/renderer/src/panel/home/HomeWorkflowCarousel.vue b/src/renderer/src/panel/home/HomeWorkflowCarousel.vue index c4feb6761..cf3760c21 100644 --- a/src/renderer/src/panel/home/HomeWorkflowCarousel.vue +++ b/src/renderer/src/panel/home/HomeWorkflowCarousel.vue @@ -1,7 +1,7 @@ From 6bfc77243409c8b197a149feafa8ec621f5c676e Mon Sep 17 00:00:00 2001 From: Mariana Martinho Date: Thu, 12 Nov 2026 16:58:05 +0100 Subject: [PATCH 2/3] style(home): roomier hover on See all workflows and All builds Co-Authored-By: Claude Opus 5.5 --- src/renderer/src/panel/HomeView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/panel/HomeView.vue b/src/renderer/src/panel/HomeView.vue index 0eb40b52b..b36e6a365 100644 --- a/src/renderer/src/panel/HomeView.vue +++ b/src/renderer/src/panel/HomeView.vue @@ -19,7 +19,7 @@ type LoadState = 'loading' | 'ready' | 'unavailable' const HOME_BUILD_LIMIT = 3 const TEXT_LINK_CLASS = - 'h-6 gap-1.5 rounded-[7px] px-1.5 text-[13px]/5 font-medium text-muted-foreground hover:bg-secondary hover:text-foreground' + 'h-8 gap-1.5 rounded-lg px-3 text-[13px]/5 font-medium text-muted-foreground hover:bg-secondary hover:text-foreground' const emit = defineEmits<{ pick: [installation: Installation] @@ -159,7 +159,7 @@ onMounted(() => { type="button" variant="muted-textonly" size="unset" - :class="TEXT_LINK_CLASS" + :class="[TEXT_LINK_CLASS, '-my-1']" data-testid="home-all-builds" @click="emit('show-builds')" > From e93962f8288c43aee17675c3f5a76c8c6a293b12 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Thu, 12 Nov 2026 12:53:08 -0800 Subject: [PATCH 3/3] fix(home): keep keyboard focus on the carousel arrows and front card - When an arrow turns a short list to its end and becomes disabled, focus moves to the other arrow instead of falling to the page body. - Left/right keys now work from the arrow buttons too: the key handlers sit on the wrapper around the list and the arrows. - Turning with the keys while a card has focus moves focus to the new front card, so Open shows on it and focus never stays on a card that slid offstage. - The two arrows render from one list instead of two copied buttons. - "See all workflows" gets the same -my-1 as "All builds", so the taller hover area no longer pushes the Builds section down. --- src/renderer/src/panel/HomeView.test.ts | 31 ++++++++ src/renderer/src/panel/HomeView.vue | 4 +- .../src/panel/home/HomeWorkflowCarousel.vue | 76 ++++++++++++------- 3 files changed, 83 insertions(+), 28 deletions(-) diff --git a/src/renderer/src/panel/HomeView.test.ts b/src/renderer/src/panel/HomeView.test.ts index b58a31e00..887e03039 100644 --- a/src/renderer/src/panel/HomeView.test.ts +++ b/src/renderer/src/panel/HomeView.test.ts @@ -244,6 +244,37 @@ describe('Home example workflows', () => { expect(single.find('[data-testid="home-workflow-previous"]').exists()).toBe(false) }) + it('keeps keyboard focus on an arrow when the one in use reaches the end of a short list', async () => { + listHomeWorkflows.mockResolvedValue([UPSCALE, TALK]) + const wrapper = await openHome() + const next = wrapper.get('[data-testid="home-workflow-next"]') + const previous = wrapper.get('[data-testid="home-workflow-previous"]') + + next.element.focus() + await next.trigger('click') + await flushPromises() + + expect(next.element.disabled).toBe(true) + expect(document.activeElement).toBe(previous.element) + }) + + it('turns with the arrow keys from an arrow button and moves card focus to the new front card', async () => { + listHomeWorkflows.mockResolvedValue(SEVEN_WORKFLOWS) + const wrapper = await openHome() + + const next = wrapper.get('[data-testid="home-workflow-next"]') + await next.trigger('keydown', { key: 'ArrowRight' }) + expect(cardAt(wrapper, 0).text()).toContain('Workflow 1') + + const front = cardAt(wrapper, 0).element as HTMLButtonElement + front.focus() + await cardAt(wrapper, 0).trigger('keydown', { key: 'ArrowRight' }) + await flushPromises() + + expect(cardAt(wrapper, 0).text()).toContain('Workflow 2') + expect(document.activeElement).toBe(cardAt(wrapper, 0).element) + }) + it('offers Open on the front card only, and opens that workflow from it', async () => { listHomeWorkflows.mockResolvedValue(SEVEN_WORKFLOWS) const wrapper = await openHome() diff --git a/src/renderer/src/panel/HomeView.vue b/src/renderer/src/panel/HomeView.vue index b36e6a365..146487187 100644 --- a/src/renderer/src/panel/HomeView.vue +++ b/src/renderer/src/panel/HomeView.vue @@ -19,7 +19,7 @@ type LoadState = 'loading' | 'ready' | 'unavailable' const HOME_BUILD_LIMIT = 3 const TEXT_LINK_CLASS = - 'h-8 gap-1.5 rounded-lg px-3 text-[13px]/5 font-medium text-muted-foreground hover:bg-secondary hover:text-foreground' + '-my-1 h-8 gap-1.5 rounded-lg px-3 text-[13px]/5 font-medium text-muted-foreground hover:bg-secondary hover:text-foreground' const emit = defineEmits<{ pick: [installation: Installation] @@ -159,7 +159,7 @@ onMounted(() => { type="button" variant="muted-textonly" size="unset" - :class="[TEXT_LINK_CLASS, '-my-1']" + :class="TEXT_LINK_CLASS" data-testid="home-all-builds" @click="emit('show-builds')" > diff --git a/src/renderer/src/panel/home/HomeWorkflowCarousel.vue b/src/renderer/src/panel/home/HomeWorkflowCarousel.vue index cf3760c21..e397d6eb1 100644 --- a/src/renderer/src/panel/home/HomeWorkflowCarousel.vue +++ b/src/renderer/src/panel/home/HomeWorkflowCarousel.vue @@ -1,5 +1,5 @@