Add extended promotional component filter#342
Conversation
a97f67f to
d2cda29
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for an is_extended_promotional component flag (derived as preferred && !basic) across both the origin app and the Cloudflare D1 proxy, including JSON response fields and query filtering.
Changes:
- Introduces
isExtendedPromotionalhelper and exposesis_extended_promotionalin/api/searchand/components/listresponses (origin + D1 proxy). - Adds
is_extended_promotional=true|falsefiltering to origin SQL queries and the D1 proxy search index query builder. - Updates HTML rendering (D1 proxy) and adds targeted test coverage for the derived field and filter behavior.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/routes/components/list.test.ts | Asserts derived field presence/logic and filter behavior for /components/list. |
| tests/routes/api/search.test.ts | Asserts derived field presence/logic and filter behavior for /api/search. |
| tests/lib/is-extended-promotional.test.ts | Unit tests for the origin isExtendedPromotional helper. |
| routes/components/list.tsx | Adds query param, SQL filter conditions, response field, and HTML checkbox for extended promotional. |
| routes/api/search.tsx | Adds query param, SQL filter conditions, and response field for extended promotional. |
| lib/util/is-extended-promotional.ts | Implements origin-side derived flag helper. |
| cf-proxy/test/render.test.ts | Verifies D1 HTML filter rendering and column labeling for extended promotional. |
| cf-proxy/test/is-extended-promotional.test.ts | Unit tests for the proxy isExtendedPromotional helper. |
| cf-proxy/src/search.ts | Adds is_extended_promotional query param handling and SQL condition generation for D1 search. |
| cf-proxy/src/render.ts | Adds column label and renders the extended promotional checkbox filter in D1 HTML. |
| cf-proxy/src/is-extended-promotional.ts | Implements proxy-side derived flag helper. |
| cf-proxy/src/index.ts | Adds is_extended_promotional to D1 proxy JSON responses for search and components list. |
| cf-proxy/src/components.ts | Forwards is_extended_promotional through the D1 components list query path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8cd3eed to
0fa5787
Compare
0fa5787 to
46f892b
Compare
|
CI follow-up pushed in 48eb01b. The previous Bun Test run completed setup successfully but then failed all DB-backed route tests with Additional local checks after the patch:
|
|
Second CI follow-up pushed in 18056cf. The rerun got past the DB singleton issue and reached 197 passing tests; the remaining two errors were from root Rechecked locally after the workflow patch:
|
|
Final CI follow-up is green on the latest head (9b176a8).\n\nWhat changed after the last update:\n- removed the duplicate root kysely-d1 dependency; cf-proxy dependencies are installed in the workflow instead\n- skipped the microphone package dropdown query for JSON responses so the API route avoids unnecessary DB work\n- allowed the microphone route test enough time on the full cached CI database\n\nValidation:\n- GitHub ormat-check: pass\n- GitHub ype-check: pass\n- GitHub est: pass\n- local |
|
Claiming this bounty. Will add extended promotional component filter. |
/claim #92
Summary
is_extended_promotionalfrom existing JLC flags aspreferred && !basic./api/searchand/components/listresponses, plus D1 proxy search/list responses.is_extended_promotional=true|falsefiltering in origin and D1 search paths, and wire the HTML filter/column label.cf-proxydependencies before rootbun testimports proxy code.Validation
9b176a8: Format Check, Type Check, and Bun Test all pass.npx --yes @biomejs/biome@1.9.4 check routes/components/list.tsx routes/api/search.tsx lib/util/is-extended-promotional.ts tests/lib/is-extended-promotional.test.ts tests/routes/api/search.test.ts tests/routes/components/list.test.ts cf-proxy/src/components.ts cf-proxy/src/index.ts cf-proxy/src/render.ts cf-proxy/src/search.ts cf-proxy/src/is-extended-promotional.ts cf-proxy/test/is-extended-promotional.test.ts cf-proxy/test/render.test.tsnpm testincf-proxy- 127 passednpx --yes bun test tests/lib/is-extended-promotional.test.tsnpx --yes bun test cf-proxy/test/worker.test.ts cf-proxy/test/cache-service.test.tsgit diff --checkNote: I also tried the origin DB-backed route tests locally with
npx --yes bun test tests/routes/api/search.test.ts tests/routes/components/list.test.ts; this Windows workspace does not have the seeded SQLite tables, so those route tests stop atno such table: components/v_components. The full seeded DB route suite passes in GitHub CI.