Skip to content

feat(ui): preserve application search bar content across navigation (#5655) - #28406

Open
somaz94 wants to merge 1 commit into
argoproj:masterfrom
somaz94:feat/preserve-app-search-bar
Open

feat(ui): preserve application search bar content across navigation (#5655)#28406
somaz94 wants to merge 1 commit into
argoproj:masterfrom
somaz94:feat/preserve-app-search-bar

Conversation

@somaz94

@somaz94 somaz94 commented Jun 24, 2026

Copy link
Copy Markdown

Closes #5655

What

On the Applications list page, structured filters are persisted to view
preferences (localStorage), but the free-text search bar is only kept in the
URL query string. Navigating into an app and back via in-app navigation drops
the ?search= param, so the search box comes back empty while the filters
survive. The original issue asks for the search bar to be preserved the same
way the filters are.

Changes

  • Add a search field to AppsListPreferences (default '', normalized on load).
  • Persist the search text in ApplicationsListSearchBar.onChange alongside the
    existing URL update, mirroring how filters are stored.
  • Seed the search bar from the resolved value, with precedence: URL query param
    (if present) > persisted preference > empty.

Validation

  • pnpm lint (tsc --noEmit + eslint): clean.
  • pnpm test (jest): 23 suites / 266 tests pass, including 3 new tests in
    view-preferences-service.test.ts covering the default, a persist + reload
    round-trip, and normalization of older stored preferences without search.

This is a UI-only change (the search box has no CLI equivalent).


Checklist:

  • (c) this does not need to be in the release notes / tracked by existing issue Preserve application search bar content #5655 (good first issue, enhancement).
  • The title states what changed and the related issue number.
  • The title conforms to the PR title guidelines.
  • I've included "Closes Preserve application search bar content #5655" in the description.
  • CLI/UI parity — UI-only change; the search box has no CLI equivalent.
  • I have signed off all my commits (DCO).
  • I have written unit tests for my change.
  • My build is green locally (lint + unit tests).
  • I've added a description of why this PR is necessary.

@bunnyshell

bunnyshell Bot commented Jun 24, 2026

Copy link
Copy Markdown

❗ Preview Environment deployment failed on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 114 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
argo-cd-ui-array-push 11.15MB 114 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: argo-cd-ui-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
main.*.js 114 bytes 3.61MB 0.0%

@somaz94
somaz94 marked this pull request as ready for review June 24, 2026 07:46
@somaz94
somaz94 requested review from a team as code owners June 24, 2026 07:46
@somaz94
somaz94 force-pushed the feat/preserve-app-search-bar branch from a7556ad to 8fbf53e Compare July 24, 2026 06:24
@somaz94

somaz94 commented Jul 24, 2026

Copy link
Copy Markdown
Author

Rebased on latest master to clear the conflict.

The interesting part: master gained the regex search feature (searchRegex, the .* toggle, isInvalidRegex) after this branch was opened, and it touches the same ApplicationsListSearchBar / ApplicationsToolbar code as the search-preservation change here. So this wasn't a take-one-side resolution — I integrated both features:

  • ApplicationsListSearchBar props now carry searchRegex and pref.
  • The SearchBar onChange keeps the regex placeholder switching while also persisting the search text to view preferences (the actual fix here).
  • The toolbar keeps the regex toggle button; the search bar just gains pref={pref}.
  • URL search param still wins; it only falls back to the persisted preference when the param is absent, so regex and preservation don't fight over the value.

tsc --noEmit is clean for the changed files. Ready for another look.

Signed-off-by: somaz <genius5711@gmail.com>
@somaz94
somaz94 force-pushed the feat/preserve-app-search-bar branch from 58135c5 to da40a9f Compare July 24, 2026 09:13
@somaz94

somaz94 commented Aug 18, 2026

Copy link
Copy Markdown
Author

Open since June with no review. This preserves the application search bar content across navigation. Is that a change you would want in the UI? Happy to close if not, otherwise it is green and ready.

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.

Preserve application search bar content

1 participant