Ask Petal answers in both languages, with room to read
The tutor prompt said "never mix languages in a single response" and mirrored the language of the question, so asking in English — which she does, because she is practising — returned the one explanation surface that gives nothing in her own language. It now answers in both, pair language first, halves separated by a blank line. Which half is the safety net and which is the lesson depends on who is writing: the pair is (English + X) and Petal is used from both ends, so the prompt asks for both and says it doesn't know which way round. The split is a rendering nicety, never a parse the reply depends on: a half-streamed reply is all one half, a model that ignores the instruction renders as one block, and nothing is ever dropped. For the height, the first attempt clamped the box to the room left below the anchored card so it could never overhang — measured, that gave 176px against a 442px answer, worse than the 220px it replaced. The card's own chrome spends ~290px of an 810px window, so "fits below the word" and "room to read" are not both available. The ceiling is now a flat 50vh and the overhang is made navigable instead, per item 4: the card reports its reach like the rail already does, the column grows, and the page can scroll to the actions below it.
This commit is contained in:
@@ -164,6 +164,22 @@ describe('the zh pack', () => {
|
||||
if (p.code === 'pt-PT') expect(p.locale).toBe('pt-PT') // never pt-BR
|
||||
})
|
||||
|
||||
// The chat-failure line is the only message the Ask Petal panel writes without
|
||||
// the model, and it renders through the same bilingual bubble as a real reply
|
||||
// (splitBilingual, blank line between the halves). A pack that writes it as
|
||||
// one language gets a bubble with a muted empty half — and, worse, tells the
|
||||
// half of the pair that can't read that language nothing at all.
|
||||
it.each(PACKS)('says the chat-failure line in both halves of the pair ($code)', async (p) => {
|
||||
const { splitBilingual } = await import('../components/Editor/bilingualReply')
|
||||
const { native, en } = splitBilingual(p.editor.chatFailed)
|
||||
expect(native, `${p.code} chatFailed has no pair-language half`).not.toBe('')
|
||||
expect(en, `${p.code} chatFailed has no English half`).not.toBe('')
|
||||
// The English half is the one every reader of every pack shares, so it is
|
||||
// the one worth pinning: a pack that translated it has lost the point.
|
||||
expect(en).toMatch(/ask me again/i)
|
||||
expect(native).not.toBe(en)
|
||||
})
|
||||
|
||||
it.each(PACKS)('labels every companion, tone and style ($code)', async (p) => {
|
||||
const { COMPANIONS } = await import('../components/Companion/companions')
|
||||
for (const c of COMPANIONS) {
|
||||
|
||||
Reference in New Issue
Block a user