Skip to content

Allowed embedding in new welcome email editor#26649

Merged
EvanHahn merged 5 commits intomainfrom
evanhahn-ny-1101-editor-urls-do-not-paste
Mar 2, 2026
Merged

Allowed embedding in new welcome email editor#26649
EvanHahn merged 5 commits intomainfrom
evanhahn-ny-1101-editor-urls-do-not-paste

Conversation

@EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Mar 2, 2026

towards https://linear.app/ghost/issue/NY-1101
ref TryGhost/Koenig#1750

You can now paste URLs and use the bookmark card in the welcome email editor.

Screencast.mp4

towards https://linear.app/ghost/issue/NY-1101
ref TryGhost/Koenig#1750

You can now paste URLs and use the bookmark card in the welcome email
editor.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b20ca27 and 9affd43.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • apps/admin-x-framework/src/test/render.tsx
  • apps/admin-x-settings/test/acceptance/membership/member-welcome-emails.test.ts

Walkthrough

Adds a new React hook useKoenigFetchEmbed that fetches oEmbed data via the Ghost API; the hook is implemented in apps/admin-x-framework/src/hooks/use-koenig-fetch-embed.ts, exported from the framework hooks barrel and re-exported in the package index. The hook is used in the member email editor, unit and acceptance tests were added to verify requests and error handling, and related test/render wiring was adjusted.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Allowed embedding in new welcome email editor' accurately describes the main change: enabling URL embedding and bookmark card functionality in the welcome email editor.
Description check ✅ Passed The description clearly relates to the changeset, explaining that users can now paste URLs and use the bookmark card in the welcome email editor, with supporting references.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch evanhahn-ny-1101-editor-urls-do-not-paste

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.

@ErisDS
Copy link
Member

ErisDS commented Mar 2, 2026

🤖 Velo CI Failure Analysis

Classification: 🟠 SOFT FAIL

  • Workflow: CI
  • Failed Step: Run yarn nx run @tryghost/admin-x-settings:test:acceptance
  • Run: View failed run
    What failed: Test assertion failures in member welcome email tests
    Why: The root cause of the failure is test assertion failures in the member welcome email tests. This is a code issue, as the tests are failing due to the application code not meeting the expected behavior.
    Action:
    The author should investigate the failing tests, identify the root cause of the assertion failures, and fix the application code to ensure the tests pass.

9larsons added a commit to TryGhost/Koenig that referenced this pull request Mar 2, 2026
towards https://linear.app/ghost/issue/NY-1101
ref TryGhost/Ghost#26649

See TryGhost/Ghost#26649 for details on this change.

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
@9larsons
Copy link
Contributor

9larsons commented Mar 2, 2026

Bumping Koenig packages in #26654 and then we can update this branch.

@9larsons 9larsons marked this pull request as ready for review March 2, 2026 22:00
@9larsons 9larsons self-requested a review March 2, 2026 22:00
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/admin-x-settings/test/acceptance/membership/member-welcome-emails.test.ts`:
- Around line 226-265: The test is failing because the test IDs
embed-url-loading-container and embed-iframe referenced by the test do not
exist; either add these IDs where the Koenig editor renders embed state/iframe
in the MemberEmailEditor or WelcomeEmailModal (or inside KoenigEditorBase where
embed rendering occurs) or change the test to use the actual selectors/test IDs
currently emitted by those components; update the code in the component that
handles oEmbed loading/iframe rendering (look for MemberEmailEditor,
WelcomeEmailModal, and KoenigEditorBase) to include
data-testid="embed-url-loading-container" for the loading indicator and
data-testid="embed-iframe" on the rendered iframe element, or modify the test
assertions to target the existing DOM hooks instead.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between abcd9c3 and b20ca27.

📒 Files selected for processing (6)
  • apps/admin-x-framework/src/hooks.ts
  • apps/admin-x-framework/src/hooks/use-koenig-fetch-embed.ts
  • apps/admin-x-framework/src/index.ts
  • apps/admin-x-framework/test/unit/hooks/use-koenig-fetch-embed.test.ts
  • apps/admin-x-settings/src/components/settings/membership/member-emails/member-email-editor.tsx
  • apps/admin-x-settings/test/acceptance/membership/member-welcome-emails.test.ts

@ErisDS
Copy link
Member

ErisDS commented Mar 2, 2026

🤖 Velo CI Failure Analysis

Classification: 🟠 SOFT FAIL

  • Workflow: CI
  • Failed Step: Run yarn nx run @tryghost/admin-x-settings:test:acceptance
  • Run: View failed run
    What failed: Test assertion failures in member welcome email acceptance tests
    Why: The root cause of the failure is test assertion failures in the member welcome email acceptance tests. This is a code issue, as the tests are failing due to the application code not meeting the expected behavior.
    Action:
    The developer should investigate the failing tests, identify the root cause of the assertion failures, and fix the corresponding code in the application.

Copy link
Contributor

@9larsons 9larsons left a comment

Choose a reason for hiding this comment

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

We can likely clean up these tests however that's a project for another day. I'd sooner see us move settings into admin's app.

@EvanHahn EvanHahn merged commit c7eaf27 into main Mar 2, 2026
32 checks passed
@EvanHahn EvanHahn deleted the evanhahn-ny-1101-editor-urls-do-not-paste branch March 2, 2026 23:48
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.24%. Comparing base (3d562b1) to head (9affd43).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26649      +/-   ##
==========================================
- Coverage   73.24%   73.24%   -0.01%     
==========================================
  Files        1528     1528              
  Lines      120335   120335              
  Branches    14544    14544              
==========================================
- Hits        88139    88134       -5     
+ Misses      31195    31182      -13     
- Partials     1001     1019      +18     
Flag Coverage Δ
admin-tests 54.06% <ø> (-0.04%) ⬇️
e2e-tests 73.24% <ø> (-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.

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