Skip to content

Expose extended promotional component filter#340

Open
justusaugust wants to merge 5 commits into
tscircuit:mainfrom
justusaugust:codex/extended-promotional-filter-92
Open

Expose extended promotional component filter#340
justusaugust wants to merge 5 commits into
tscircuit:mainfrom
justusaugust:codex/extended-promotional-filter-92

Conversation

@justusaugust
Copy link
Copy Markdown

@justusaugust justusaugust commented May 25, 2026

Summary

  • add is_extended_promotional derived from preferred && !basic to origin /components/list and /api/search responses
  • add is_extended_promotional=true filtering to origin and D1 search/catalog paths
  • add the component-catalog HTML filter and D1 render coverage
  • repair the stale 7-Zip setup URL and keep the test DB singleton alive during Bun test preload so the GitHub test job can run cleanly

Verification

  • bun run setup
  • bun test (213 pass, 0 fail)
  • bunx tsc --noEmit
  • bun run format:check
  • cd cf-proxy && bun test (126 pass, 0 fail)
  • git diff --check

Demo

/claim #92

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 700929238f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread routes/components/list.tsx Outdated
query = query.where("preferred", "=", 1)
}
if (req.query.is_extended_promotional) {
query = query.where("preferred", "=", 1).where("basic", "=", 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use null-safe predicate for extended promotional filter

The new is_extended_promotional filter currently uses where("basic", "=", 0), but v_components.basic is nullable (see lib/db/generated/kysely.ts), while the response flag is computed as !Boolean(c.basic). That means rows with preferred = 1 and basic = NULL are labeled is_extended_promotional: true in normal responses but are incorrectly excluded when is_extended_promotional=true is requested. This creates inconsistent and incomplete filtered results for /components/list whenever basic is null.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 3621305: the origin filters now use preferred = 1 plus COALESCE(basic, 0) = 0, matching the response !Boolean(basic) behavior. Verified with bun test, bunx tsc --noEmit, and bun run format:check.

@justusaugust
Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

1 similar comment
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant