From cc956476bd3cfd095a9e6c164559d221b5f10303 Mon Sep 17 00:00:00 2001 From: McCal-Codes <175259256+McCal-Codes@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:12:02 -0400 Subject: [PATCH] Mr Folio's /roadmap reads the releases still being built, not just the titled lists --- tools/folio-bot/commands.mjs | 3 ++- tools/folio-bot/commands.test.mjs | 13 ++++++++++--- tools/folio-bot/sources.mjs | 16 +++++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/tools/folio-bot/commands.mjs b/tools/folio-bot/commands.mjs index de98e830..a402a795 100644 --- a/tools/folio-bot/commands.mjs +++ b/tools/folio-bot/commands.mjs @@ -119,8 +119,9 @@ export const handlers = { async roadmap(options, sources) { const sections = (await sources.roadmap()).filter((section) => !section.shipped) + // "Next" is the releases still being built, each with its own version; Later and Exploring are lists with a title. const wanted = options.when - ? sections.filter((section) => section.name.toLowerCase() === options.when) + ? sections.filter((section) => options.when === 'next' ? section.release : section.name.toLowerCase() === options.when) : sections if (!wanted.length) return `Nothing under ${options.when}. Try next, later or exploring.` const blocks = wanted.map((section) => { diff --git a/tools/folio-bot/commands.test.mjs b/tools/folio-bot/commands.test.mjs index bb40a4ca..4296f753 100644 --- a/tools/folio-bot/commands.test.mjs +++ b/tools/folio-bot/commands.test.mjs @@ -17,8 +17,8 @@ const sources = { { version: '0.6.5', date: '2026-09-20', body: '### Fixed\n- **A crash:** gone.' }, ], roadmap: async () => [ - { name: 'Folio 0.6.6', shipped: true, items: [{ title: 'Market', detail: 'Shipped.', status: 'done' }] }, - { name: 'Next', shipped: false, items: [{ title: 'Language in Settings', detail: 'Pick it yourself.', status: 'planned' }] }, + { name: 'Folio 0.6.6', release: true, shipped: true, items: [{ title: 'Market', detail: 'Shipped.', status: 'done' }] }, + { name: 'Folio 0.6.9 (Foundation)', release: true, shipped: false, items: [{ title: 'Language in Settings', detail: 'Pick it yourself.', status: 'planned' }] }, { name: 'Later', shipped: false, items: [{ title: 'Dock Drawer', detail: 'Swipe in on the dock.', status: 'planned' }] }, ], tweaks: async () => [ @@ -76,11 +76,18 @@ test('an unknown version is a helpful answer, not an error', async () => { test('roadmap leaves out what has already shipped', async () => { const answer = await run('roadmap', {}, sources) - assert.match(answer, /\*\*Next\*\*/) + assert.match(answer, /\*\*Folio 0\.6\.9 \(Foundation\)\*\*/) assert.match(answer, /\*\*Later\*\*/) assert.doesNotMatch(answer, /Folio 0\.6\.6/) }) +test('roadmap next is the releases still being built', async () => { + const answer = await run('roadmap', { when: 'next' }, sources) + assert.match(answer, /Language in Settings/) + assert.doesNotMatch(answer, /Dock Drawer/) + assert.doesNotMatch(answer, /Folio 0\.6\.6/) +}) + test('roadmap narrows to one section', async () => { const answer = await run('roadmap', { when: 'later' }, sources) assert.match(answer, /Dock Drawer/) diff --git a/tools/folio-bot/sources.mjs b/tools/folio-bot/sources.mjs index 4a2e1a1a..c7c7a0c7 100644 --- a/tools/folio-bot/sources.mjs +++ b/tools/folio-bot/sources.mjs @@ -49,11 +49,17 @@ export const sources = { async roadmap() { const file = await get(`${RAW}/app/src/main/assets/roadmap.json`, { json: true }) - return (file.sections ?? []).map((section) => ({ - name: section.release ? `Folio ${section.release}` : section.title, - shipped: Boolean(section.release), - items: (section.items ?? []).map(({ title, detail, status }) => ({ title, detail, status })), - })) + // A section with a version is a release. It is shipped only once every item in it is done: the current release + // and the ones after it have items still building or planned, and those are what the roadmap is about. + return (file.sections ?? []).map((section) => { + const items = (section.items ?? []).map(({ title, detail, status }) => ({ title, detail, status })) + return { + name: section.release ? `Folio ${section.release}${section.subtitle ? ` (${section.subtitle})` : ''}` : section.title, + release: Boolean(section.release), + shipped: Boolean(section.release) && items.length > 0 && items.every((item) => item.status === 'done'), + items, + } + }) }, async tweaks() {