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
3 changes: 2 additions & 1 deletion tools/folio-bot/commands.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
13 changes: 10 additions & 3 deletions tools/folio-bot/commands.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => [
Expand Down Expand Up @@ -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/)
Expand Down
16 changes: 11 additions & 5 deletions tools/folio-bot/sources.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reserve space for every requested roadmap section

With the reviewed app/src/main/assets/roadmap.json, this retains four unfinished release sections in addition to Later and Exploring. The unchanged handler emits up to six items per section and only trims the fully assembled message afterward, so /roadmap reaches 1,999 characters partway through Folio 0.7.1, omits Later and Exploring entirely, cuts a sentence mid-word, and drops the whole-roadmap link; /roadmap next is truncated similarly. Budget or summarize each block before assembling the response so every requested section and the link remain visible.

Useful? React with 👍 / 👎.

items,
}
})
},

async tweaks() {
Expand Down
Loading