From 86f633f2df4dc415c92d815fc7b27c23869bc4ef Mon Sep 17 00:00:00 2001 From: Ashish Kolhe Date: Mon, 2 Nov 2026 14:13:44 +0530 Subject: [PATCH] fix(autoobserve): keep See all reachable when decided suggestions empty the rail page The rail decides whether more suggestions exist from the server total, not the page length. An empty page with a non-zero total keeps the count and See all, and says the top suggestions were already handled instead of claiming there are none. --- .../autoobserve/live/LiveSuggestions.spec.ts | 23 +++++++++++++ .../autoobserve/live/LiveSuggestions.vue | 32 +++++++++++++------ web/src/locales/languages/en-US.json | 4 ++- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/web/src/components/autoobserve/live/LiveSuggestions.spec.ts b/web/src/components/autoobserve/live/LiveSuggestions.spec.ts index 42e00746b2..f2e90c1b69 100644 --- a/web/src/components/autoobserve/live/LiveSuggestions.spec.ts +++ b/web/src/components/autoobserve/live/LiveSuggestions.spec.ts @@ -177,3 +177,26 @@ describe("LiveSuggestions rail (OSS-11, OSS-9)", () => { expect(announce(wrapper).text()).toBe("Suggestions loaded"); }); }); + +describe("LiveSuggestions rail when decisions empty the first page", () => { + it("keeps See all from the server total, and never says there are no suggestions", () => { + const wrapper = mountRail(rail(0, 12)); + expect(cards(wrapper)).toHaveLength(0); + const seeAll = wrapper.find('[data-test="autoobserve2-suggestions-see-all"]'); + expect(seeAll.exists()).toBe(true); + expect(seeAll.text()).toBe("See all 12"); + expect(wrapper.find('[data-test="autoobserve2-suggestions-more"]').exists()).toBe(false); + expect(wrapper.find('[data-test="autoobserve2-suggestions-empty"]').exists()).toBe(false); + expect(wrapper.find('[data-test="autoobserve2-suggestions-page-empty"]').text()).toContain( + "The top suggestions were already handled", + ); + expect(countChip(wrapper)).toBe("12"); + }); + + it("keeps See all when the page holds fewer cards than the total", () => { + const wrapper = mountRail(rail(2, 12)); + expect(cards(wrapper)).toHaveLength(2); + expect(wrapper.find('[data-test="autoobserve2-suggestions-more"]').text()).toBe("and 10 more"); + expect(wrapper.find('[data-test="autoobserve2-suggestions-see-all"]').exists()).toBe(true); + }); +}); diff --git a/web/src/components/autoobserve/live/LiveSuggestions.vue b/web/src/components/autoobserve/live/LiveSuggestions.vue index 951ebbd2f5..625b5c5f4f 100644 --- a/web/src/components/autoobserve/live/LiveSuggestions.vue +++ b/web/src/components/autoobserve/live/LiveSuggestions.vue @@ -17,7 +17,7 @@ along with this program. If not, see . -