Skip to content

fix: Align MCP Apps widget pricing with Store page#1101

Open
jirispilka wants to merge 3 commits into
masterfrom
jirispilka/MCP-Apps-shows-different-Pricing
Open

fix: Align MCP Apps widget pricing with Store page#1101
jirispilka wants to merge 3 commits into
masterfrom
jirispilka/MCP-Apps-shows-different-Pricing

Conversation

@jirispilka

Copy link
Copy Markdown
Collaborator

Summary

  • Widget PPE badges now use the primary charge event (via isPrimaryEvent) instead of the generic "Pay per event" label when an Actor has multiple events.
  • Widget pricing uses complete tier matrices and prefers the GOLD tier so the badge matches the public Store page (e.g. from $0.25 / 1,000 each tweet… for xtdata/twitter-x-scraper).

Closes #905

Test plan

  • Unit: formatPricing primary-event + Store-page regression (tests/unit/web.formatting.pricing.test.ts)
  • Unit: isPrimaryEvent passed through complete/simplified structured pricing
  • pnpm run type-check, lint, test:unit, format, check:agents
  • Manually: search for xtdata/twitter-x-scraper in MCP Apps and confirm badge matches https://apify.com/xtdata/twitter-x-scraper

Made with Cursor

Use the primary PAY_PER_EVENT charge event and GOLD-tier pricing in the
widget badge so multi-event Actors no longer show a generic "Pay per event"
label.

Closes #905

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics. labels Jul 17, 2026
The initial fix for #905 hardcoded a "prefer GOLD tier" rule for the
"from $X / 1,000" badge instead of the true minimum across paid tiers,
mismatching actors where a higher tier is cheaper than GOLD. Restore
Math.min() semantics, matching the sibling PRICE_PER_DATASET_ITEM
formatter in the same file.

Also renames the new test file to match this repo's widget.* naming
convention and documents isPrimaryEvent in the pricing_info.ts contract.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes MCP Apps widget pricing badges so they match the public Apify Store Actor page, especially for PAY_PER_EVENT Actors with multiple charge events (primary-event selection) and full tier matrices.

Changes:

  • Propagate isPrimaryEvent from API pricing data through structured/simplified pricing structures and schemas.
  • Update widget pricing formatting to prefer the primary PPE event and show a from prefix for multi-event PPE badges.
  • Add unit tests covering primary-event selection and a Store-page regression for xtdata/twitter-x-scraper (#905).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit/widget.formatting.test.ts Adds widget-facing formatting tests for PPE primary-event selection and Store-page regression.
tests/unit/utils.pricing_info.test.ts Verifies isPrimaryEvent is preserved in both complete and simplified structured pricing.
src/web/src/utils/formatting.ts Updates PPE formatting to pick a primary event and optionally prefix with from for multi-event cases.
src/web/src/types.ts Extends web StructuredPricingInfo.events[] with optional isPrimaryEvent.
src/utils/pricing_info.ts Adds isPrimaryEvent to charge-event types and maps it into structured pricing outputs.
src/utils/actor_card.ts Switches widget actor pricing to complete structured pricing (vs simplified) for Store-badge parity.
src/tools/structured_output_schemas.ts Exposes isPrimaryEvent in structured output JSON schema for events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/unit/widget.formatting.test.ts Outdated
Comment thread tests/unit/widget.formatting.test.ts Outdated
Comment thread src/utils/actor_card.ts Outdated
Comment on lines +118 to +121
it('uses the true cheapest tier, not GOLD, when a higher tier is cheaper', () => {
// compass/crawler-google-places-shaped: price decreases monotonically per tier,
// DIAMOND ($0.76/1,000) is cheaper than GOLD ($2.10/1,000).
const price = formatPricing({
Comment on lines 63 to 67
const title = event.title.toLowerCase() || 'result';
const prefix = showFromPrefix ? 'from ' : '';

if (event.tieredPricing && event.tieredPricing.length > 0) {
const tieredPrices = event.tieredPricing
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MCP Apps shows different Pricing info than the public Actor page

3 participants