Add column key filtering to cards and saved filters#2787
Open
robzolkos wants to merge 1 commit intobasecamp:mainfrom
Open
Add column key filtering to cards and saved filters#2787robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos wants to merge 1 commit intobasecamp:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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-now→not_now,closed→done) - OR multiple
column_keystogether while keeping other filters combined with AND - Include column selections in filter summaries
- Normalize saved-filter parameters to ensure aliased and reordered
column_keysresolve 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
column_keysas a supported filter parammaybenot_nowdonecolumn_keys[]together while keeping other filters combined with ANDmaybe?/triage→maybenot-now/notnow→not_nowclosed/close→donecolumn_keysresolve to the same saved filter