Release: dev → main (first public release) #258
@@ -20,7 +20,7 @@
|
|||||||
class="fc-post-card__synthetic" :title="synthesisTitle"
|
class="fc-post-card__synthetic" :title="synthesisTitle"
|
||||||
>
|
>
|
||||||
<v-icon icon="mdi-auto-fix" size="x-small" start />
|
<v-icon icon="mdi-auto-fix" size="x-small" start />
|
||||||
grouped by FabledCurator
|
{{ synthesisChip }}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
<RouterLink
|
<RouterLink
|
||||||
:to="{ name: 'artist', params: { slug: post.artist.slug } }"
|
:to="{ name: 'artist', params: { slug: post.artist.slug } }"
|
||||||
@@ -270,11 +270,18 @@ const plainTitle = computed(() => toPlainText(props.post.post_title))
|
|||||||
// post dict by hand, must degrade to "not synthetic" rather than throw.
|
// post dict by hand, must degrade to "not synthetic" rather than throw.
|
||||||
const synthesized = computed(() => Boolean(props.post.synthesized_by))
|
const synthesized = computed(() => Boolean(props.post.synthesized_by))
|
||||||
const messageCount = computed(() => props.post.synthesis?.message_count ?? 0)
|
const messageCount = computed(() => props.post.synthesis?.message_count ?? 0)
|
||||||
|
// A drop of one message stays a synthetic post (teaser matching only looks at
|
||||||
|
// drops), but there is nothing grouped in it — #4390: "Grouped from 1 Discord
|
||||||
|
// message" described a wrapper, not a grouping. Say what it is instead.
|
||||||
const synthesisTitle = computed(() => {
|
const synthesisTitle = computed(() => {
|
||||||
const n = messageCount.value
|
const n = messageCount.value
|
||||||
if (!n) return 'Grouped from Discord'
|
if (!n) return 'Grouped from Discord'
|
||||||
return `Grouped from ${n} Discord message${n === 1 ? '' : 's'}`
|
if (n === 1) return 'Discord message'
|
||||||
|
return `Grouped from ${n} Discord messages`
|
||||||
})
|
})
|
||||||
|
const synthesisChip = computed(() =>
|
||||||
|
messageCount.value === 1 ? 'from Discord' : 'grouped by FabledCurator'
|
||||||
|
)
|
||||||
|
|
||||||
const hero = computed(() => images.value[0])
|
const hero = computed(() => images.value[0])
|
||||||
|
|
||||||
|
|||||||
@@ -149,13 +149,16 @@ describe('PostCard', () => {
|
|||||||
expect(w.find('.fc-post-card__assoc').exists()).toBe(false)
|
expect(w.find('.fc-post-card__assoc').exists()).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('singularises a one-message drop', () => {
|
it('does not call a one-message drop a grouping (#4390)', () => {
|
||||||
const w = mountComponent(PostCard, {
|
const w = mountComponent(PostCard, {
|
||||||
props: { post: { ...SYNTH, synthesis: { message_count: 1 } } },
|
props: { post: { ...SYNTH, synthesis: { message_count: 1 } } },
|
||||||
pinia: freshPinia(),
|
pinia: freshPinia(),
|
||||||
})
|
})
|
||||||
expect(w.text()).toContain('Grouped from 1 Discord message')
|
expect(w.text()).toContain('Discord message')
|
||||||
expect(w.text()).not.toContain('1 Discord messages')
|
expect(w.text()).not.toContain('Grouped from')
|
||||||
|
// The marker stays — FC still wrote this post — but names the source.
|
||||||
|
expect(w.find('.fc-post-card__synthetic').text()).toContain('from Discord')
|
||||||
|
expect(w.text()).not.toContain('grouped by FabledCurator')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user