Skip to content
Merged
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function onRenameKeydown(session: ChatSession, event: KeyboardEvent): void {
</p>

<section v-for="[key, label, items] in sections" :key class="mb-3">
<p class="my-0 px-2 py-1 text-xs font-medium text-muted-foreground">
<p class="my-0 px-2 py-1 text-xs text-muted-foreground">
{{ label }}
</p>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const assetDragActive = inject<Readonly<Ref<boolean>>>(
)

const duplicateIdClass =
'shrink-0 rounded-full bg-interface-menu-keybind-surface-default px-1 py-0.5 font-mono text-xs/4 font-medium text-base-foreground'
'shrink-0 rounded-full bg-interface-menu-keybind-surface-default px-1 py-0.5 font-mono text-xs/4 text-base-foreground'

const running = computed(() => streaming || submitting)

Expand Down
28 changes: 9 additions & 19 deletions src/workbench/extensions/agent/components/agent/EmptyState.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,15 @@ const promptIcons = [
<template>
<div class="flex h-full flex-col overflow-x-hidden overflow-y-auto px-4 py-8">
<div class="my-auto flex shrink-0 flex-col items-center gap-8 text-center">
<div class="flex flex-col items-center gap-4 pt-12">
<div
class="flex size-12 items-center justify-center rounded-xl border border-plum-600 bg-ink-700"
>
<span
class="icon-[comfy--comfy-c] size-6 text-brand-yellow drop-shadow-[0_0_12px_currentColor]"
aria-hidden="true"
/>
</div>
<div
class="flex max-w-sm flex-col items-center text-base/snug font-semibold tracking-tight text-base-foreground @min-[570px]:text-2xl/snug"
>
<p class="my-0">
{{ t('agent.greeting', { name: userName ?? t('agent.friend') }) }}
</p>
<p class="my-0">
{{ t('agent.greetingQuestion') }}
</p>
</div>
<div
class="flex max-w-sm flex-col items-center pt-12 text-base/snug font-semibold tracking-tight text-base-foreground @min-[570px]:text-2xl/snug"
>
<p class="my-0">
{{ t('agent.greeting', { name: userName ?? t('agent.friend') }) }}
</p>
<p class="my-0">
{{ t('agent.greetingQuestion') }}
</p>
</div>
<div
data-testid="suggested-prompts"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'

import '../../agentPanel.css'

import RunNoticeBanner from './RunNoticeBanner.vue'

const DISMISSED_STORAGE_KEY = 'Comfy.AgentPanel.runNoticeDismissed'

// The banner hides itself for good once dismissed, and the flag is shared
// localStorage rather than a prop. Clearing it per story keeps a dismissal in
// one story from blanking every later snapshot.
function withFreshDismissal() {
localStorage.removeItem(DISMISSED_STORAGE_KEY)
return {
template:
'<div class="agent-scope w-[388px] bg-secondary-background p-4"><story /></div>'
}
}

const meta: Meta<typeof RunNoticeBanner> = {
title: 'Agent/RunNoticeBanner',
component: RunNoticeBanner,
tags: ['autodocs'],
parameters: { layout: 'centered' },
globals: { theme: 'dark' },
decorators: [withFreshDismissal]
}

export default meta
type Story = StoryObj<typeof meta>

/** No target bound yet, so the generic run-permissions copy renders. */
export const Default: Story = {}

export const Expanded: Story = {
args: { expanded: true }
}

export const BoundToWorkflow: Story = {
args: { workflowName: 'portrait' }
}

/**
* The name is underlined inline, so a long one has to wrap inside the panel
* without pushing the dismiss button off the row.
*/
export const LongWorkflowName: Story = {
args: { workflowName: 'product-photo-upscale-with-face-restore-v3' }
}

// The left rule and the icon are the two neutral marks on the card, and both
// have to stay legible when base-background flips. Light covers the half that
// the dark-default stories above do not.
export const DefaultLight: Story = {
globals: { theme: 'light' }
}

export const BoundToWorkflowLight: Story = {
args: { workflowName: 'portrait' },
globals: { theme: 'light' }
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const dismissed = useStorage('Comfy.AgentPanel.runNoticeDismissed', false)
<div
v-if="!dismissed"
role="note"
class="relative flex items-start gap-2 overflow-hidden rounded-lg bg-base-background p-4 ring-1 ring-border-subtle before:absolute before:inset-y-0 before:left-0 before:w-1 before:bg-primary-background"
class="relative flex items-start gap-2 overflow-hidden rounded-lg bg-base-background p-4 ring-1 ring-border-subtle before:absolute before:inset-y-0 before:left-0 before:w-1 before:bg-muted-background"
>
<span
class="icon-[heroicons--information-circle-20-solid] size-5 shrink-0 text-primary-background"
class="icon-[heroicons--information-circle-20-solid] size-5 shrink-0 text-muted-foreground"
/>
<p class="my-0 min-w-0 flex-1 text-sm font-medium text-base-foreground">
<p class="my-0 min-w-0 flex-1 text-sm text-base-foreground">
<i18n-t v-if="workflowName" keypath="agent.workflowEditNotice" tag="span">
<template #workflow>
<span class="underline decoration-solid">{{ workflowName }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ const options: {
class="agent-scope z-1100 flex w-80 flex-col gap-2.5 rounded-lg border border-border-default bg-secondary-background p-2.5 text-base-foreground shadow-lg outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95"
>
<div class="flex flex-col gap-0.5">
<div
aria-hidden="true"
class="text-sm/5 font-medium text-base-foreground"
>
<div aria-hidden="true" class="text-sm/5 text-base-foreground">
{{ t('agent.runPermissions') }}
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
ref="selectorRoot"
class="flex w-full items-center justify-between gap-1.5"
>
<DropdownMenuRoot :open @update:open="onOpenChange">

Check failure on line 115 in src/workbench/extensions/agent/components/agent/composer/WorkflowSelectorChip.vue

View workflow job for this annotation

GitHub Actions / fallow

High complexity (high)

Function '<template>' exceeds both complexity thresholds: • Severity: high • Cyclomatic: 23 (threshold: 20) • Cognitive: 29 (threshold: 15) • Lines: 265 Consider splitting this function into smaller, focused functions.
<AccessibleTooltip
:label="workflowTooltipText"
side="top"
Expand Down Expand Up @@ -193,7 +193,7 @@
<div
v-if="section.label"
aria-hidden="true"
class="px-1.5 py-1 text-[11px]/4 font-medium text-muted-foreground"
class="px-1.5 py-1 text-[11px]/4 text-muted-foreground"
>
{{ section.label }}
</div>
Expand Down Expand Up @@ -251,7 +251,7 @@
>
<span
aria-hidden="true"
class="icon-[comfy--comfy-c] size-2.5 text-brand-yellow"
class="icon-[lucide--check] size-3.5"
/>
</DropdownMenuItemIndicator>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const showAddCredits = computed(
class="mt-0.5 icon-[lucide--gauge] size-5 shrink-0 text-destructive-background"
/>
<div class="min-w-0 flex-1 text-sm/5">
<p class="m-0 font-medium text-base-foreground">
<p class="m-0 text-base-foreground">
{{ $t('agent.paywall.title') }}
</p>
<p class="m-0 text-muted-foreground">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ watchDebounced(
class="flex items-center gap-1.5 font-mono text-xs text-muted-foreground"
>
<span class="icon-[lucide--file-code] size-3.5" />
<span class="font-medium text-base-foreground">{{ lang }}</span>
<span class="text-base-foreground">{{ lang }}</span>
</span>
<Button
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async function downloadAssets(): Promise<void> {
<DropdownMenuContent
align="end"
:side-offset="4"
class="z-1100 h-9 w-36 rounded-lg border border-border-subtle bg-secondary-background p-1 shadow-lg"
class="agent-scope z-1100 h-9 w-36 rounded-lg border border-border-subtle bg-secondary-background p-1 shadow-lg"
>
<DropdownMenuItem
class="flex h-7 w-full cursor-pointer items-center rounded-lg px-1.5 text-[14px]/5 font-normal whitespace-nowrap text-base-foreground outline-none data-highlighted:bg-secondary-background-hover"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ async function download(): Promise<void> {
/>
</Button>
<div class="flex min-w-0 flex-1 flex-col">
<span class="truncate text-sm/4 font-medium text-base-foreground">{{
title
}}</span>
<span class="truncate text-sm/4 text-base-foreground">{{ title }}</span>
<div class="flex h-6 items-center gap-4">
<span
class="text-xs whitespace-nowrap text-muted-foreground tabular-nums"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const workflowLabel = computed(
class="flex w-full flex-col gap-2 overflow-hidden rounded-lg border border-component-node-border bg-secondary-background p-4 shadow-interface"
>
<div class="flex min-w-0 flex-col gap-0.5 text-sm/5">
<p class="m-0 font-medium text-base-foreground">
<p class="m-0 text-base-foreground">
{{ t('agent.runApproval.lead') }}
</p>
<ul class="m-0 min-w-0 list-disc pl-5 text-muted-foreground">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ async function open(): Promise<void> {
data-testid="workflow-link-content"
class="flex min-w-0 flex-1 flex-col gap-0.5"
>
<span class="truncate text-sm/4 font-medium text-base-foreground">{{
label
}}</span>
<span class="truncate text-sm/4 text-base-foreground">{{ label }}</span>
<span
v-if="nodeCount !== undefined"
:id="nodeCountId"
Expand Down
Loading