Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([issue-3284]): scope a filtered group's fold to the exact query, not to "filtering"

[._.]/ Adam Eivyb5ad2c295d8a
diff --git a/client/src/pages/PromptManager.jsx b/client/src/pages/PromptManager.jsx
index 108ca11f24..2aa2dbc505 100644
--- a/client/src/pages/PromptManager.jsx
+++ b/client/src/pages/PromptManager.jsx
@@ -310,12 +310,14 @@ export default function PromptManager() {
setExpandedGroups((prev) => new Set(prev).add(selectedGroupKey));
}, [selectedGroupKey]);
- // Folding a group away is scoped to the filter that motivated it — clearing
- // the search must not leave groups collapsed-by-exception in a view whose
- // default is already collapsed.
+ // A fold is scoped to the EXACT filter that motivated it, not merely to
+ // "some filter is on". Carrying it across a refinement is how the refined
+ // query's only hit ends up behind a collapsed header — the "reads as no
+ // results" failure this whole disclosure default exists to avoid.
+ const stageQueryKey = stageQuery.trim();
useEffect(() => {
setCollapsedWhileFiltering((prev) => (prev.size === 0 ? prev : new Set()));
- }, [stageFilterActive]);
+ }, [stageQueryKey, systemOnly]);
const toggleInSet = (set, key) => {
const next = new Set(set);
diff --git a/client/src/pages/PromptManager.test.jsx b/client/src/pages/PromptManager.test.jsx
index 4b027e0cfa..19e7dc31dd 100644
--- a/client/src/pages/PromptManager.test.jsx
+++ b/client/src/pages/PromptManager.test.jsx
@@ -126,9 +126,37 @@ describe('PromptManager stage list', () => {
// Clearing returns to the collapsed-by-default view...
fireEvent.change(searchBox(), { target: { value: '' } });
expect(groupHeader('Pipeline').getAttribute('aria-expanded')).toBe('false');
- // ...and expanding still works (the collapse exception did not persist).
+ // ...and the stale fold does not carry into the NEXT filter session. This
+ // is the assertion that actually observes the set — while no filter is on,
+ // `collapsedWhileFiltering` is never read, so clearing it is invisible.
+ fireEvent.change(searchBox(), { target: { value: 'e' } });
+ expect(groupHeader('Pipeline').getAttribute('aria-expanded')).toBe('true');
+ });
+
+ it('drops a fold when the query is refined, so the new match cannot hide behind it', async () => {
+ renderPage();
+ await screen.findByText('Prompt Stages');
+
+ fireEvent.change(searchBox(), { target: { value: 'e' } });
fireEvent.click(groupHeader('Pipeline'));
- expect(screen.getByText('Pipeline — Prose Draft')).toBeTruthy();
+ expect(screen.queryByText('Pipeline — Comic Book Script')).toBeNull();
+
+ // Refining to a query whose ONLY hit lives in the folded group must show it.
+ fireEvent.change(searchBox(), { target: { value: 'comic' } });
+ expect(screen.getByText('1 of 4')).toBeTruthy();
+ expect(screen.getByText('Pipeline — Comic Book Script')).toBeTruthy();
+ });
+
+ it('drops a fold when the SYSTEM toggle changes the filter', async () => {
+ renderPage();
+ await screen.findByText('Prompt Stages');
+
+ fireEvent.change(searchBox(), { target: { value: 'e' } });
+ fireEvent.click(groupHeader('Brain'));
+ expect(screen.queryByText('Brain Classifier')).toBeNull();
+
+ fireEvent.click(screen.getByRole('button', { name: /system only/i }));
+ expect(screen.getByText('Brain Classifier')).toBeTruthy();
});
it('folds two spellings of the same family into one group', async () => {