Skip to content

Conversation

@meel-io
Copy link
Collaborator

@meel-io meel-io commented Oct 9, 2025

Description

Anchor tags can include the data-anchor-style attribute to identify style variations from the standard link. It was introduced to differentiate the Partner Content onward journey link from the standard link.

@meel-io meel-io changed the title ADSDEV-2383:: add styleType attribute to Link ADSDEV-2383: add styleType attribute to Link Oct 9, 2025
@meel-io meel-io force-pushed the ADSDEV-2383/data-anchor-style branch from 9b2761d to 241d781 Compare October 9, 2025 17:01
@meel-io meel-io marked this pull request as ready for review October 9, 2025 17:03
@meel-io meel-io requested review from a team as code owners October 9, 2025 17:03
Comment on lines 292 to 298
interface Link extends Parent {
type: "link"
url: string
title: string
children: Phrasing[]
styleType?: 'onward-journey-link'
}
Copy link
Contributor

Choose a reason for hiding this comment

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

(Non-blocking)
I wonder if we need to start documenting all our properties to help other Engineers but also to avoid that the language and the meaning of properties drift to much.
This is more related to other work we are doing.
See also suggestion/thoughts below...

/**
 * Represents a hyperlink element within rich text content.
 * @interface Link
 * @extends Parent
 * @property {'link'} type - Identifies this node as a link.
 * @property {string} url - The target URL of the link.
 * @property {string} title - The link’s title or tooltip text.
 * @property {Phrasing[]} children - The phrasing content inside the link.
 * 
 * @property {LinkStyle} [style] - Optional style. Use to define a style applied to the element based on the purpose of it.
* 
* @typedef {'recommendation'} A link that suggest to the user a follow-up document
 */
type LinkStyle = 'recommendation'

interface Link extends Parent {
	type: "link"
	url: string
	title: string
	children: Phrasing[]
	style?: LinkStyle
}

type LinkStyle = 'onward'
Couldn't onward just be a recommendation ?

styleType?: 'onward-journey-link'
Can we omit the term type? Just style could suffice

type LinkStyle = 'onward'
@adgad Could potential a LinkStyle separated type help to build a drop down menu for a Link component?

... define a style applied to the element based on the purpose of it.
@meel-io @adgad @apaleslimghost @elpopova The Content Tree is great, I'm a bit unsure about the principle behind the Tree and if we should bring some clarity. As mentioned in other PRs clarify perhaps some basic principles may help us build a better tree:

  • What is the purpose of the tree? Is it a UI representation or is it a rich document?
    E.g. Different meaning style: blue vs style: recommendation
  • (Not applicable to this PR) How strict do we want to be with types? A rich document may require more meaningful types that always strings

Copy link
Collaborator

@adgad adgad Oct 13, 2025

Choose a reason for hiding this comment

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

Couldn't onward just be a recommendation ?

I think this might get slightly confused with the recommended link type? @meel-io is "onward journey link" is how the terminology used by the stakeholders, design etc?

I would however suggest ditching the -link as it's kind of redundant here

Could potential a LinkStyle separated type help to build a drop down menu for a Link component?

Not something we do right now in Spark, but IMO having it as a separate type makes the purpose a bit clearer in the spec as well so I think it's a good idea!

What is the purpose of the tree? Is it a UI representation or is it a rich document?

I don't know if this directly answers the question, but IMO the tree should be capturing the data and editorial intent that drives the UI decisions, as opposed to the UI decisions themselves.

To take a concrete example, opinion toppers are all blue, but that itself isn't an active editorial decision - the decision is that it's an opinion topper, so in the tree we should only capture something like topperStyle=opinion. This would give us product flexibility to one day decide opinion = purple, without needing to republish all the content.
On the other hand, for split text toppers Editorial do explicitly choose a colour to match the image, so in the scenario the content tree should capture something like suggestedTopperColor=blue.

(we should deffo agree and document some of these principles!)

Copy link
Contributor

@umbobabo umbobabo Oct 13, 2025

Choose a reason for hiding this comment

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

is how the terminology used by the stakeholders

It would be good to align us with the stakeholders language. The challenges are about potentially duplications of similar terms because marketing people may us onward journey while editorial may recommend articles but they both mean a link too keep people engaged 😄 . onward-journey however seems fine to me here 👍

the tree should be capturing the data and editorial intent that drives the UI decisions

Yeah, I think we should doc the high level purpose of it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this might get slightly confused with the recommended link type? @meel-io is "onward journey link" is how the terminology used by the stakeholders, design etc?

I would however suggest ditching the -link as it's kind of redundant here

Yes, initially I thought I would map this value to something less redundant, like onward-journey on Content Pipeline but I decided against it to avoid confusion. But I will suggest changing it to onward-journey on C&M side.

@meel-io
Copy link
Collaborator Author

meel-io commented Oct 15, 2025

@umbobabo @adgad C&M has renamed the attribute value to onward-journey, as reflected on this PR. Are you happy with me merging this PR?

@adgad
Copy link
Collaborator

adgad commented Oct 15, 2025

I'll be happy, although it's still onward-journey-link here, are there unpushed changes perhaps?

This attribute will be used to differentiate a link styled for partner
content onward journey from standard links.
@meel-io meel-io force-pushed the ADSDEV-2383/data-anchor-style branch from 241d781 to bd083dc Compare October 16, 2025 07:48
@meel-io
Copy link
Collaborator Author

meel-io commented Oct 16, 2025

I'll be happy, although it's still onward-journey-link here, are there unpushed changes perhaps?

Sorry, somehow I forgot to push 🤦

@meel-io meel-io merged commit 326ca79 into main Oct 21, 2025
2 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.

5 participants