Skip to content
2 changes: 1 addition & 1 deletion src/components/dialog/confirm/ConfirmBody.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="flex flex-col px-4 py-2 text-sm text-muted-foreground border-t border-border-default"
class="flex flex-col break-words px-4 py-2 text-sm text-muted-foreground border-t border-border-default"
>
<p v-if="promptTextReal">
{{ promptTextReal }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/confirm/ConfirmFooter.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<section class="w-full flex gap-2 justify-end px-2 pb-2">
<section class="w-full flex flex-wrap gap-2 justify-end px-2 pb-2">
<Button :disabled variant="textonly" autofocus @click="$emit('cancel')">
{{ cancelTextX }}
</Button>
Expand Down
48 changes: 48 additions & 0 deletions src/components/dialog/content/ConfirmationDialogContent.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { mount } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
import PrimeVue from 'primevue/config'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { createI18n } from 'vue-i18n'

import ConfirmationDialogContent from './ConfirmationDialogContent.vue'

const i18n = createI18n({
legacy: false,
locale: 'en',
messages: { en: {} },
missingWarn: false,
fallbackWarn: false
})

describe('ConfirmationDialogContent', () => {
beforeEach(() => {
setActivePinia(createPinia())
})

function mountComponent(props = {}) {
return mount(ConfirmationDialogContent, {
global: {
plugins: [PrimeVue, i18n]
},
props: {
message: 'Test message',
type: 'default' as const,
onConfirm: vi.fn(),
...props
}
})
}

it('renders long messages without breaking layout', () => {
const longFilename =
'workflow_checkpoint_' + 'a'.repeat(200) + '.safetensors'
const wrapper = mountComponent({ message: longFilename })
expect(wrapper.text()).toContain(longFilename)
})

it('uses flex-wrap on button container for narrow viewports', () => {
const wrapper = mountComponent()
const buttonRow = wrapper.find('.flex.flex-wrap.justify-end.gap-4')
expect(buttonRow.exists()).toBe(true)
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not necessary test

})
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
>
{{ hint }}
</Message>
<div class="flex justify-end gap-4">
<div class="flex flex-wrap justify-end gap-4">
<div
v-if="type === 'overwriteBlueprint'"
class="flex justify-start gap-4"
Expand Down Expand Up @@ -132,5 +132,6 @@ const onConfirm = () => {
<style lang="css" scoped>
.prompt-dialog-content {
white-space: pre-wrap;
overflow-wrap: break-word;
}
</style>