Repository navigation
feat(search): Find group chats by title with --type conversations - #104
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
doistbot
left a comment
There was a problem hiding this comment.
This PR adds a conversations type to tdc search so group chats can be found by title via the backend chat search, with per-command --type options keeping mentions limited to its existing choices, and conversation result URLs now optionally include a message ID. No inline issues were flagged — the change is well-scoped and consistent, with tests covering the option plumbing and URL building, and README, SKILL.md, and SKILL_CONTENT all updated in sync.
I also left one optional follow-up note in the details below.
Optional follow-up note (1)
src/commands/search.ts:34: Adding
conversationsto the search type routes conversation searches throughrunSearch, which always callsfilterVisibleSearchResults. Without--include-private-channels, that callsgetPublicChannelIds→client.channels.getChannels({ workspaceId })and builds aSet, then filters onitem.channelId. Conversation results have nochannelId, so this API call and Set build are wasted on everytdc search --type conversationsrun. Fetch the public channel IDs lazily (only whenresponse.items.some((item) => item.channelId)) or skip the visibility filter for the conversations type.
Co-Authored-By: Claude <noreply@anthropic.com>
doistbot
left a comment
There was a problem hiding this comment.
This PR adds a conversations search type so tdc search <word> --type conversations finds group chats by title via the backend's chat search (Doist/comms-backend#1148), instead of the local filtering approach used by conversation list --name. The change threads the new type through the shared search-option config while keeping mentions on its existing choices, updates the URL builder to link conversation hits (optionally deep-linking to a message), and makes the public-channel lookup lazy so it's skipped when no result has a channelId. Docs, SKILL.md, and SKILL_CONTENT are kept in sync, and tests cover the option plumbing, URL building, lazy channel filtering, and the mentions validation. No inline issues were flagged — nice, well-scoped work.
I also left one optional follow-up note in the details below.
Optional follow-up note (1)
src/commands/search.test.ts:213: This test only asserts that
getPublicChannelIdswas not called, so it verifies the lazy-lookup optimization but not the behavior that optimization exists to protect: a--type conversationsresult with nochannelIdmust still be emitted when--include-private-channelsis off. Capture the log fromcaptureConsole('log')and also assert the conversation title appears in the output (e.g.expect(log).toHaveBeenCalledWith(expect.stringContaining('Outcasts'))), so a future refactor that drops channel-less results fails this test.
Co-Authored-By: Claude <noreply@anthropic.com>
|
Waiting til the post-merge backfill mentioned in https://github.com/Doist/comms-backend/pull/1148 is complete. While it wouldn't error, it would also return 200 with no results except newly created or renamed chats, which might be confusing. |
rfgamaral
left a comment
There was a problem hiding this comment.
Looks good overall. I left a few small suggestions for your consideration, none of them blocking 👍
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
## [3.10.0](v3.9.1...v3.10.0) (2026-11-05) ### Features * **search:** Find group chats by title with --type conversations ([#104](#104)) ([6d47024](6d47024))
|
🎉 This PR is included in version 3.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Overview
This PR lets the CLI's
searchcommand find group chats by title with--type conversations, using the chat search from Doist/comms-backend#1148, where the logic is consistent across clients.A similar functionality already exists with
tdc conversation list --name, but that fetches every chat and filters locally.Reference
Test plan
npm ci && npm run build, thenexport COMMS_BASE_URL=https://comms.staging.todoist.com COMMS_API_TOKEN=<staging token>.curl -X POST https://comms.staging.todoist.com/api/v1/conversations/update -H "Authorization: Bearer $COMMS_API_TOKEN" -H "Content-Type: application/json" -d '{"id":"<chat id>","title":"<title>"}'.node dist/index.js search "<word>" --type conversations --workspace <staging workspace id>with a word from the title of a group chat you're in.[conversation], with a URL ending in/msg/<chat id>/.node dist/index.js search "<word>" --workspace <staging workspace id>with a word from a message in a conversation./msg/<chat id>/m/<message id>.node dist/index.js mentions --type conversations.Allowed choices are threads, messages, all.