Skip to content

Commit 0a06d08

Browse files
committed
docs(plans): revise v0.6.2 plan per subagent review (1 Crit, 3 Imp, 2 Min)
Reviewer subagent findings applied: - Critical: Task 4 single-char test dropped the onQueryChange assertion (clearedRef initial state made it fire nothing on empty→1char transition); test now only asserts api.search is not called. - Important: Task 5 TagSidebarProps.mode made optional with default "all"; destructuring adds `mode = "all"` so existing tests (which don't pass mode) still pass TypeScript. - Important: Task 6 import snippet no longer re-imports SearchHit (already in current App.tsx line 11; duplicate would fail no-duplicate-imports ESLint rule). - Important: Task 6 explicitly instructs removal of the old `counts` derivation block (lines 162-167) to prevent unused-variable lint error under `eslint -D warnings`. - Minor: Task 6 expected test count corrected 26→22 (search.test has 9+4+9 after Tasks 1-3). - Minor: Task 8 close-issue comment uses current spec hash 92f520f instead of stale bc451d8. Plan now ready for execution.
1 parent eaac47d commit 0a06d08

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

docs/superpowers/plans/2026-04-17-v0.6.2-live-faceted-search.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,11 @@ describe("SearchBar", () => {
580580
});
581581
await advanceAndFlush(300);
582582

583+
// The purpose of this test is to confirm no search fires.
584+
// Whether onQueryChange fires (""/null) on the empty→"a" transition
585+
// is covered by clear-signal tests below; here we only pin that
586+
// `api.search` stays untouched for single-char input.
583587
expect(mockSearch).not.toHaveBeenCalled();
584-
expect(onChange).toHaveBeenCalledWith("", null);
585588
});
586589

587590
it("fires search for two-character query at limit 500", async () => {
@@ -965,12 +968,13 @@ interface TagSidebarProps {
965968
selectedTagId: string | null;
966969
onSelect: (tagId: string | null) => void;
967970
/**
968-
* Rendering mode:
969-
* - "all": show every tag in `tags` (default — no search active).
971+
* Rendering mode (optional; defaults to "all" so existing callers
972+
* that don't pass this prop continue to work):
973+
* - "all": show every tag in `tags` (no search active).
970974
* - "facets": show only tags with counts > 0 (search active; the
971975
* sidebar becomes a facet panel over the current results).
972976
*/
973-
mode: "all" | "facets";
977+
mode?: "all" | "facets";
974978
}
975979

976980
/**
@@ -984,7 +988,7 @@ export default function TagSidebar({
984988
totalCount,
985989
selectedTagId,
986990
onSelect,
987-
mode,
991+
mode = "all",
988992
}: TagSidebarProps) {
989993
const visibleTags =
990994
mode === "facets"
@@ -1179,9 +1183,20 @@ Add imports at the top:
11791183
11801184
```typescript
11811185
import { composeVisible, computeFacets, sortByRank } from "./lib/search";
1182-
import type { SearchHit } from "./types";
11831186
```
11841187
1188+
(Do NOT re-import `SearchHit` — it is already imported in the current
1189+
`App.tsx` line 11 as part of the existing `import type {
1190+
FileWithTags, ScanResult, SearchHit, Tag } from "./types";` line.
1191+
Adding a duplicate import would fail ESLint's `no-duplicate-imports`
1192+
rule and break `just ci`.)
1193+
1194+
**Also REMOVE the existing `counts` derivation block** (App.tsx
1195+
lines 162-167 in current state — the block starting with
1196+
`// Compute per-tag file counts from the full unfiltered list.`).
1197+
The new `facetCounts` replaces it; leaving the old block in produces
1198+
an unused-variable lint error under `eslint -D warnings`, failing CI.
1199+
11851200
- [ ] **Step 6.3: Run App.test.tsxconfirm existing tests still pass**
11861201

11871202
```bash
@@ -1196,7 +1211,7 @@ Expected: PASS — both existing tests still green (file-event debounce + watche
11961211
cd apps/desktop && bun run test
11971212
```
11981213

1199-
Expected: PASS — everything green (26 tests in search.test, 8 in SearchBar, 9 in TagSidebar, 2 in App, plus all unchanged suites).
1214+
Expected: PASSeverything green (22 tests in search.test, 8 in SearchBar, 9 in TagSidebar, 2 in App, plus all unchanged suites).
12001215

12011216
- [ ] **Step 6.5: Commit**
12021217

@@ -1528,7 +1543,7 @@ Actions for the release-plz workflow status.
15281543
- [ ] **Step 8.7: Close issue #25 + link #32**
15291544

15301545
```bash
1531-
gh issue close 25 --comment "Closed by v0.6.2 — live faceted search. See release notes + commit bc451d8 (spec) + the feat/fix commits in the v0.6.1..v0.6.2 range."
1546+
gh issue close 25 --comment "Closed by v0.6.2 — live faceted search. See release notes + commit 92f520f (spec) + the feat/fix commits in the v0.6.1..v0.6.2 range."
15321547
gh issue comment 32 --body "v0.6.2 ships the core of this issue — live inline narrowing + facet panel + AND composition with tag filter. Remaining sub-items (multi-tag OR, full-corpus facet counts, advanced query DSL) remain tracked here as post-v1."
15331548
```
15341549

0 commit comments

Comments
 (0)