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
6 changes: 6 additions & 0 deletions frontend/taskdeck-web/src/locales/en/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ export default {
// name are for. `bodyPlaceholder` is a sentence and is capitalized;
// `labelsPlaceholder` is a fragment continuing the box and is not.
composer: {
eyebrow: 'Capture · Draft',
meta: 'local-only · saves to Inbox',
footerBefore: 'Captures land in ',
footerInbox: 'Inbox',
footerAfter: '. Linking to a board creates a proposal, not a card.',
submit: 'Capture',
bodyLabel: 'Body',
bodyAria: 'Body: write the text of this capture',
bodyPlaceholder: 'The thought, in plain language…',
Expand Down
6 changes: 6 additions & 0 deletions frontend/taskdeck-web/src/locales/es/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ export default {
// en mayúscula inicial a propósito; `labelsPlaceholder` es un fragmento que
// continúa el campo y va en minúscula.
composer: {
eyebrow: 'Captura · Borrador',
meta: 'solo local · se guarda en Inbox',
footerBefore: 'Las capturas llegan al ',
footerInbox: 'Inbox',
footerAfter: '. Vincularlas a un tablero crea una propuesta, no una tarjeta.',
submit: 'Capturar',
bodyLabel: 'Texto',
bodyAria: 'Texto: escribe el contenido de esta captura',
bodyPlaceholder: 'La idea, en lenguaje sencillo…',
Expand Down
6 changes: 6 additions & 0 deletions frontend/taskdeck-web/src/locales/it/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export default {
// per scelta; `labelsPlaceholder` è un frammento che prosegue il campo e resta
// in minuscolo.
composer: {
eyebrow: 'Cattura · Bozza',
meta: 'solo locale · salva nell’Inbox',
footerBefore: 'Le catture arrivano nell’',
footerInbox: 'Inbox',
footerAfter: '. Collegarle a una bacheca crea una proposta, non una scheda.',
submit: 'Cattura',
bodyLabel: 'Testo',
bodyAria: 'Testo: scrivi il contenuto di questa cattura',
bodyPlaceholder: 'Il pensiero, in parole semplici…',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,53 @@ describe('PaperCaptureComposer', () => {
}
}

function surfaceCopy(wrapper: ReturnType<typeof mount>) {
return {
eyebrow: wrapper.get('.paper-composer__header .tagstamp').text(),
meta: wrapper.get('.paper-composer__meta').text(),
footer: wrapper.get('.paper-composer__footer .tk-meta').text(),
submit: wrapper.get('.paper-composer__footer .phlbtn-label').text(),
}
}

it.each([
[
'en',
{
eyebrow: 'Capture · Draft',
meta: 'local-only · saves to Inbox',
footer: 'Captures land in Inbox. Linking to a board creates a proposal, not a card.',
submit: 'Capture',
},
],
[
'it',
{
eyebrow: 'Cattura · Bozza',
meta: 'solo locale · salva nell’Inbox',
footer: 'Le catture arrivano nell’Inbox. Collegarle a una bacheca crea una proposta, non una scheda.',
submit: 'Cattura',
},
],
[
'es',
{
eyebrow: 'Captura · Borrador',
meta: 'solo local · se guarda en Inbox',
footer: 'Las capturas llegan al Inbox. Vincularlas a un tablero crea una propuesta, no una tarjeta.',
submit: 'Capturar',
},
],
] as const)('renders the composer surface copy in %s', (locale, expected) => {
const previousLocale = i18n.global.locale.value
try {
i18n.global.locale.value = locale as SupportedLocale
expect(surfaceCopy(mount(PaperCaptureComposer))).toEqual(expected)
} finally {
i18n.global.locale.value = previousLocale
}
})

it('renders the field chrome in English on the default locale', () => {
const wrapper = mount(PaperCaptureComposer)
const chrome = fieldChrome(wrapper)
Expand Down Expand Up @@ -279,6 +326,32 @@ describe('PaperCaptureComposer', () => {
}
})

it('re-renders the composer surface copy when the locale switches after mount', async () => {
const previousLocale = i18n.global.locale.value
try {
i18n.global.locale.value = 'en' as SupportedLocale
const wrapper = mount(PaperCaptureComposer)
expect(surfaceCopy(wrapper)).toEqual({
eyebrow: 'Capture · Draft',
meta: 'local-only · saves to Inbox',
footer: 'Captures land in Inbox. Linking to a board creates a proposal, not a card.',
submit: 'Capture',
})

i18n.global.locale.value = 'it' as SupportedLocale
await nextTick()

expect(surfaceCopy(wrapper)).toEqual({
eyebrow: 'Cattura · Bozza',
meta: 'solo locale · salva nell’Inbox',
footer: 'Le catture arrivano nell’Inbox. Collegarle a una bacheca crea una proposta, non una scheda.',
submit: 'Cattura',
})
} finally {
i18n.global.locale.value = previousLocale
}
})

it('reflects label selections in the submit payload', async () => {
const wrapper = mount(PaperCaptureComposer)
const labelInput = wrapper.find('input[type="text"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@
<template>
<section class="paper-composer card-lift">
<header class="paper-composer__header">
<PaperTagstamp tone="ember">Capture · Draft</PaperTagstamp>
<span class="tk-meta paper-composer__meta">local-only · saves to inbox</span>
<PaperTagstamp tone="ember">{{ t('inbox.composer.eyebrow') }}</PaperTagstamp>
<span class="tk-meta paper-composer__meta">{{ t('inbox.composer.meta') }}</span>
</header>

<div class="paper-composer__body">
Expand Down Expand Up @@ -352,7 +352,7 @@
</ul>
</label>

<label class="paper-composer__label">

Check warning on line 355 in frontend/taskdeck-web/src/views/paper/inbox/PaperCaptureComposer.vue

View workflow job for this annotation

GitHub Actions / Frontend Unit / Frontend Unit (windows-latest)

Form label must have an associated control

Check warning on line 355 in frontend/taskdeck-web/src/views/paper/inbox/PaperCaptureComposer.vue

View workflow job for this annotation

GitHub Actions / Frontend Unit / Frontend Unit (ubuntu-latest)

Form label must have an associated control
<span class="tk-eyebrow">{{ t('inbox.composer.dueLabel') }}</span>
<TdDateField
v-model="dueAt"
Expand All @@ -367,10 +367,16 @@

<footer class="paper-composer__footer">
<span class="tk-meta">
Captures land in <span class="tk-ink-italic">Inbox</span>. Linking to a board creates a proposal, not a card.
{{ t('inbox.composer.footerBefore') }}<span class="tk-ink-italic">{{ t('inbox.composer.footerInbox') }}</span>{{ t('inbox.composer.footerAfter') }}
</span>
<span class="paper-composer__spacer" />
<PaperHLBtn label="Capture" kbd="mod+enter" variant="ember" :disabled="!canSubmit" @click="submit" />
<PaperHLBtn
:label="t('inbox.composer.submit')"
kbd="mod+enter"
variant="ember"
:disabled="!canSubmit"
@click="submit"
/>
</footer>
</section>
</template>
Expand Down
Loading