From 6ef9b7847b4315f572a8b2228a6c53133133a0fd Mon Sep 17 00:00:00 2001 From: "vercel[bot]" <35613825+vercel[bot]@users.noreply.github.com> Date: Sun, 22 Nov 2026 19:52:31 +0000 Subject: [PATCH 1/2] fix(cli): hint at # when read finds no channel by that name --- .changeset/read-id-as-channel.md | 5 +++++ packages/board/src/cli/main.ts | 4 ++++ packages/board/test/cli.test.ts | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 .changeset/read-id-as-channel.md diff --git a/.changeset/read-id-as-channel.md b/.changeset/read-id-as-channel.md new file mode 100644 index 000000000..1e3000ff4 --- /dev/null +++ b/.changeset/read-id-as-channel.md @@ -0,0 +1,5 @@ +--- +'@vercel/board': patch +--- + +`vb read ` on a name that's no channel's and close to none, like a message ID that doesn't go bare, now says that `#` reads it as a message's thread, and offers that command. diff --git a/packages/board/src/cli/main.ts b/packages/board/src/cli/main.ts index 174035a2e..1dd7fdf0f 100644 --- a/packages/board/src/cli/main.ts +++ b/packages/board/src/cli/main.ts @@ -1548,15 +1548,19 @@ async function run(command: string | undefined, args: string[]): Promise const channels = (await everyChannel(board)).map((c) => c.path) if (!channels.some((path) => path === target || path.startsWith(target.replace(/\/?$/, '/')))) { const guess = closest(target, channels) + // A name like no channel's, under none, may be a message's ID that doesn't go bare: `#` reads its thread. + const id = !guess && !target.includes('/') throw new Failed({ class: 'not_found', reason: 'channel_not_found', message: `Couldn't find channel ${target}.${guess ? ` Did you mean ${guess}?` : ''}`, details: [ 'A channel appears with its first post: one nobody has posted in yet is not there to read.', + ...(id ? [`If ${target} is a message's ID, #${target} reads its thread.`] : []), ...(teamDefault ? [`This is ${teamDefault.team ?? 'the team'}'s default board: --name reads another of its boards.`] : []), ], next: [ + ...(id ? [{ instruction: 'Read it as a message', argv: [...cli(), 'read', `#${target}`] }] : []), { instruction: 'See its channels', argv: [...cli(), 'channels', ...(teamDefault?.team !== undefined ? ['--scope', teamDefault.team] : [])] }, ...(teamDefault ? [{ instruction: "Read it on another of the team's boards", argv: rerun('--name', '') }] : []), ], diff --git a/packages/board/test/cli.test.ts b/packages/board/test/cli.test.ts index a4938844b..9f3cd7868 100644 --- a/packages/board/test/cli.test.ts +++ b/packages/board/test/cli.test.ts @@ -641,6 +641,12 @@ describe('cli', () => { // A typo'd channel is an error, not an empty read; an empty read in a real channel isn't. expect(await vb(['read', 'open-wrok'])).toMatchObject({ code: 1, stdout: '', stderr: expect.stringMatching(/^error: Couldn't find channel open-wrok\. Did you mean open-work\?\n/) }) + // A name like no channel's may be a message's ID that doesn't go bare: the error says how to read it as one. + const opaque = await vb(['read', '5d08b9af-5b45-465b-bb43-3b24e540ed95']) + expect(opaque).toMatchObject({ code: 1, stdout: '' }) + expect(opaque.stderr).toContain("If 5d08b9af-5b45-465b-bb43-3b24e540ed95 is a message's ID, #5d08b9af-5b45-465b-bb43-3b24e540ed95 reads its thread.") + expect(opaque.stderr).toContain("vb read '#5d08b9af-5b45-465b-bb43-3b24e540ed95'") + expect((await vb(['read', 'open-wrok'])).stderr).not.toContain("is a message's ID") expect(await vb(['read', 'open-work', '--text', 'nothing like this'])).toMatchObject({ code: 0, stdout: expect.stringMatching(/^open-work · 0 threads · cursor \d+\n\nnew since then: vb read open-work --text 'nothing like this' --after \d+\n$/) }) expect(await vb(['read', 'open-work', '--messages'])).toMatchObject({ code: 2 }) }) From 8d5a3665d365d1324c0d5e00880ecc2ca7c0658b Mon Sep 17 00:00:00 2001 From: "vercel[bot]" <35613825+vercel[bot]@users.noreply.github.com> Date: Sun, 22 Nov 2026 20:11:59 +0000 Subject: [PATCH 2/2] fix(cli): offer # only for names that look like an ID --- .changeset/read-id-as-channel.md | 2 +- packages/board/src/cli/main.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.changeset/read-id-as-channel.md b/.changeset/read-id-as-channel.md index 1e3000ff4..2c3e30e2d 100644 --- a/.changeset/read-id-as-channel.md +++ b/.changeset/read-id-as-channel.md @@ -2,4 +2,4 @@ '@vercel/board': patch --- -`vb read ` on a name that's no channel's and close to none, like a message ID that doesn't go bare, now says that `#` reads it as a message's thread, and offers that command. +`vb read ` on a long name with a digit that's no channel's and close to none, like a message ID that doesn't go bare, now says that `#` reads it as a message's thread, and offers that command. diff --git a/packages/board/src/cli/main.ts b/packages/board/src/cli/main.ts index 1dd7fdf0f..a53142b55 100644 --- a/packages/board/src/cli/main.ts +++ b/packages/board/src/cli/main.ts @@ -1548,8 +1548,9 @@ async function run(command: string | undefined, args: string[]): Promise const channels = (await everyChannel(board)).map((c) => c.path) if (!channels.some((path) => path === target || path.startsWith(target.replace(/\/?$/, '/')))) { const guess = closest(target, channels) - // A name like no channel's, under none, may be a message's ID that doesn't go bare: `#` reads its thread. - const id = !guess && !target.includes('/') + // A long name with a digit, like no channel's and under none, may be a message's ID that doesn't go bare: + // `#` reads its thread. A short one is a typo. + const id = !guess && /^[\w-]{16,}$/.test(target) && /\d/.test(target) throw new Failed({ class: 'not_found', reason: 'channel_not_found',