Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 0 additions & 213 deletions src/components/button/IconTextButton.stories.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/components/button/IconTextButton.vue

This file was deleted.

28 changes: 12 additions & 16 deletions src/components/button/MoreButton.stories.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'

import IconTextButton from './IconTextButton.vue'
import Button from '@/components/ui/button/Button.vue'
import MoreButton from './MoreButton.vue'

const meta: Meta<typeof MoreButton> = {
Expand All @@ -17,30 +17,26 @@ type Story = StoryObj<typeof MoreButton>

export const Basic: Story = {
render: () => ({
components: { MoreButton, IconTextButton },
components: { MoreButton, Button },
template: `
<div style="height: 200px; display: flex; align-items: center; justify-content: center;">
<MoreButton>
<template #default="{ close }">
<IconTextButton
type="transparent"
label="Settings"
<Button
variant="textonly"
@click="() => { close() }"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Simplify click handlers.

The arrow function wrappers are unnecessary since close is already a function. You can pass it directly.

🔎 Proposed simplification
-              @click="() => { close() }"
+              @click="close"

Apply the same change on both lines 27 and 35.

Also applies to: 35-35

🤖 Prompt for AI Agents
In src/components/button/MoreButton.stories.ts around lines 27 and 35, the
@click handlers wrap the existing close function in unnecessary arrow functions;
remove the wrapper and pass close directly (i.e., change @click="() => { close()
}" to @click="close") on both lines to simplify the handlers.

>
<template #icon>
<i class="icon-[lucide--download] size-4" />
</template>
</IconTextButton>
<i class="icon-[lucide--download] size-4" />
<span>Settings</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider using i18n for string literals.

While this is a Storybook story for demonstration, the coding guidelines specify using vue-i18n for all UI strings in src/components/**/*.{vue,ts,js}. Using i18n in stories can serve as a best-practice example and maintain consistency with the guidelines.

As per coding guidelines, all UI strings should use i18n translation keys.

Also applies to: 38-38

🤖 Prompt for AI Agents
In src/components/button/MoreButton.stories.ts around lines 30 and 38, the story
uses raw string literals ("Settings" and another at line 38); replace these with
vue-i18n translation keys: add appropriate keys to your locale file (e.g.
components.moreButton.settings) and update the story to use the i18n translation
function (e.g. this.$t or t('components.moreButton.settings')) or register the
i18n plugin in the storybook preview/decorator so the story renders translated
text; ensure keys are added to locales and the story imports/uses the i18n
instance instead of hard-coded strings.

</Button>

<IconTextButton
type="transparent"
label="Profile"
<Button
variant="textonly"
@click="() => { close() }"
>
<template #icon>
<i class="icon-[lucide--scroll-text] size-4" />
</template>
</IconTextButton>
<i class="icon-[lucide--scroll-text] size-4" />
<span>Profile</span>
</Button>
</template>
</MoreButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@

<template #header-right-area>
<div class="flex gap-2">
<IconTextButton
<Button
v-if="filteredCount !== totalCount"
type="secondary"
:label="$t('templateWorkflows.resetFilters', 'Clear Filters')"
variant="secondary"
size="lg"
@click="resetFilters"
>
<template #icon>
<i class="icon-[lucide--filter-x]" />
</template>
</IconTextButton>
<i class="icon-[lucide--filter-x]" />
<span>{{
$t('templateWorkflows.resetFilters', 'Clear Filters')
}}</span>
</Button>
</div>
</template>

Expand Down Expand Up @@ -382,7 +383,6 @@ import ProgressSpinner from 'primevue/progressspinner'
import { computed, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'

import IconTextButton from '@/components/button/IconTextButton.vue'
import CardBottom from '@/components/card/CardBottom.vue'
import CardContainer from '@/components/card/CardContainer.vue'
import CardTop from '@/components/card/CardTop.vue'
Expand Down
14 changes: 5 additions & 9 deletions src/components/dialog/content/MissingNodesFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
v-if="isCloud"
class="flex w-full items-center justify-between gap-2 py-2 px-4"
>
<IconTextButton
:label="$t('missingNodes.cloud.learnMore')"
type="transparent"
<Button
variant="textonly"
size="sm"
icon-position="left"
as="a"
href="https://www.comfy.org/cloud"
target="_blank"
rel="noopener noreferrer"
>
<template #icon>
<i class="icon-[lucide--info]"></i>
</template>
</IconTextButton>
<i class="icon-[lucide--info]"></i>
<span>{{ $t('missingNodes.cloud.learnMore') }}</span>
</Button>
<Button variant="secondary" size="md" @click="handleGotItClick">{{
$t('missingNodes.cloud.gotIt')
}}</Button>
Expand Down Expand Up @@ -50,7 +47,6 @@
import { computed, nextTick, watch } from 'vue'
import { useI18n } from 'vue-i18n'

import IconTextButton from '@/components/button/IconTextButton.vue'
import Button from '@/components/ui/button/Button.vue'
import { isCloud } from '@/platform/distribution/types'
import { useToastStore } from '@/platform/updates/common/toastStore'
Expand Down
Loading
Loading