feat(im): add --chat-modes filter to chat search#1317
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new ChangesChat Modes Filtering for IM Chat Search
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1317 +/- ##
==========================================
+ Coverage 70.33% 71.15% +0.82%
==========================================
Files 672 685 +13
Lines 65322 65785 +463
==========================================
+ Hits 45941 46808 +867
+ Misses 15728 15326 -402
+ Partials 3653 3651 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@05f46d782de49b9c25729ac7228369535d0c1f4d🧩 Skill updatenpx skills add shifengjuan-dev/lark-cli#feat/chat-search-chat-mode-filter -y -g |
Add a server-side --chat-modes filter to the im +chat-search shortcut so
users can restrict results to regular groups and/or topic groups. The CLI
exposes group/topic and maps them to the wire values default/thread in
filter.chat_modes (deduped, order preserved). Validation rejects any value
outside {group, topic}.
Change-Id: Ia59c2c05fb2e8e45bd741c8531ca0e3ca69de2f3
58aa2ec to
05f46d7
Compare
Rebased onto main v1.0.54, which added IM content after this branch forked. Fold main's new facts into the slimmed/gotcha-only form and fix drift: - SKILL.md: compact the newly-merged chat.user_setting / chat.managers / chat.moderation API resources to the api_compact `action`(identity) form (consistent with the rest; regen-equivalent), and note the opt-in `--download-resources` flag on the three message-pulling shortcuts. - chat-search: fix stale `--sort-by` -> `--sort`, add `--chat-modes`, and fold the "`--sort` is always descending" caution (#1302/#1317). - chat-messages-list: note `--order` is the only sort axis (no field sort). - messages-send: split @mention by message type; interactive cards are not normalized and need card-native `<at>` syntax (#1419). - flag-cancel: document best-effort double-cancel (feed layer skipped with a stderr warning when chat type is undeterminable). - feed-group-list-item / query-item: p2p cards omit chat_name; resolve via chats/batch_query -> p2p_target_id -> contact lookup. - message-enrichment: add the `--download-resources` contract (merge_forward container-id 234003 trap, fail-silent isolation, no extra scope) (#1245). Docs only; no Go/--help/Desc changes.
What
Adds a server-side
--chat-modesfilter to theim +chat-searchshortcut so users can restrict results to regular groups and/or topic groups.Details
--chat-modes(comma-separated). The CLI exposesgroup/topic(consistent with+chat-create --chat-mode) and maps them to the v2 search wire valuesdefault/threadinfilter.chat_modes— deduped, order preserved.{group, topic}, mirroring the existing--search-typescheck, and runs before the page-size check.filterobject is still omitted entirely when no filter flags are set; no interaction with the client-side--exclude-mutedfilter.Verification
go test ./shortcuts/im/,go vet,go build ./...all pass (TDD: tests written red-first).--chat-modes groupreturns onlyDEFAULTchats,--chat-modes topicreturns onlyTHREADchats.Note: the v2 search response reports
chat_modeas uppercaseDEFAULT/THREAD; output rendering is left as-is (pre-existing behavior) and intentionally out of scope here.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
--chat-modesflag to chat search, letting users restrict results to group or topic chats using comma-separated values.Behavior Changes
--chat-modesand reports errors for invalid values.Documentation
--chat-modes.Tests