Skip to content

fix(types): correct music OG type and add payment.link namespace#775

Merged
harlan-zw merged 2 commits into
mainfrom
fix/og-type-music-radio-station
Jun 12, 2026
Merged

fix(types): correct music OG type and add payment.link namespace#775
harlan-zw merged 2 commits into
mainfrom
fix/og-type-music-radio-station

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Resolves harlan-zw/zhead#29

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The ogType union had music.radio_status, but the Open Graph music namespace defines music.radio_station. This fixes the typo and, while in there, adds the beta payment namespace from ogp.me/ns/payment#.

New og:type value payment.link plus seven payment:* properties as flat useSeoMeta keys:

Flat key Meta tag
paymentDescription payment:description
paymentCurrency payment:currency
paymentAmount payment:amount
paymentExpiresAt payment:expires_at
paymentStatus payment:status (PENDING/PAID/FAILED/EXPIRED)
paymentId payment:id
paymentSuccessUrl payment:success_url

payment is registered in the OG namespace set so keys render as property tags, with aliases for the two multi-word keys and entries in validate/known.ts (payment:success_url counts as a URL). A useSeoMeta server test asserts the exact tag output.

The Open Graph music namespace defines music.radio_station, not
music.radio_status.

Fixes harlan-zw/zhead#29
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds payment OpenGraph properties and types, updates ogType literals (renames music radio type, adds payment.link), extends meta key resolution with payment aliases, updates known-property and URL validations, and adds a unit test covering payment meta output.

Changes

Payment OpenGraph & ogType

Layer / File(s) Summary
Schema: MetaFlat payment fields + ogType
packages/unhead/src/types/schema/metaFlat.ts, packages/unhead/src/types/schema/meta.ts
Adds MetaFlatPayment and makes MetaFlat extend it; expands MetaProperties with payment:* literals; renames 'music.radio_status''music.radio_station' and adds 'payment.link' to ogType.
Meta key classification & aliases
packages/unhead/src/utils/meta.ts
Adds payment to NAMESPACES.OG and maps paymentExpiresAtpayment:expires_at, paymentSuccessUrlpayment:success_url.
Validation: known properties and URL keys
packages/unhead/src/validate/known.ts
Adds payment:* entries to KNOWN_META_PROPERTIES and includes payment:success_url in URL_META_KEYS.
Unit test: payment namespace
packages/unhead/test/unit/server/useSeoMeta.test.ts
New test that sets payment* fields via useSeoMeta and asserts the generated SSR head tags with an inline snapshot.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit found keys in a mesh of tags,
Mapped expires and success through code that brags,
Payment fields snug in schema's light,
Radio fixed — now everything's right. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Changes directly address issue #29 by correcting music.radio_status to music.radio_station and auditing the full music namespace per ogp.me specifications.
Out of Scope Changes check ✅ Passed The payment namespace addition extends beyond the linked issue scope, but is justified by referencing the same upstream issue (harlan-zw/zhead#29) and represents a comprehensive OG namespace update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately captures the main change: fixing a music OG type typo and adding the payment.link namespace, matching the primary modifications in the changeset.
Description check ✅ Passed The description provides comprehensive context including a linked issue, type of change selection, detailed explanation of changes with a helpful table of flat keys and meta tags, and implementation details.

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

✨ 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 fix/og-type-music-radio-station

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.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Bundle Size Gzipped
Client (Minimal) 10.8 kB 4.4 kB
Server (Minimal) 10.7 kB 4.3 kB
Vue Client (Minimal) 11.8 kB 4.9 kB
Vue Server (Minimal) 11.7 kB 4.8 kB

Adds the beta OpenGraph payment namespace (https://ogp.me/ns/payment#):
payment:description, payment:currency, payment:amount, payment:expires_at,
payment:status, payment:id and payment:success_url, plus the payment.link
og:type. Flat keys serialize to property meta tags via the payment
namespace and multi-word keys (expires_at, success_url).
@harlan-zw harlan-zw changed the title fix(types): correct og:type music.radio_status to music.radio_station fix(types): correct music.radio_station + add payment.link OG namespace Jun 12, 2026
@harlan-zw harlan-zw changed the title fix(types): correct music.radio_station + add payment.link OG namespace fix(types): correct music.radio_station + add payment.link OG Jun 12, 2026
@harlan-zw harlan-zw changed the title fix(types): correct music.radio_station + add payment.link OG fix(types): correct music OG type and add payment.link namespace Jun 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/unhead/src/types/schema/metaFlat.ts (1)

90-142: Align MetaFlatPayment with ogp.me beta payment namespace + confirm URL validation

The 7 payment:* properties (description, currency, amount, expires_at, status, id, success_url) match the ogp.me beta payment namespace, and paymentStatus uses the correct allowed values. payment:success_url is already treated as a URL by the validator (packages/unhead/src/validate/known.ts includes it in URL_META_KEYS and KNOWN_META_PROPERTIES). Consider explicitly calling out the namespace’s “beta” status in the MetaFlatPayment docs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/unhead/src/types/schema/metaFlat.ts` around lines 90 - 142, Update
the MetaFlatPayment JSDoc to explicitly note that these payment:* properties map
to the ogp.me payment namespace which is currently in beta (mention "beta" and
link or reference ogp.me/ns/payment#), and confirm in the docs that
paymentSuccessUrl is treated as a URL by the validator; also verify that the
allowed values for paymentStatus ('PENDING' | 'PAID' | 'FAILED' | 'EXPIRED')
match the namespace. Reference the interface name MetaFlatPayment and the
property paymentSuccessUrl so reviewers can locate and edit the comment block,
and ensure the validator lists paymentSuccessUrl in URL_META_KEYS /
KNOWN_META_PROPERTIES if not already present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/unhead/src/types/schema/metaFlat.ts`:
- Around line 90-142: Update the MetaFlatPayment JSDoc to explicitly note that
these payment:* properties map to the ogp.me payment namespace which is
currently in beta (mention "beta" and link or reference ogp.me/ns/payment#), and
confirm in the docs that paymentSuccessUrl is treated as a URL by the validator;
also verify that the allowed values for paymentStatus ('PENDING' | 'PAID' |
'FAILED' | 'EXPIRED') match the namespace. Reference the interface name
MetaFlatPayment and the property paymentSuccessUrl so reviewers can locate and
edit the comment block, and ensure the validator lists paymentSuccessUrl in
URL_META_KEYS / KNOWN_META_PROPERTIES if not already present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cdbe52d2-b91c-4c05-bccf-7dc16c5cc6a7

📥 Commits

Reviewing files that changed from the base of the PR and between 66809f7 and a64e515.

📒 Files selected for processing (5)
  • packages/unhead/src/types/schema/meta.ts
  • packages/unhead/src/types/schema/metaFlat.ts
  • packages/unhead/src/utils/meta.ts
  • packages/unhead/src/validate/known.ts
  • packages/unhead/test/unit/server/useSeoMeta.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/unhead/src/validate/known.ts

@harlan-zw harlan-zw merged commit 800273a into main Jun 12, 2026
8 checks passed
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.

ogType music.radio_status does not exist

1 participant