Skip to content

Add column key filtering to cards and saved filters#2787

Open
robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos:cards-column-keys-filter
Open

Add column key filtering to cards and saved filters#2787
robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos:cards-column-keys-filter

Conversation

@robzolkos
Copy link
Copy Markdown
Contributor

Summary

This adds column_keys[] filtering to cards so CLI clients and other API consumers can fetch cards in a specific column or pseudo-column without downloading all cards and filtering client-side, which is inefficient. It also carries that support through saved filters so equivalent filters are normalized consistently, deduplicated correctly, and summarized clearly when reused or displayed.

What changed

  • add column_keys as a supported filter param
  • support workflow column IDs plus special keys:
    • maybe
    • not_now
    • done
  • OR multiple column_keys[] together while keeping other filters combined with AND
  • normalize common aliases like:
    • maybe? / triagemaybe
    • not-now / notnownot_now
    • closed / closedone
  • include column selections in filter summaries
  • normalize saved-filter params so aliased and reordered column_keys resolve to the same saved filter
  • document the new API behavior
  • add model and controller coverage for column-key filtering behavior

Copilot AI review requested due to automatic review settings April 2, 2026 21:36
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds column_keys[] filtering support to cards, enabling CLI clients and API consumers to fetch cards from specific workflow columns or pseudo-columns (maybe, not_now, done) without downloading all cards client-side. The feature includes:

Changes:

  • Add column_keys[] as a supported query parameter with support for workflow column IDs and pseudo-column aliases
  • Normalize common aliases (e.g., maybe?maybe, not-nownot_now, closeddone)
  • OR multiple column_keys together while keeping other filters combined with AND
  • Include column selections in filter summaries
  • Normalize saved-filter parameters to ensure aliased and reordered column_keys resolve to equivalent filters
  • Document the new API parameter and behavior
  • Add comprehensive test coverage for model and controller behavior

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/models/filter/fields.rb Added COLUMN_KEY_ALIASES mapping and normalize_column_key() class method; added column_keys store accessor with getter/setter for normalization
app/models/filter/params.rb Extended PERMITTED_PARAMS to include column_keys; added normalize_param() to handle column key normalization with sorting/deduplication for filter equivalence
app/models/filter.rb Added filter_by_column_keys() method to handle ORing of column key filters; updated include_closed_cards?() and include_not_now_cards?() to account for column key filters
app/models/filter/summarized.rb Added SPECIAL_COLUMN_NAMES mapping and column_summary() method; added workflow_column_names_by_id() to fetch column names for display in filter summaries
docs/API.md Documented new column_keys[] query parameter with supported values and examples
test/models/filter_test.rb Added tests for column key filtering, normalization, aliasing, and filter equivalence
test/controllers/cards_controller_test.rb Added integration tests for JSON API column key filtering

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants