Skip to content

Improved gift toast partial structure and copy#29014

Merged
weylandswart merged 1 commit into
mainfrom
improved-gift-toast-partial-structure-and-copy
Jul 2, 2026
Merged

Improved gift toast partial structure and copy#29014
weylandswart merged 1 commit into
mainfrom
improved-gift-toast-partial-structure-and-copy

Conversation

@weylandswart

@weylandswart weylandswart commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

No ref

Reworks the reader-side gift toast so its copy reflects the gifted entry's access level and type, following the same approach as the content-cta partial.

  • Executes the partial with the post as context, so it (and any theme override of it) gets the full post scope, matching content-cta.
  • Varies the toast copy by visibility and entry type using {{#has visibility}} and {{#is "page"}}: members-only vs paid, and post vs page.
  • Adds coverage for the new copy variants in the gift-links e2e tests.

Rework the reader-side gift toast to render copy that reflects the gifted
entry's access level and type, matching the content-cta partial's approach.

- Execute the partial with the post as context so it (and any theme override)
  gets the full post scope, like content-cta.
- Vary the toast copy by visibility and entry type using {{#has visibility}}
  and {{#is "page"}}: members-only vs paid, and post vs page.
- Cover the new copy variants in the gift-links e2e tests.
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bb74dd4f-a42c-428f-acc1-9398316fa0f9

📥 Commits

Reviewing files that changed from the base of the PR and between 4f5b449 and 8c3298a.

📒 Files selected for processing (3)
  • ghost/core/core/frontend/helpers/ghost_foot.js
  • ghost/core/core/frontend/helpers/tpl/gift-toast.hbs
  • ghost/core/test/e2e-frontend/gift-links.test.ts

Walkthrough

This change updates how the gift-toast Handlebars template receives its rendering context in ghost_foot.js, switching to using the post object from options.data.root.post. The gift-toast.hbs template title is updated to render conditional copy based on visibility (members-only vs. general) and content type (page vs. post). Corresponding e2e frontend tests are extended to cover members-only gifted posts and to assert the toast copy reflects the correct access level and content type across paid post, members-only, and paid page scenarios.

Possibly related PRs

  • TryGhost/Ghost#28824: Modifies the same gift-toast partial rendering and gift-toast.hbs UI shown for gifted access.
  • TryGhost/Ghost#28853: Changes the gift-toast rendering path in ghost_foot.js related to gift-link gating logic.
  • TryGhost/Ghost#28959: Modifies the same gift-toast pipeline in ghost_foot.js and tpl/gift-toast.hbs.

Suggested reviewers: kevinansfield, cmraible

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: gift toast structure and copy were improved.
Description check ✅ Passed The description accurately describes the gift toast context, copy variants, and added test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improved-gift-toast-partial-structure-and-copy

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.

@nx-cloud

nx-cloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 8c3298a

Command Status Duration Result
nx run @tryghost/admin:build ✅ Succeeded 6s View ↗
nx run ghost:build:assets ✅ Succeeded 2s View ↗
nx run ghost:build:tsc ✅ Succeeded 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-01 15:30:28 UTC

@weylandswart weylandswart merged commit 00fd975 into main Jul 2, 2026
70 of 72 checks passed
@weylandswart weylandswart deleted the improved-gift-toast-partial-structure-and-copy branch July 2, 2026 08:56
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.

2 participants