Skip to content

Conversation

@emmanuel-ferdman
Copy link
Contributor

@emmanuel-ferdman emmanuel-ferdman commented Jan 21, 2026

PR Summary

Fixes #15108

Motivation

When filtering workflows by name in the UI, new workflows arriving via the watch stream appear in the list even if they don't match the filter. The list stays correct on page load but gets polluted as workflows are created/updated.

Modifications

Added client-side filtering to watch events in ListWatch class so incoming workflows are checked against the active name filter before being added to the list.

Bug reproduction:

  1. Open workflow list and set name filter (e.g. Prefix = hello-world).
  2. Create a workflow with a different name (e.g. bug-check).
  3. Bug: the new workflow appears in the filtered list.

See example of the bug below:

argocd_hq.gif

Verification

  • Added unit tests for the name filter matching logic
  • Manually tested all filter types (Contains, Prefix, Exact, NotEquals)

Documentation

No documentation needed - this is a bug fix with no API or behavior changes.

Summary by CodeRabbit

  • New Features

    • Added name-based filtering to the workflows list supporting multiple filter modes: Contains, Prefix, Exact, and NotEquals.
    • Filter functionality seamlessly integrates with real-time updates.
  • Tests

    • Added comprehensive test coverage for name filtering functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
@Joibel Joibel added area/ui cherry-pick/3.6 Cherry-pick this to release-3.6 cherry-pick/3.7 Cherry-pick this to release-3.7 labels Jan 22, 2026
@Joibel
Copy link
Member

Joibel commented Jan 22, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

This PR adds optional per-instance filtering to the ListWatch class, allowing name-based filtering to be applied consistently during both initial list loads and real-time watch/stream updates. A new matchesNameFilter helper function evaluates workflows against configurable filter modes (Contains, Prefix, Exact, NotEquals), which is then integrated into the workflows list component.

Changes

Cohort / File(s) Summary
ListWatch Infrastructure
ui/src/shared/list-watch.ts
Introduces generic Filter<T> type, adds optional filter parameter to ListWatch constructor, and implements filtering logic that short-circuits non-DELETED events when filter rejects an item.
Filter Logic & Tests
ui/src/workflows/components/workflow-filters/workflow-filters.tsx, ui/src/workflows/components/workflow-filters/workflow-filters.test.ts
New matchesNameFilter() helper function supporting Contains, Prefix, Exact, and NotEquals filter modes with empty nameValue defaulting to true. Test suite covers all filter modes and edge cases.
Workflows List Integration
ui/src/workflows/components/workflows-list/workflows-list.tsx
Integrates name filtering by importing matchesNameFilter and passing a filter function to ListWatch that applies name-based filtering when nameValue is provided.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: name filter ignored on workflow watch events' clearly and concisely describes the main bug fix addressing the issue where name filters were not applied to watch/stream events.
Description check ✅ Passed The PR description comprehensively covers motivation (bug behavior), modifications (client-side filtering in ListWatch), verification (unit tests and manual testing), and issue linkage (Fixes #15108), though it retains template comments.
Linked Issues check ✅ Passed The PR changes fully address the linked issue #15108 by implementing client-side filtering on watch events to ensure incoming workflows are checked against the active name filter before being added to the list.
Out of Scope Changes check ✅ Passed All code changes are directly related to fixing the name filter bug: ListWatch generic filtering support, name filter matching logic, and integration into the workflows list. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

area/ui cherry-pick/3.6 Cherry-pick this to release-3.6 cherry-pick/3.7 Cherry-pick this to release-3.7

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nameFilter works on initial list but not during watch/stream updates

2 participants