Your team of AI agents, on your Mac, Windows or Linux. Agents that talk in channels, write code, review each other and use your tools, on the Claude Code, Codex, OpenCode or Pi you already have. Anything that touches the real world waits for your yes.
TypeScript agent-teamagentic-aiai-agentsai-assistantclaude-codecodexcursorelectrongrokgrok-bot-alternativelinuxlocal-firstmacosmcpmulti-agentopenclaw-alternativeopencodewindows
Show what's new once after an update, in the app's language (#127)
Eduardo Machado9282fb70b191
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5fa36b3..f56efa9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,18 @@ What changed in each version of Tucano. The format follows [Keep a Changelog](ht## [Unreleased]+> **Em português:**+> - **Novidades na tela.** Depois de uma atualização, o Tucano mostra uma vez o que entrou na versão, no idioma do app.+> - **As respostas voltam pra conversa.** Os agentes respondem logo abaixo da mensagem, como num chat. Quem prefere threads liga nas configurações do canal, que abrem clicando no nome dele no topo.+> - **Respostas do Claude mais rápidas.** Terminam uns 2 segundos antes, às vezes 10.+> - **Conectores ficam conectados.** Uma conexão que cai volta sozinha, e um resultado longo chega inteiro ao agente.+> - **Docker desligado é avisado na hora.** O agente para na primeira tentativa e diz o que fazer, em vez de tentar ferramenta por ferramenta.+> - **Uma thread abre na mensagem mais recente**, como no Slack.++### Added++- **What's new, after an update.** The first time Tucano opens on a new version, a window in the middle of the screen shows what came in, in the app's language, once. Skipping versions shows the ones skipped too, up to three, and **See the full notes** opens the release page. A new install doesn't show it.+### Changed- **Answers come in the conversation again, and threads are a choice of each conversation.** Since 0.2.10 every message opened a thread with its answers. Now a channel or a DM answers in the conversation, like a chat, unless its settings say **In threads, one per message**: then each message opens a thread with its answers, as before. The settings open from the conversation's name at its top or from its menu in the sidebar, and hold a channel's name and topic too; a new channel asks where its agents answer. A thread you open by hand, with a message's reply button, works either way, and the threads you already have stay as they are. An answer in the conversation reads the conversation and the message that opened each thread; what was said inside a thread it looks up when it needs it, as it does from another thread.@@ -18,7 +30,17 @@ What changed in each version of Tucano. The format follows [Keep a Changelog](ht## [0.2.10] - 2026-11-04-> **Em português:** chegaram as threads: cada resposta a uma mensagem, e o que ela dispara, fica na thread dela, que abre na lateral. Na conversa aparecem só as mensagens que abriram uma thread, com quem participou, quantas respostas e o que espera por você. E um "bom dia" pro grupo agora chama todos os agentes. Também dá pra ditar mensagens: clique no microfone, fale e clique de novo, e o texto cai no campo pra você revisar. Tudo roda no seu computador, sem internet, e o modelo baixa com um clique. Os canais podem ser arrastados e organizados em grupos que recolhem, e um caminho de arquivo na mensagem de um agente vira link. O token de um conector pode ser trocado sem remover o conector. Os erros agora dizem o que aconteceu e o que fazer. E uma leva de correções: os agentes no Gemini passam a ler as configurações do Tucano, o modelo reserva entra no limite de 5 horas do Claude Code, as rotinas mandam a resposta inteira pro Telegram e, no Windows, o Tucano não trava mais a atualização de outros apps. Obrigado à Rayanne, ao Gabriel, ao Alan, ao Cleiton e ao Kayo!+> **Em português:**+> - **Threads.** Cada resposta a uma mensagem, e o que ela dispara, fica na thread dela, que abre na lateral. Na conversa aparecem só as mensagens que abriram uma thread, com quem participou, quantas respostas e o que espera por você.+> - **Um "bom dia" chama todo mundo.** Uma mensagem pro grupo chama todos os agentes do canal.+> - **Ditado.** Clique no microfone, fale e clique de novo, e o texto cai no campo pra você revisar. Tudo roda no seu computador, sem internet, e o modelo baixa com um clique.+> - **Canais em grupos.** Os canais podem ser arrastados e organizados em grupos que recolhem.+> - **Caminhos de arquivo viram link** na mensagem de um agente.+> - **Token de conector.** Dá pra trocar o token sem remover o conector.+> - **Erros mais claros.** Dizem o que aconteceu e o que fazer.+> - **Correções.** Os agentes no Gemini passam a ler as configurações do Tucano, o modelo reserva entra no limite de 5 horas do Claude Code, as rotinas mandam a resposta inteira pro Telegram e, no Windows, o Tucano não trava mais a atualização de outros apps.+>+> Obrigado à Rayanne, ao Gabriel, ao Alan, ao Cleiton e ao Kayo!### Added@@ -44,7 +66,12 @@ What changed in each version of Tucano. The format follows [Keep a Changelog](ht## [0.2.9] - 2026-11-03-> **Em português:** o Tucano agora tem uma wiki: o que você e o seu time sabem, em páginas ligadas, que os agentes consultam antes de responder e citam. Um curador lê as conversas e os documentos que você traz (PDF, Word, planilha, link ou anotação) e escreve nas páginas, citando de onde veio; mudar uma página que já existe espera a sua aprovação, se você quiser. A wiki é uma pasta de Markdown que o Obsidian abre, aparece como um mapa que você arrasta, e uma revisão aponta o que não bate, o que ficou velho e o que está repetido. Já tem um cofre do Obsidian? Ele entra como está, com pastas, links e anexos. E dá pra trazer agentes do OpenBot e do Grok Bot.+> **Em português:**+> - **Wiki.** O que você e o seu time sabem, em páginas ligadas, que os agentes consultam antes de responder e citam.+> - **Curador.** Lê as conversas e os documentos que você traz (PDF, Word, planilha, link ou anotação) e escreve nas páginas, citando de onde veio. Mudar uma página que já existe espera a sua aprovação, se você quiser.+> - **Mapa e revisão.** A wiki aparece como um mapa que você arrasta, e uma revisão aponta o que não bate, o que ficou velho e o que está repetido.+> - **Obsidian.** A wiki é uma pasta de Markdown que o Obsidian abre, e um cofre que você já tem entra como está, com pastas, links e anexos.+> - **Agentes do OpenBot e do Grok Bot** podem ser trazidos pro Tucano.### Addeddiff --git a/src/core/index.ts b/src/core/index.tsindex e30aeb7..b0eec6b 100644--- a/src/core/index.ts+++ b/src/core/index.ts@@ -75,6 +75,8 @@ setLang(langOf(process.env['TUCANO_LOCALE']))if (db.created) {if (process.env['TUCANO_SEED'] === '1' || (fake && process.env['TUCANO_SEED'] !== '0')) seed(db)else db.setSettings({ onboarding: { done: false } })+ // A new install has nothing new to show: the news start with the next update.+ if (process.env['TUCANO_VERSION']) db.setSettings({ seenVersion: process.env['TUCANO_VERSION'] })}const interrupted = db.interruptStaleRuns()if (interrupted) console.log(`[core] ${interrupted} run(s) marked as interrupted`)diff --git a/src/main/index.ts b/src/main/index.tsindex 6aa3b67..bacf151 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -57,7 +57,7 @@ const localKey = randomBytes(32).toString('hex')function startCore(): UtilityProcess {const child = utilityProcess.fork(join(import.meta.dirname, 'core.js'), [], {serviceName: 'tucano-core',- env: { ...process.env, TUCANO_DATA: dataDir(), TUCANO_PACKAGED: app.isPackaged ? '1' : '0', TUCANO_WHISPER: whisperDir(), TUCANO_LOCAL_KEY: localKey, TUCANO_LOCALE: systemLocale ?? '' }+ env: { ...process.env, TUCANO_DATA: dataDir(), TUCANO_PACKAGED: app.isPackaged ? '1' : '0', TUCANO_VERSION: app.getVersion(), TUCANO_WHISPER: whisperDir(), TUCANO_LOCAL_KEY: localKey, TUCANO_LOCALE: systemLocale ?? '' }})child.on('message', (msg: CoreRequest) => handleCore(child, msg))child.on('exit', (code) => {diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsxindex 84e50db..5dae967 100644--- a/src/renderer/src/App.tsx+++ b/src/renderer/src/App.tsx@@ -13,6 +13,7 @@ import { SkillsPage } from './components/Skills'import { ReportPage } from './components/Report'import { Onboarding } from './components/Onboarding'import { Dialogs } from './components/Dialogs'+import { WhatsNew } from './components/Update'import { CoreDown, Toasts } from './components/Toast'import { Icon } from './components/ui'@@ -105,6 +106,7 @@ export function App(): ReactNode {{view.kind === 'settings' && <SettingsPage />}</main><Dialogs />+ <WhatsNew /><Lightbox /><Toasts /><CoreDown />diff --git a/src/renderer/src/components/Dialogs.tsx b/src/renderer/src/components/Dialogs.tsxindex f925f95..5a48c70 100644--- a/src/renderer/src/components/Dialogs.tsx+++ b/src/renderer/src/components/Dialogs.tsx@@ -167,7 +167,8 @@ function SettingsDialog({ conv, onClose }: { conv?: Conversation; onClose: () =>const openModals: object[] = []const FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'-function Modal({ title, onClose, children }: { title: string; onClose: () => void; children: ReactNode }): ReactNode {+// `className`: a card of another size (the news after an update).+export function Modal({ title, onClose, children, className }: { title: string; onClose: () => void; children: ReactNode; className?: string }): ReactNode {const card = useRef<HTMLDivElement>(null)const close = useRef(onClose)close.current = onClose@@ -201,7 +202,7 @@ function Modal({ title, onClose, children }: { title: string; onClose: () => voi}, [])return (<div className="modal" onMouseDown={(e) => e.target === e.currentTarget && onClose()}>- <div className="modal__card" role="dialog" aria-modal="true" aria-label={title} ref={card}>+ <div className={`modal__card ${className ?? ''}`} role="dialog" aria-modal="true" aria-label={title} ref={card}><header className="modal__head"><strong>{title}</strong><button className="icon-btn icon-btn--sm" title={L('Fechar', 'Close')} onClick={onClose}>diff --git a/src/renderer/src/components/Update.tsx b/src/renderer/src/components/Update.tsxindex 1a3e597..25a3581 100644--- a/src/renderer/src/components/Update.tsx+++ b/src/renderer/src/components/Update.tsx@@ -1,9 +1,13 @@-// A newer Tucano: a note at the foot of the sidebar once it's downloaded, and the-// state in Settings. The main process looks and downloads (src/main/updates.ts).-import { useSyncExternalStore, type ReactNode } from 'react'-import { L } from '../../../shared/lang'+// A newer Tucano: a note at the foot of the sidebar once it's downloaded, the state in+// Settings, and what's new once it's running. The main process looks and downloads (src/main/updates.ts).+import { useEffect, useMemo, useState, useSyncExternalStore, type ReactNode } from 'react'+import Markdown from 'react-markdown'+import changelog from '../../../../CHANGELOG.md?raw'+import { L, lang, locale } from '../../../shared/lang'+import { newsSince, type PtSummary, type ReleaseNotes } from '../../../shared/release-notes'import type { UpdateState } from '../../../shared/types'-import { useStore } from '../store'+import { updateSettings, useStore } from '../store'+import { Modal } from './Dialogs'import { ago } from './ui'const RELEASES = 'https://github.com/eduwxyz/tucano/releases'@@ -121,3 +125,98 @@ export function UpdateSettings(): ReactNode {</div>)}++const KINDS = (): Record<string, string> => ({ Added: L('Novidades', 'New'), Changed: L('O que mudou', 'Changed'), Fixed: L('Correções', 'Fixed'), Removed: L('Saiu', 'Removed'), Security: L('Segurança', 'Security') })++const day = (date?: string): string => (date ? new Date(`${date}T12:00:00`).toLocaleDateString(locale(), { day: 'numeric', month: 'long' }) : '')++// One version's news: in Portuguese, its summary; in English (or with no summary), the first+// sentence of each item. The full notes are on GitHub.+function Release({ r, titled }: { r: ReleaseNotes; titled: boolean }): ReactNode {+ return (+ <section className="whats-new__release">+ {titled && (+ <h3>+ {r.version} <span className="muted">· {day(r.date)}</span>+ </h3>+ )}+ {lang() === 'pt' && r.pt ? (+ <Summary pt={r.pt} />+ ) : (+ r.sections+ .filter((s) => s.items.length)+ .map((s) => (+ <div key={s.kind}>+ <h4>{KINDS()[s.kind] ?? s.kind}</h4>+ <ul>+ {s.items.map((item, i) => (+ <li key={i}>+ <Markdown allowedElements={['strong', 'em', 'code', 'p']} unwrapDisallowed>+ {item}+ </Markdown>+ </li>+ ))}+ </ul>+ </div>+ ))+ )}+ </section>+ )+}++// The Portuguese summary as written: its topics as a list, the text around them as text.+function Summary({ pt }: { pt: PtSummary }): ReactNode {+ const inline = (md: string): ReactNode => (+ <Markdown allowedElements={['strong', 'em', 'code', 'p']} unwrapDisallowed>+ {md}+ </Markdown>+ )+ return (+ <>+ {pt.intro && <p>{inline(pt.intro)}</p>}+ {pt.points.length > 0 && (+ <ul>+ {pt.points.map((p, i) => (+ <li key={i}>{inline(p)}</li>+ ))}+ </ul>+ )}+ {pt.outro && <p className="muted whats-new__thanks">{inline(pt.outro)}</p>}+ </>+ )+}++// After an update, once: what came in since the version I last saw (a new install saw its own).+export function WhatsNew(): ReactNode {+ const version = useUpdate()?.version+ const seen = useStore((s) => s.settings.seenVersion)+ const news = useMemo(() => (version && seen !== version ? newsSince(changelog, version, seen) : []), [version, seen])+ const [closed, setClosed] = useState(false)+ // A version with nothing written (or an older one, after going back): seen, quietly.+ useEffect(() => {+ if (version && seen !== version && news.length === 0) updateSettings({ seenVersion: version })+ }, [version, seen, news.length])+ if (!version || closed || news.length === 0) return null+ const close = (): void => {+ setClosed(true)+ updateSettings({ seenVersion: version })+ }+ return (+ <Modal title={L(`Novidades do Tucano ${version}`, `What’s new in Tucano ${version}`)} onClose={close} className="whats-new">+ <div className="whats-new__body">+ {news.map((r) => (+ <Release key={r.version} r={r} titled={news.length > 1} />+ ))}+ </div>+ <footer className="modal__foot">+ <a className="link" href={notes(version)} target="_blank" rel="noreferrer">+ {L('Ver as notas completas', 'See the full notes')}+ </a>+ <span className="grow" />+ <button className="btn btn--primary btn--sm" autoFocus onClick={close}>+ {L('Entendi', 'Got it')}+ </button>+ </footer>+ </Modal>+ )+}diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.cssindex 7b24c1f..6658be1 100644--- a/src/renderer/src/styles.css+++ b/src/renderer/src/styles.css@@ -4815,6 +4815,42 @@ table.csv th {.modal__lead {margin: 0 0 12px;}+/* What's new after an update: wider, and the notes scroll while the buttons stay. */+.modal__card.whats-new {+ width: min(560px, calc(100vw - 32px));+}+.whats-new__body {+ display: grid;+ gap: 16px;+ min-height: 0;+ overflow-y: auto;+ font-size: 13.5px;+ line-height: 1.55;+}+.whats-new__body p {+ margin: 0;+}+.whats-new__release h3 {+ margin: 0 0 6px;+ font-size: 13px;+}+.whats-new__release h4 {+ margin: 10px 0 4px;+ font-size: 12px;+ font-weight: 600;+ color: var(--text-2);+ text-transform: uppercase;+ letter-spacing: 0.04em;+}+.whats-new__release ul {+ margin: 0;+ padding-left: 18px;+ display: grid;+ gap: 5px;+}+.whats-new__thanks {+ margin-top: 10px !important;+}.modal__foot {display: flex;align-items: center;diff --git a/src/shared/release-notes.ts b/src/shared/release-notes.tsnew file mode 100644index 0000000..57d78b1--- /dev/null+++ b/src/shared/release-notes.ts@@ -0,0 +1,98 @@+// What's new in a version, read from CHANGELOG.md: the Portuguese summary at the top of its+// section and, in English, the first sentence of each of its items, without the links to PRs+// and the thanks (the full notes are a link away).+//+// The summary is a list, a topic per item, written as such:+// > **Em português:**+// > - **Threads.** Cada resposta…+// >+// > Obrigado à Rayanne!+// What isn't in the list is text before it (`intro`; an older summary is all intro) or after it (`outro`).++export interface PtSummary {+ intro?: string+ points: string[]+ outro?: string+}++export interface ReleaseNotes {+ version: string+ date?: string+ pt?: PtSummary+ sections: { kind: string; items: string[] }[] // "Added", "Changed", "Fixed"…+}++const MAX_ITEM = 240++// The lines of the "> **Em português:**" quote, without the "> ".+export function parsePt(lines: string[]): PtSummary | undefined {+ const points: string[] = []+ const before: string[] = []+ const after: string[] = []+ let inTopic = false // inside a topic: an indented line goes on with it, a blank line ends the list+ for (const raw of lines) {+ const line = raw.replace(/^\*\*Em português:\*\*\s*/, '').trim()+ if (/^[-*] /.test(line)) (points.push(line.slice(2).trim()), (inTopic = true))+ else if (!line) inTopic = false+ else if (inTopic && /^\s/.test(raw)) points[points.length - 1] += ` ${line}`+ else (points.length ? after : before).push(line)+ }+ const text = (ls: string[]): string | undefined => {+ const t = ls.join(' ').trim()+ return t ? t.charAt(0).toUpperCase() + t.slice(1) : undefined+ }+ const [intro, outro] = [text(before), text(after)]+ if (!intro && !outro && points.length === 0) return undefined+ return { ...(intro ? { intro } : {}), points, ...(outro ? { outro } : {}) }+}++// 1 when a is newer than b, -1 when older, 0 the same. Plain x.y.z: a pre-release suffix is ignored.+export function compareVersions(a: string, b: string): number {+ const parts = (v: string): number[] => v.replace(/^v/, '').split(/[.-]/).slice(0, 3).map((n) => Number.parseInt(n, 10) || 0)+ const [x, y] = [parts(a), parts(b)]+ for (let i = 0; i < 3; i++) if ((x[i] ?? 0) !== (y[i] ?? 0)) return (x[i] ?? 0) > (y[i] ?? 0) ? 1 : -1+ return 0+}++// "**Threads.** Every answer … ([#101](…)). Thanks [@x](…)!" → "**Threads.** Every answer …"+export function shortItem(item: string): string {+ const clean = item+ .replace(/\s*\((\[#\d+\]\([^)]*\)(,\s*)?)+\)/g, '') // ([#101](…), [#99](…))+ .replace(/\s*Thanks? [^.!]*\[@[^\]]+\]\([^)]*\)[^.!]*[.!]/g, '') // Thanks [@rayanneblima](…)!+ .trim()+ const lead = /^\*\*[^*]+\*\*/.exec(clean)?.[0] ?? ''+ const rest = clean.slice(lead.length)+ const end = /[.!?](?=\s|$)/.exec(rest)+ let text = lead + (end ? rest.slice(0, end.index + 1) : rest)+ if (text.length > MAX_ITEM) text = `${text.slice(0, text.lastIndexOf(' ', MAX_ITEM))}…`+ return text.trim()+}++export function parseChangelog(changelog: string): ReleaseNotes[] {+ const out: ReleaseNotes[] = []+ for (const chunk of changelog.split(/^## \[/m).slice(1)) {+ const [head = '', ...lines] = chunk.split('\n')+ const m = /^(\d+\.\d+\.\d+[^\]]*)\](?:\s*-\s*(\S+))?/.exec(head)+ if (!m) continue // [Unreleased]+ const notes: ReleaseNotes = { version: m[1]!, ...(m[2] ? { date: m[2] } : {}), sections: [] }+ const quote: string[] = []+ for (const line of lines) {+ if (/^\[[^\]]+\]: /.test(line)) break // the links at the end of the file+ if (line.startsWith('>')) quote.push(line.replace(/^>\s?/, ''))+ else if (line.startsWith('### ')) notes.sections.push({ kind: line.slice(4).trim(), items: [] })+ else if (line.startsWith('- ') && notes.sections.length) notes.sections.at(-1)!.items.push(shortItem(line.slice(2)))+ }+ const pt = parsePt(quote)+ if (pt) notes.pt = pt+ out.push(notes)+ }+ return out+}++// The versions after `seen` up to the one running (`current`), newest first: three at most.+// Without `seen`, only the one running.+export function newsSince(changelog: string, current: string, seen?: string): ReleaseNotes[] {+ return parseChangelog(changelog)+ .filter((r) => compareVersions(r.version, current) <= 0 && (seen ? compareVersions(r.version, seen) > 0 : compareVersions(r.version, current) === 0))+ .slice(0, 3)+}diff --git a/src/shared/types.ts b/src/shared/types.tsindex e1355be..5ef4d0e 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -270,6 +270,7 @@ export interface Settings {onboarding?: { done: boolean; checklistHidden?: boolean }folded?: string[] // the ids of what I folded in the sidebarsounds?: boolean // the toucan's chirp on a notification; unset: on+ seenVersion?: string // the last version whose news I closed; an update past it shows what's new onceaccounts?: Account[] // more logins of Claude Code or Codex, beside the one each already has}diff --git a/test/release-notes.test.ts b/test/release-notes.test.tsnew file mode 100644index 0000000..06593ff--- /dev/null+++ b/test/release-notes.test.ts@@ -0,0 +1,101 @@+import { readFileSync } from 'node:fs'+import { describe, expect, it } from 'vitest'+import { compareVersions, newsSince, parseChangelog, parsePt, shortItem } from '../src/shared/release-notes'++const changelog = readFileSync(new URL('../CHANGELOG.md', import.meta.url), 'utf8')++const sample = `# Changelog++## [Unreleased]++### Fixed++- **Not out yet.** Still on main.++## [0.3.1] - 2026-12-02++> **Em português:**+> - **Uma correção.** Funciona agora.+> Com mais detalhe.+>+> Obrigado à Ana!++### Fixed++- **A fix.** It works now. More detail here.++## [0.3.0] - 2026-12-01++> **Em português:** novidades grandes.++### Added++- **Something new.** It does a thing. Thanks [@ana](https://github.com/ana)! ([#7](https://github.com/x/y/pull/7), [#8](https://github.com/x/y/pull/8))+ - A detail that stays in the full notes.++### Changed++- The **old way** changed: now it's like this.++## [0.2.0] - 2026-11-01++### Added++- **Old.** From before.++[0.3.1]: https://github.com/x/y/releases/tag/v0.3.1+`++describe('release notes', () => {+ it('reads each version: its Portuguese summary and the first sentence of each item, without links or thanks', () => {+ const [latest, previous, old] = parseChangelog(sample)+ expect(latest).toEqual({+ version: '0.3.1',+ date: '2026-12-02',+ pt: { points: ['**Uma correção.** Funciona agora. Com mais detalhe.'], outro: 'Obrigado à Ana!' },+ sections: [{ kind: 'Fixed', items: ['**A fix.** It works now.'] }]+ })+ expect(previous!.pt).toEqual({ intro: 'Novidades grandes.', points: [] }) // an older summary, a paragraph: shown whole+ expect(previous!.sections).toEqual([+ { kind: 'Added', items: ['**Something new.** It does a thing.'] },+ { kind: 'Changed', items: ["The **old way** changed: now it's like this."] }+ ])+ expect(old!.pt).toBeUndefined()+ })++ it('shows what came after the version seen, up to the one running; without one seen, the one running only', () => {+ expect(newsSince(sample, '0.3.1', '0.2.0').map((r) => r.version)).toEqual(['0.3.1', '0.3.0'])+ expect(newsSince(sample, '0.3.0', '0.2.0').map((r) => r.version)).toEqual(['0.3.0']) // 0.3.1 isn't running yet+ expect(newsSince(sample, '0.3.1').map((r) => r.version)).toEqual(['0.3.1'])+ expect(newsSince(sample, '0.3.1', '0.3.1')).toEqual([])+ expect(newsSince(sample, '0.9.0')).toEqual([]) // a version with no section: nothing to show+ })++ it('takes the Portuguese topics as written: never splits a paragraph into sentences', () => {+ expect(parsePt(['**Em português:** chegaram as threads. Na conversa aparecem as que abriram uma.'])).toEqual({ intro: 'Chegaram as threads. Na conversa aparecem as que abriram uma.', points: [] })+ expect(parsePt(['**Em português:**', 'Nesta versão:', '- **A.** Um.', '- **B.** Dois.'])).toEqual({ intro: 'Nesta versão:', points: ['**A.** Um.', '**B.** Dois.'] })+ expect(parsePt(['**Em português:**'])).toBeUndefined()+ })++ it('compares versions by number, not as text', () => {+ expect(compareVersions('0.2.10', '0.2.9')).toBe(1)+ expect(compareVersions('v0.2.9', '0.2.10')).toBe(-1)+ expect(compareVersions('1.0.0', '1.0.0')).toBe(0)+ })++ it('cuts a long first sentence on a word', () => {+ const long = shortItem(`**Lead.** ${'word '.repeat(80)}end.`)+ expect(long.length).toBeLessThanOrEqual(241)+ expect(long.endsWith('…')).toBe(true)+ })++ it('every released version in CHANGELOG.md has something to show', () => {+ const all = parseChangelog(changelog)+ expect(all.length).toBeGreaterThan(10)+ for (const r of all) expect(r.sections.some((s) => s.items.length > 0), r.version).toBe(true)+ const latest = all.find((r) => r.version === '0.2.10')!.pt!+ expect(latest.points[0]).toMatch(/^\*\*Threads\.\*\* Cada resposta/)+ expect(latest.points.at(-1)).toMatch(/^\*\*Correções\.\*\*/)+ expect(latest.outro).toMatch(/^Obrigado à Rayanne/)+ })+})