Skip to content

feat: unify enterToApply and checkBoxFilterClickTrigger into autoApplyFilters#2313

Open
abdimo101 wants to merge 8 commits intomasterfrom
enter-to-apply
Open

feat: unify enterToApply and checkBoxFilterClickTrigger into autoApplyFilters#2313
abdimo101 wants to merge 8 commits intomasterfrom
enter-to-apply

Conversation

@abdimo101
Copy link
Copy Markdown
Member

@abdimo101 abdimo101 commented Apr 7, 2026

Description

This PR started by adding enterToApply config flag to support applying using Enter key with hints.

Then it was unified by merging enterToApply and checkBoxFilterClickTrigger into one config flag: autoApplyFilters.

Hint for search box:
image
Hint for Filters:
image

Motivation

Background on use case, changes needed

Fixes:

Please provide a list of the fixes implemented in this PR

  • Items added

Changes:

Please provide a list of the changes implemented by this PR

  • changes made

Tests included

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)

Documentation

  • swagger documentation updated [required]
  • official documentation updated [nice-to-have]

official documentation info

If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included

Backend version

  • Does it require a specific version of the backend
  • which version of the backend is required:

Summary by Sourcery

Add configurable support for applying filters and searches with the Enter key and surface UI hints where this behavior is available.

New Features:

  • Introduce an optional enterToApply frontend configuration flag to control Enter-key application for search and filter inputs.
  • Enable applying global text search, sidebar filters, and the search-parameters dialog via the Enter key when enterToApply is enabled.
  • Display inline "Enter to apply" hints on supported input labels and global search placeholders when Enter-to-apply is configured.

Enhancements:

  • Update datasets, samples, and files views so global and field search placeholders and actions align with the new Enter-to-apply behavior.
  • Adjust button semantics in the search-parameters dialog to avoid relying on form submit and instead trigger apply explicitly from clicks or Enter.

Tests:

  • Update Cypress datasets and samples tests to target the explicit "Apply" button by label and add coverage for adding a condition via the Enter key when enterToApply is enabled.

…g(condition), text/multiselect filters and search boxes
@abdimo101 abdimo101 requested a review from a team as a code owner April 7, 2026 15:11
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • There is an it.only in datasets-general.cy.js which will prevent the rest of the Cypress suite from running; this should be removed before merging.
  • The per-test configuration override and cy.intercept setup for enterToApply in the new dataset test could be moved into a beforeEach helper to avoid repetition if other tests need the same config flag.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- There is an `it.only` in `datasets-general.cy.js` which will prevent the rest of the Cypress suite from running; this should be removed before merging.
- The per-test configuration override and `cy.intercept` setup for `enterToApply` in the new dataset test could be moved into a `beforeEach` helper to avoid repetition if other tests need the same config flag.

## Individual Comments

### Comment 1
<location path="src/app/shared/modules/search-parameters-dialog/search-parameters-dialog.component.ts" line_range="151-157" />
<code_context>
     return this.humanNameMap[key] || "";
   }
+
+  onEnterToApply(event: Event) {
+    if (this.appConfig.enterToApply === false) {
+      return;
+    }
+    event.preventDefault();
+    this.add();
+  }
 }
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Treating `enterToApply` as true when undefined may cause unintended activation of the feature flag.

Because the guard only checks `=== false`, any `undefined` value (e.g. from older configs) will enable Enter-to-apply. If the feature should be opt‑in, consider inverting the condition (e.g. `if (!this.appConfig.enterToApply) return;`) or setting an explicit default for `enterToApply` in the config service so the intended behavior is clear.

```suggestion
  onEnterToApply(event: Event) {
    if (!this.appConfig.enterToApply) {
      return;
    }
    event.preventDefault();
    this.add();
  }
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

abdimo101 and others added 4 commits April 7, 2026 18:57
…ers-dialog.component.ts

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@abdimo101 abdimo101 changed the title feat: add enterToApply config option for applying using Enter key with hints feat: unify enterToApply and checkBoxFilterClickTrigger into autoApplyFilters Apr 8, 2026
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.

1 participant