Skip to content

[DREAM-703] FilterableTreeView does not keep default filter arguments - #474

Merged
HDinger merged 2 commits into
mainfrom
bug/dream-703-filterabletreeview-does-not-keep-default-filter-arguments
Jun 12, 2026
Merged

[DREAM-703] FilterableTreeView does not keep default filter arguments #474
HDinger merged 2 commits into
mainfrom
bug/dream-703-filterabletreeview-does-not-keep-default-filter-arguments

Conversation

@HDinger

@HDinger HDinger commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

What are you trying to accomplish?

Preserve defaults for filter_input_arguments

List the issues that this change affects.

https://community.openproject.org/wp/DREAM-703

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cabb7af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@openproject/primer-view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ Visual or ARIA snapshot differences found

Our visual and ARIA snapshot tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional.

Review differences

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

This PR fixes Primer::OpenProject::FilterableTreeView so callers can pass partial filter_input_arguments overrides without having to manually merge in DEFAULT_FILTER_INPUT_ARGUMENTS, preserving expected default attributes (e.g., type=search, name=filter).

Changes:

  • Change FilterableTreeView initializer to apply defaults via reverse_merge for filter_input_arguments (and for no_results_node_arguments as well).
  • Update the component test to assert defaults are still present when only overriding a subset of filter_input_arguments.
  • Simplify the preview example by removing explicit filter defaults that are now applied automatically.

Reviewed changes

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

File Description
app/components/primer/open_project/filterable_tree_view.rb Applies default arguments via reverse_merge so partial overrides keep expected defaults.
test/components/primer/open_project/filterable_tree_view_test.rb Updates test to validate partial override behavior while defaults remain intact.
previews/primer/open_project/filterable_tree_view_preview/custom_no_results_text.html.erb Removes redundant explicit defaults in the preview now that defaults are preserved in the component.
.changeset/fancy-groups-kiss.md Adds a patch changeset documenting the user-facing behavior fix.

@myabc myabc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! 👍🏻

nice to have: a simple (probably one-line) test for partial no_results_node_arguments merge.

@HDinger
HDinger merged commit 0d3f2b9 into main Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants