Skip to content

Filtered out retention offers from editor cards#26336

Merged
sagzy merged 4 commits intomainfrom
cursor/BER-1772-archived-offers-card-dropdown-9bd1
Feb 11, 2026
Merged

Filtered out retention offers from editor cards#26336
sagzy merged 4 commits intomainfrom
cursor/BER-1772-archived-offers-card-dropdown-9bd1

Conversation

@prschulz
Copy link
Copy Markdown
Contributor

@prschulz prschulz commented Feb 10, 2026

ref https://linear.app/ghost/issue/BER-1772

  • retention offers can only be retrieved during cancellation flows, therefore we don't want them to be listed as dropdown options in the editor cards (e.g. CTA card)

fixes https://linear.app/ghost/issue/BER-1772

- Archived offers (status:archived) and retention offers (redemption_type:retention) were appearing in the CTA card link dropdown and other card link dropdowns in the editor
- Updated the offer fetch filter to only include active signup offers (status:active+redemption_type:signup)
- Added redemptionType attribute to Ember offer model to support the new filter
- Retention offers are only meant to be triggered during member cancellation flows, not via offer links
- This ensures only valid, usable offers appear in the link selection dropdown

Co-authored-by: Peter Schulz <prschulz@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 10, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 10, 2026

Walkthrough

The codebase was changed to narrow offer filtering to active signup offers by adding redemption_type:signup alongside status:active. The backend repository transformer was updated to accept redemption_type as a valid filter key. Tests were adjusted and a new test added to verify filtering by both status and redemption_type.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: filtering out retention offers from editor cards dropdown options.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for filtering retention offers and referencing the associated issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/BER-1772-archived-offers-card-dropdown-9bd1

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Changed status back from 'active' | 'archived' to string
- The restrictive type was causing compilation errors in add-offer-modal.tsx
- The core fix (filtering offers in the editor) remains intact

Co-authored-by: Peter Schulz <prschulz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@sagzy sagzy left a comment

Choose a reason for hiding this comment

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

Works as expected!

One change is unrelated to the fix, so I suggest removing it from the PR (I've tested that it works without)

Also: I cannot replicate the original bug where archived offers would be listed in the dropdown, with or without this PR. Code also already had the status:active filter in place. Therefore, I suggest to also update the PR description to be "Filtered out retention offers from editor cards", as this is what this fix is about

Comment thread ghost/admin/app/models/offer.js Outdated
@sagzy sagzy changed the title Archived offers card dropdown Filtered out retention offers from editor cards Feb 11, 2026
@sagzy sagzy marked this pull request as ready for review February 11, 2026 13:43
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 3

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread ghost/admin/app/components/koenig-lexical-editor.js
@sagzy sagzy enabled auto-merge (squash) February 11, 2026 14:18
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.85%. Comparing base (e85bd8d) to head (c3d1077).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...host/admin/app/components/koenig-lexical-editor.js 0.00% 1 Missing ⚠️
...rver/services/offers/offer-bookshelf-repository.js 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #26336    +/-   ##
========================================
  Coverage   72.85%   72.85%            
========================================
  Files        1560     1561     +1     
  Lines      120464   120704   +240     
  Branches    14522    14547    +25     
========================================
+ Hits        87763    87941   +178     
- Misses      31689    31751    +62     
  Partials     1012     1012            
Flag Coverage Δ
admin-tests 52.35% <0.00%> (+0.01%) ⬆️
e2e-tests 72.85% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sagzy sagzy merged commit e1dcec9 into main Feb 11, 2026
35 checks passed
@sagzy sagzy deleted the cursor/BER-1772-archived-offers-card-dropdown-9bd1 branch February 11, 2026 14:35
9larsons pushed a commit that referenced this pull request Feb 12, 2026
ref https://linear.app/ghost/issue/BER-1772

- retention offers can only be retrieved during cancellation flows,
therefore we don't want them to be listed as dropdown options in the
editor cards (e.g. CTA card)

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Peter Schulz <prschulz@users.noreply.github.com>
Co-authored-by: Sag <guptazy@gmail.com>
betschki pushed a commit to magicpages/Ghost that referenced this pull request Feb 19, 2026
ref https://linear.app/ghost/issue/BER-1772

- retention offers can only be retrieved during cancellation flows,
therefore we don't want them to be listed as dropdown options in the
editor cards (e.g. CTA card)

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Peter Schulz <prschulz@users.noreply.github.com>
Co-authored-by: Sag <guptazy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants