Skip to content

feat(heureka): implement initial filter URL sync and its filter pill deletion#1196

Merged
hodanoori merged 16 commits intomainfrom
hoda-heureka-handle-initial-filter
Oct 15, 2025
Merged

feat(heureka): implement initial filter URL sync and its filter pill deletion#1196
hodanoori merged 16 commits intomainfrom
hoda-heureka-handle-initial-filter

Conversation

@hodanoori
Copy link
Copy Markdown
Contributor

@hodanoori hodanoori commented Oct 7, 2025

Summary

This PR ensures that initial filters are properly added to deep links in Heureka, their pills are removable, and the filter state is correctly maintained when navigating between tabs.

Changes Made

  • Initial Filter Deep Linking: Initial filters from appProps.initialFilters are now automatically added to the URL when the app loads with no existing filters.
  • Removable Filter Pills: Initial filter pills can be deleted by clicking the close (X) button, and the URL is updated accordingly
  • Tab Navigation State Management: Added a React context store (InitialFiltersContext) to track whether initial filters have been applied during the browser session, preventing re-application when navigating between Services and Vulnerabilities tabs

Technical Implementation

  • Created InitialFiltersContext to manage initial filter application state across component lifecycle
  • Updated ServicesFilters component to use the context store instead of module-level variables
  • Integrated the context provider in the main App component
  • Maintained existing filter persistence mechanism for user-defined filters

Related Issues

Testing Instructions

1. Initial Filter Display

  • Open the app and navigate to the Services tab
  • You should see the initial filter in the URL: f_supportGroupCcrn=containers
  • The filter pill should be visible in the UI

2. Filter Deletion and Browser Reload

  • Delete the initial filter pill by clicking the X button
  • Reload the browser
  • The initial filter should reappear in both the URL and as a filter pill

3. Tab Navigation Without Re-application

  • Delete the initial filter pill
  • Switch to the Vulnerabilities tab
  • Switch back to the Services tab
  • The initial filter should NOT reappear (user deletion is respected)

4. Filter Persistence Between Tabs

  • Add custom filters to the Services tab
  • Switch to the Vulnerabilities tab and add different filters
  • Switch back to the Services tab
  • Your original Services filters should be preserved
  • Switch back to Vulnerabilities tab
  • Your original Vulnerabilities filters should be preserved
  • All filters should be visible as pills and reflected in the URL

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

@hodanoori hodanoori requested a review from a team as a code owner October 7, 2025 16:52
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 7, 2025

🦋 Changeset detected

Latest commit: 3990197

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

This PR includes changesets to release 2 packages
Name Type
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka 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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 7, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-10-15 07:13 UTC

@hodanoori hodanoori self-assigned this Oct 7, 2025
@hodanoori hodanoori marked this pull request as draft October 8, 2025 07:04
@hodanoori hodanoori changed the title feat(heureka): implements initial filter URL synchronization and its filter pill deletion feat(heureka): implement initial filter URL sync and its filter pill deletion Oct 9, 2025
@hodanoori hodanoori marked this pull request as ready for review October 9, 2025 15:56
guoda-puidokaite

This comment was marked as off-topic.

guoda-puidokaite

This comment was marked as off-topic.

guoda-puidokaite

This comment was marked as resolved.

@guoda-puidokaite guoda-puidokaite dismissed their stale review October 10, 2025 13:53

Backend issue

@guoda-puidokaite
Copy link
Copy Markdown
Contributor

I tested. From my understanding, looked good.

Comment thread apps/heureka/src/store/InitialFiltersContext.tsx Outdated
Comment thread apps/heureka/src/routes/services/index.tsx Outdated
Copy link
Copy Markdown
Collaborator

@ArtieReus ArtieReus left a comment

Choose a reason for hiding this comment

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

Heureka: tested adding a wrong filter key. Expected to be ignored and show the initialfilters. Although the error will be catch in the upcoming PR it shouldn't happen an error from my point of view. f_supportGroupCcrns vs f_supportGroupCcrn

Screenshot 2025-10-13 at 11 47 17

@hodanoori
Copy link
Copy Markdown
Contributor Author

Heureka: tested adding a wrong filter key. Expected to be ignored and show the initialfilters. Although the error will be catch in the upcoming PR it shouldn't happen an error from my point of view. f_supportGroupCcrns vs f_supportGroupCcrn

Screenshot 2025-10-13 at 11 47 17

This is addressed in Error handling PR from Taimoor that the app should not crash for such cases. Here is the PR:
#1197

Copy link
Copy Markdown
Collaborator

@ArtieReus ArtieReus left a comment

Choose a reason for hiding this comment

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

lgtm. As soon as the other concerns are addressed i can approve it

@guoda-puidokaite
Copy link
Copy Markdown
Contributor

I'll test when resolved, ping.

@hodanoori hodanoori requested a review from taymoor89 October 13, 2025 13:42
Comment thread apps/heureka/src/components/Services/ServicesFilters.tsx Outdated
Comment thread apps/heureka/src/components/Services/ServicesFilters.tsx Outdated
Comment thread apps/heureka/src/components/Services/ServicesFilters.tsx Outdated
Copy link
Copy Markdown
Contributor

@taymoor89 taymoor89 left a comment

Choose a reason for hiding this comment

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

Great stuff Hoda! 🏅

@hodanoori hodanoori merged commit f8b9234 into main Oct 15, 2025
16 checks passed
@hodanoori hodanoori deleted the hoda-heureka-handle-initial-filter branch October 15, 2025 07:11
taymoor89 pushed a commit that referenced this pull request Oct 28, 2025
…deletion (#1196)

* feat(heureka): makes initial filter pill removable

* feat(heureka): adds store to track initial filter state across tab navigation

* feat(heureka): adds changeset

* fix(heureka): pretifies the files

* fix(heureka): pretifies the files

* fix(heureka): pretifies the files

* fix(heureka): fixes prettier issue

* fix(heureka): adjust services test

* chore(heureka): renames store to StoreProvider to be generic for future uses

* chore(heureka): corrects the comment

* chore(heureka): improve store prop handling

* chore(heureka): handles initialFilter store status in services route component

* chore(heureka): fixes some leftovers
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.

[Task](heureka): Remove all filters including the initial filter

4 participants