Skip to content

feat(cli): add kind filter to select sessions or tools#341

Open
S1M0N38 wants to merge 1 commit into
folke:mainfrom
S1M0N38:feat/filter-kind
Open

feat(cli): add kind filter to select sessions or tools#341
S1M0N38 wants to merge 1 commit into
folke:mainfrom
S1M0N38:feat/filter-kind

Conversation

@S1M0N38

@S1M0N38 S1M0N38 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Add kind ("session" | "tool") to sidekick.cli.Filter so users can build pickers restricted to running sessions or available tools. No existing filter field can express this: the sole discriminator is session ~= nil, untestable with the strict == match (nil ~= false), and every proxy breaks for mux backends where terminal == nil on both kinds. Pure filter -- one clause in state.is, no change to row generation.

Related Issue(s)

Closes #340.

Copilot AI review requested due to automatic review settings July 16, 2026 07:48
@github-actions github-actions Bot added the size/xs Extra small PR (<3 lines changed) label Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a kind discriminator to the CLI filtering layer so sidekick.cli.select() pickers can be restricted to either running sessions or available tools, addressing the limitation described in #340.

Changes:

  • Extends sidekick.cli.Filter with kind?: "session" | "tool".
  • Implements kind matching in sidekick.cli.state.is() based on whether t.session is present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/sidekick/cli/state.lua Outdated
and (filter.cwd == nil or (t.session and t.session.cwd == Session.cwd()))
and (filter.external == nil or filter.external == t.external)
and (filter.installed == nil or filter.installed == t.installed)
and (filter.kind == nil or (filter.kind == "session") == (t.session ~= nil))
Add `kind` ("session" | "tool") to sidekick.cli.Filter so users can build pickers restricted to running sessions or available tools. No existing filter field can express this: the sole discriminator is `session ~= nil`, untestable with the strict `==` match (nil ~= false), and every proxy breaks for mux backends where `terminal == nil` on both kinds. Pure filter -- one clause in state.is, no change to row generation.

Closes folke#340.
@S1M0N38
S1M0N38 force-pushed the feat/filter-kind branch from 0ed9c33 to 68260ab Compare July 16, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs Extra small PR (<3 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: add kind filter to select sessions or tools in cli.select

2 participants