Skip to content

fix(frontend, v1.2): clear the search bar’s suggestions when the user changes - #9228

Merged
xuang7 merged 2 commits into
release/v1.2from
backport/9090-clear-the-search-bar-s-suggestions-when-v1.2
Nov 10, 2026
Merged

xuang7 merged 2 commits into
release/v1.2from
backport/9090-clear-the-search-bar-s-suggestions-when-v1.2

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Automated backport of #9090 to release/v1.2.

Source: 553ab15 · automation run

Any related issues, documentation, discussions?

Backport of #9090. Originally linked #9089.

How was this PR tested?

Release-branch CI runs on this branch once the conflicts are resolved and this PR is marked ready for review.

Was this PR authored or co-authored using generative AI tooling?

No.

…es (#9090)

### What changes were proposed in this PR?

The top search bar caches its suggestions by the typed text and never
cleared that cache. After signing out you land on the About page with
the same search bar, and typing text searched before sign-out showed the
previous user’s suggestions again, including private workflows, datasets
and models, straight from the cache.

SearchBarComponent now clears the cache and the shown suggestions in its
existing userChanged() handler, which runs on sign-in and sign-out.

Before: signed out, “sales” still suggests the private dataset
sales-2026, and no request is sent:

<img width="1440" height="900" alt="before-2-logged-out-still-suggested"
src="https://github.com/user-attachments/assets/818ad412-162e-4f3d-bfbc-978647753167"
/>

After: signed out, “sales” goes to the public search and suggests
nothing:

<img width="1440" height="900" alt="after-1-logged-out-no-suggestion"
src="https://github.com/user-attachments/assets/10335c5f-c4a9-4241-9e42-8b383658d9a8"
/>

### Any related issues, documentation, discussions?
Closes #9089

### How was this PR tested?
Added a case to search-bar.component.spec.ts: after the user changes, a
repeated query goes to the server as the new user instead of returning
the cached suggestions. It fails without the fix.
```
cd frontend
yarn ng test --watch=false --include='**/search-bar.component.spec.ts'
# Tests  10 passed (10)
```
Also checked against a local stack: signed in, typed a private dataset’s
name, signed out, and typed it again. No suggestion is shown, and a
public search request is sent.

### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)

(backported from commit 553ab15)
@github-actions

Copy link
Copy Markdown
Contributor Author

The cherry-pick conflicted and was committed with conflict markers. Resolve the conflicts on this branch, then mark this PR ready for review.

Conflicting files:

  • frontend/src/app/dashboard/component/user/search-bar/search-bar.component.spec.ts

@xuang7
xuang7 marked this pull request as ready for review November 4, 2026 04:18
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Ma77Ball
    You can notify them by mentioning @Ma77Ball in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.45%. Comparing base (4fe7784) to head (ec09f0c).

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/v1.2    #9228      +/-   ##
==================================================
- Coverage           53.45%   53.45%   -0.01%     
  Complexity           2565     2565              
==================================================
  Files                1078     1078              
  Lines               42359    42361       +2     
  Branches             4563     4563              
==================================================
+ Hits                22645    22646       +1     
  Misses              18399    18399              
- Partials             1315     1316       +1     
Flag Coverage Δ *Carryforward flag
access-control-service 64.35% <ø> (ø) Carriedforward from 4fe7784
agent-service 38.97% <ø> (ø) Carriedforward from 4fe7784
amber 53.45% <ø> (ø) Carriedforward from 4fe7784
computing-unit-managing-service 1.65% <ø> (ø) Carriedforward from 4fe7784
config-service 56.06% <ø> (ø) Carriedforward from 4fe7784
file-service 61.72% <ø> (ø) Carriedforward from 4fe7784
frontend 47.31% <100.00%> (+<0.01%) ⬆️
pyamber 93.37% <ø> (ø) Carriedforward from 4fe7784
python 90.93% <ø> (ø) Carriedforward from 4fe7784
workflow-compiling-service 58.69% <ø> (ø) Carriedforward from 4fe7784

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xuang7 xuang7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The component change matches #9090 on main; the spec keeps only the test that applies to release/v1.2 (the other tests cover main-only behavior).

@xuang7
xuang7 added this pull request to the merge queue Nov 10, 2026
Merged via the queue into release/v1.2 with commit 4f64f4b Nov 10, 2026
17 checks passed
@xuang7
xuang7 deleted the backport/9090-clear-the-search-bar-s-suggestions-when-v1.2 branch November 10, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants