Skip to content

Add workflow column filtering to cards#2787

Merged
flavorjones merged 1 commit intobasecamp:mainfrom
robzolkos:cards-column-keys-filter
Apr 14, 2026
Merged

Add workflow column filtering to cards#2787
flavorjones merged 1 commit intobasecamp:mainfrom
robzolkos:cards-column-keys-filter

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Apr 2, 2026

Summary

This adds column_ids[] filtering to GET /:account_slug/cards so API clients can ask the cards endpoint for cards in one or more workflow columns.

What wasn't possible before

Before this change, clients could:

  • list cards from GET /:account_slug/cards and filter by board, tag, assignee, creator, search terms, etc.
  • list cards from a single workflow column via GET /:account_slug/boards/:board_id/columns/:column_id/cards

But they could not ask the global cards endpoint for cards in specific workflow columns.

That meant clients wanting workflow-column filtering through /cards had to either:

  • fetch a broader /cards result set and filter by column_id client-side, or
  • switch to the board-scoped column endpoint, which is a different path shape and doesn't combine as cleanly with the general /cards filtering interface.

What this PR adds

  • support column_ids[] on GET /:account_slug/cards
  • apply column_ids[] when building the cards query
  • document the new API behavior
  • add model and controller coverage

Examples

  • GET /:account_slug/cards?column_ids[]=03f...
  • GET /:account_slug/cards?board_ids[]=...&column_ids[]=03f...
  • GET /:account_slug/cards?column_ids[]=03f...&column_ids[]=03g...

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.

@robzolkos robzolkos force-pushed the cards-column-keys-filter branch from acd6ed4 to 66ed6ea Compare April 6, 2026 21:15
@robzolkos robzolkos requested a review from flavorjones April 8, 2026 17:57
Copilot AI review requested due to automatic review settings April 9, 2026 20:15
@robzolkos robzolkos force-pushed the cards-column-keys-filter branch from 66ed6ea to 5a3dcbe Compare April 9, 2026 20:15
@robzolkos robzolkos force-pushed the cards-column-keys-filter branch from 5a3dcbe to 64cfa6a Compare April 9, 2026 20:47
@robzolkos robzolkos changed the title Add column key filtering to cards and saved filters Add workflow column filtering to cards and saved filters Apr 9, 2026
@robzolkos robzolkos force-pushed the cards-column-keys-filter branch 2 times, most recently from f10f670 to 2a42280 Compare April 9, 2026 21:13
@robzolkos robzolkos changed the title Add workflow column filtering to cards and saved filters Add workflow column filtering to cards Apr 9, 2026
@robzolkos robzolkos force-pushed the cards-column-keys-filter branch from 2a42280 to 3c5bfa3 Compare April 9, 2026 21:17
@robzolkos robzolkos force-pushed the cards-column-keys-filter branch from 3c5bfa3 to 1066622 Compare April 9, 2026 21:18
@robzolkos robzolkos requested a review from flavorjones April 9, 2026 21:21
@flavorjones flavorjones merged commit bb54b85 into basecamp:main Apr 14, 2026
6 checks passed
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.

3 participants