Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Added PrintShop - #61

Merged
oliverlloyd merged 1 commit into
mainfrom
oliver/PrintShop-Design
Jan 21, 2021
Merged

Added PrintShop#61
oliverlloyd merged 1 commit into
mainfrom
oliver/PrintShop-Design

Conversation

@oliverlloyd

@oliverlloyd oliverlloyd commented Jan 18, 2021

Copy link
Copy Markdown
Contributor

What does this change?

Adds the PrintShop Design type

Why?

There are a series of articles classified as Guardian Print Shop articles. Unlike other series, these articles have their own design which is not represented in the Format model.

Screenshot 2021-01-18 at 20 46 04

Print shop articles are Immersive but they have no main media, instead they use the first element in the body as the 'main' image, typically setting the weighting of this image to immersive (but not always). Normally, the headline for an Immersive article is inverted and overlaid onto the main media but for Print Shop articles they expect the headline to sit above the first element, more akin to a normal article.

To accomodate these differences we had to create a noMainMedia prop in DCR but this is a poor solution and does not allow us to use the Editorial Palette to decide the headline colours.

Design.PrintShop would allow us to encapsulate these articles purely within the model

What about David Squires?

Naturally, there is an exception. Some print shop articles are different, having the article meta always below the headline and showing the article title in the left column. These are currently rendered as ng-interactives but if the work was done to update Composer then we could support another deisgn, Design.CartoonShop?

Screenshot 2021-01-18 at 20 51 11

@oliverlloyd

Copy link
Copy Markdown
Contributor Author

Design.PrintShop

@oliverlloyd

Copy link
Copy Markdown
Contributor Author

@rcrphillips You know a bit about these things, is this a fair representation of these articles or do we need to check with the Print Shop team to make sure we aren't missing anything here?

@rcrphillips

rcrphillips commented Jan 18, 2021

Copy link
Copy Markdown

There are also pieces which are a different content type altogether, which is 'picture'. So you've got immersive articles, interactives, cartoon/graphic/picture, all of which are different content types, that are tagged with the guardian print shop series. And DCR is only concerned with articles for now. I would say that it might not be worth including as it's own type, but it if it makes things a lot simpler for you, then fair enough. My hunch is that those are probably tagged with that series tag in order to do something automatically on the print shop site itself. @oliverlloyd hopefully that's clear as mud.

@paperboyo

paperboyo commented Jan 18, 2021

Copy link
Copy Markdown

I’m gonna add some mud (fight!). This is users getting cheeky and exploring the boundaries of what’s possible by playing with the switches. My hunch is that to follow that playfulness with a model change (I don’t really know what a Design type is!) is a wrong thing to do. We just have to (sorry) be able to support any article without main media and with a first element (yeah, not only an image) to be set to any weighting. This particular one (Immersive) should try to mimic the furniture looks of frontend only if Design thinks it’s what they want (because nobody ever designed it, or tested it, before users found this trick).

Chasing users finding tricks within the model with model changes will get us to choke on our own tail, I suppose.
EDIT: also, this has nothing to do with a Print Shop tag, other that its users found the trick and they probably are (rather well!) policing their precious find to not proliferate. But you can defo imagine this being applied to any article! Also, if Design type is about escaping tags having presentation implications… this may be a fool’s gold…

With freedom comes… PITA.

@oliverlloyd

oliverlloyd commented Jan 18, 2021

Copy link
Copy Markdown
Contributor Author

If Design type is about escaping tags having presentation implications… this may be a fool’s gold

It basically is that (the escaping part, not the fool's gold bit - I hope!). The larger goal here is to support an Editorial Colour Palette. We want to be able to decide the look of something based on Display (Immersive, Showcase, Standard), Design (Review, Recipe, Interview, etc.) and Pillar (aka Theme).

The challenge to this is, umm, well human nature and physics I guess. If a thing is possible in Composer, then given enough time (not very long) it will happen.

The model that we currently have is actually quite good. There are still some things to bring into it but it probably (hand waving) encompases 99% of active content. There's a long tail with weird stuff in it but this was always going to be a thing.

The problem with these loose couplings between Frontend and Composer (facilited with cleaners and conditional logic in the templates) is it doesn't scale and leads to the kinds of problems we want to solve with DCR. The downside with taking this it-must-meet-the-model position is that some content could 'break'. We're not there yet though, we support everything so far. But we have been quietly drawing some lines to stop people wandering off into the hinterlands and doing odd things - things they never have and probably never will, but things they could have done before. Stuff like, a paid advertisement labs piece under the News pillar or an Interview Opinion article. What were conventions before are now rules.

It's true though that there's probably more stuff like this out there and trying to capture it in a model could be an attempt to herd cats but I'm hopeful that Format is up to the task. It might get messy, there may be some tough calls needed or we might just end up with more Designs than we want but adding a new Design is cheap(ish) and if that's what we need capture the last few stray weird bits then I'm on board for that. That or we ban them but that would be harder to sell.

@oliverlloyd
oliverlloyd requested a review from gtrufitt January 18, 2021 22:42
@paperboyo

Copy link
Copy Markdown

Thanks, very clear! Some loose thoughts based of shaky understanding and half-strongly held views I’m only half in agreement with myself:

Display (Immersive, Showcase, Standard)
Looks like maps directly to Composer’s Display Hint. Ben wants some sensible movements there too (getting rid of Photo Esssay, Column and List IIUC and letting their small specificities to roam freely)

Design (Review, Recipe, Interview, etc.)
Looks like maps directly to (a subset of) tones.

Pillar
Looks like maps to… Pillar (decided by users adding a top keyword tag that lives under a Section is mapped under certain Pillar in Tag Manager, I think).

So not much to say here apart from : why new names (first two)? (although Composer weighting being CAPI role and more do not exactly set the bar high, hehe).

Otherwise, I’m all for more consistency, predictability and simplification for all concerned (devs, designers, users and… readers!). If that means limiting (some) options in Composer: 👍. Because

If a thing is possible in Composer, then given enough time (not very long) it will happen.

that. If we don’t want it to happen, we need to make it impossible. Your examples reveal my lack of specific knowledge, but:

  • Advert under News is just wrong, so not sure how that could be a thing (if design decided by top tag, it should be either News or Labs, I hope!).
  • Opinion Interview is a weird one, because Opinion is kinda both a section and a tone (like News). This is (one) reason for this daft “deprecated” Comment is free Blog type tag (to force a Section to not be News). Sport Opinion, or Culture Interview – entirely legit, though (tone+pillar). So the only reason, Opinion Interview isn’t more of a thing, is because they must loose the Comment tone. Here I summon one @itsibitzi, he the man (may have an idea of what’s confused and how to unconfuse if it it’s even possible).

I still think there is nothing special about this particular setup here with Print Shop. It just has no main media and first element is allowed to go wild, coz it’s Immersive too (so Immersive role is available for elements). Furn look comes from Immersive. Colours will depend on under which Pillar the Section that the first added tag dictates lands (so the usual) and the tone (again, usual). The only hard part from my naive POV is to make sure the CSS around furn and around no Main media and differently weighted first pic a) looks more or less like current frontend (only coz users expect that, if design decides differently – it should change) and b) doesn’t break. And that ads don’t overlap. But all that is true for all content, no?

The only way to limit the possibility of this trick would be to disallow creation of content without Main media, I guess. All the rest will still be possible and I can’t see limiting that. Actually, getting rid of Design hints and freeing element roles will make such combinations more likely.

I wrote too much. Again.

@paperboyo

Copy link
Copy Markdown

[maybe instead of what I wrote, I should write this]

we might just end up with more Designs than we want but adding a new Design is cheap(ish) and if that's what we need capture the last few stray weird bits then I'm on board for that.

👍 Sensible and pragmatic. I should learn (bit late for me, though, so not gonna try too hard ;-).

@gtrufitt

Copy link
Copy Markdown

Display (Immersive, Showcase, Standard) Looks like maps directly to Composer’s Display Hint

Correct, we're talking to Ben about the removal of some display hints.

Design

Maps to DesignType: https://docs.google.com/document/d/1PLc-kGnO7aYJ-mkmsLctFK0etBNyHlWvHrS33hcLhtM/edit#heading=h.jkpehtc5tksn

Tones don't exist in DCR - I explicitly wanted to remove any reference to a tone, either a tone fits within the Format type or maps functionality in components directly by a boolean. Tones were a major source of bugs in Frontend.

why new names (first two)?

Partly agree, we should maybe have used the existing nomleclature of DisplayHint and DesignType, but I think they're close enough to not be a problem.

Frankly though, I am of the strong opinion that if Format does not meet the requirements of a content type, we strongly review the content type first.

Advert under News is just wrong

Things like this must be controlled in Composer.

But, that said, I am not sure a Design for Print shop is the fix for lack of main media as @paperboyo says "We just have to (sorry) be able to support any article without main media" - Not every article without a main media is going to be a print shop article, so we need to handle lack of main media somewhere else.

So this "To accomodate these differences we had to create a noMainMedia prop in DCR but this is a poor solution" would still be needed.

But the difference in design and layout does hold up to needing a Design for print shop. Modifying the headline colours fits within the Editorial Colour Palette requirements.

@gtrufitt
gtrufitt requested a review from SiAdcock January 19, 2021 08:26
@paperboyo

Copy link
Copy Markdown

[not directly related to the PR]

Tones don't exist in DCR

Whoa! Radical! Half of me feels ecstatic we have less things, the other half would ask: how does a Sport editor apply a (Sport) Comment Tone to a piece, then? (in the same way and you mangle it on the way in and just don’t use it directly?). As far as presentation derived from tags goes, tags of type tone were always the least crazy (you can have just one, there is a finite list etc).

@nitro-marky

nitro-marky commented Jan 19, 2021

Copy link
Copy Markdown

I think if we go the prop route like noMainMedia we'll most likely have to keep adding more props for minor changes people want along the way which will inevitably make maintainability of the code more time consuming. Every component will have to be updated every time (even if it never really uses that prop) there is a minor change which will lead to a lot of coupling!

@gtrufitt

Copy link
Copy Markdown

I think if we go the prop route like noMainMedia we'll most likely have to keep adding more props for minor changes people want along the way

@nitro-marky Could you elaborate on this? No main media is possible across all article types already, so it doesn't fit nicely in a Design I don't think. Why would supporting this mean adding more props in the future?

@gtrufitt

Copy link
Copy Markdown

how does a Sport editor apply a (Sport) Comment Tone to a piece, then?

@paperboyo What's a sport comment tone? (got an example?)

Sounds like DesignType = Comment, Pillar = Sport ?

@nitro-marky

nitro-marky commented Jan 19, 2021

Copy link
Copy Markdown

I think if we go the prop route like noMainMedia we'll most likely have to keep adding more props for minor changes people want along the way

@nitro-marky Could you elaborate on this? No main media is possible across all article types already, so it doesn't fit nicely in a Design I don't think. Why would supporting this mean adding more props in the future?

If it already exists then it's not a problem, I'm just wary of trying to make an article type fit all situations by increasing the amount of props (which may not be necessary). Kind of similar to the Liskov principle (the duck and all that), just something to be aware of, if more props need to be added then abstraction/separation of concerns might need to be considered.

@paperboyo

paperboyo commented Jan 19, 2021

Copy link
Copy Markdown

@gtrufitt

@paperboyo What's a sport comment tone? (got an example?)
Sounds like DesignType = Comment, Pillar = Sport ?

Yep.

Tones can be used on any content, from any section. I will repeat an example from above: https://www.theguardian.com/sport+tone/comment (just add this tag combiner to any section URL; and let’s just make DCR fronts accept any arbitrary CAPI query ;-)

They were invented specifically to signal the editorial “type” of content: opinion piece, an interview, an analysis etc. (as opposed to tech “type” like video, article, gallery etc). Their functionality and their bearing on presentation have to be retained by DCR and AR, otherwise it would mean a major upset and I know nothing of any plans like that. And they do make sense. Ofc, that doesn’t mean you have to use them directly, you can parse them into your helpers as you please, goes without saying.

@gtrufitt

gtrufitt commented Jan 19, 2021

Copy link
Copy Markdown

Their functionality and their bearing on presentation have to be retained by DCR and AR, otherwise it would mean a major upset and I know nothing of any plans like that.

I will note that DCR is serving 90% of the audience and supports 94% of article content now, so if something isn't right I'd hope we would have seen it by now!

(Looking at that type, sport comment on Frontend (dcr=false) and DCR are largely identical)

@mchv

mchv commented Jan 19, 2021

Copy link
Copy Markdown

Just adding to this discussion that it is essential that the type of article is correctly model in our Content API.

Why is it important?
Because content is produced exclusively for the web or apps, it as well on a myriad of other renderers or applications that deal with this content and where information from guardian/types is not consumed or where designType can't be filtered on:

  • our off-platform, i.e MSN, Google News, Facebook News, Apple News, etc...
  • our editorial tools, i.e composer, workflow, atom-workshop, etc..
  • our analytics tools, i.e Ophan and and BigQuery dashboads

As mentioned per @paperboyo, we already have the concept of cartoon and articles that are cartoons should have that tone and be modelled correctly on CAPI side. Cartoons rendered as ng-interactives are for instant painful to deal with in off-platform, you have to specifically include each of them in the right category (in other words it does not scale)

Tones don't exist in DCR
I explicitly wanted to remove any reference to a tone, either a tone fits within the Format type or maps functionality in components directly by a boolean. Tones were a major source of bugs in Frontend.

If we would like to deprecate tone I think we should in the long term do this CAPI and Composer level not only at rendering level. Otherwise we become blind of the content produced in a certain way and we can't filter on it directly in CAPI.

Hope that makes sense.

@gtrufitt

Copy link
Copy Markdown

If we would like to deprecate tone I think we should in the long term do this CAPI and Composer level not only at rendering level. Otherwise we become blind of the content produced in a certain way and we can't filter on it directly in CAPI.

I think what builds a Format is represented in the CAPI Client

@oliverlloyd

Copy link
Copy Markdown
Contributor Author

I wanted to circle back to why I'm trying to add PrintShop as a design type; I'm not sure I explained it as well as I could have in the description.

The wider goal that this PR supports is Editorial Palette. We want to be able make decisions about the design of an article, based on Format where Format is:

interface Format {
	theme: Pillar | Special;
	design: Design;
	display: Display;
}

By using this definition we can write functions like this (which is proposed here):

const getHeadlineColour = (format: Format): string => {
	switch (format.display) {
		case Display.Immersive:
			return 'white';
		case Display.Showcase:
		case Display.Standard: {
			switch (format.designType) {
				case 'Review':
				case 'Recipe':
				case 'Feature':
					return pillarPalette[format.pillar].dark;
				case 'Interview':
					return 'white';
				default:
					return 'black';
			}
		}
		default:
			return 'black';
	}
};

But that function fails on print shop content at the moment and it fails because the headline colour changes based on if there is main media present on the page or not and format does not contain this information. In order to support this logic in DCR means we start on the path of breaking the models and patterns that have been setup within DCR to combat the scaling issues seen in Frontend. We could do some thing like const getHeadlineColour = (format: Format, noMainMedia: boolean): string => { but this feels like the dark side.

Next Steps

I'm proposing we:

  1. Merge this PR and codify this design type. This unblocks DCR and lets us move forward with supporting print shop articles and with introducing an Editorial Palette.
  2. Talk to Tools and Editorial about our desire to codefy what is currently a convention. Namely, that when an article is given the print shop tag, it won't have any main media.

Then, assuming that Editorial are aware of this limitation and are in agreement that this aligns with how they expect these articles to work, we then ask tools to make Composer disallow main media when the print shop tag is present

If the agreement is in place and the convention is already known, then the actual Composer limit is not essential. The agreement is key. We take what was a trick that someone found in Composer one day and transform it into a strictly typed design.

Finally, if no agreement is found, and it come to light that Editorial have other requirements or expectations, then we refactor Types & DCR to manage this.

@JamieB-gu

Copy link
Copy Markdown
Contributor

Wow this is quite a discussion.

Display (Immersive, Showcase, Standard)
Looks like maps directly to Composer’s Display Hint

Unfortunately it's not that simple, and this gets to the heart of why we came up with a completely new type with new names. Display.Immersive is usually derived from displayHint, but Display.Showcase comes from the role on the main media image.

Design (Review, Recipe, Interview, etc.)
Looks like maps directly to (a subset of) tones.

Again, I'm afraid it's not that simple. Tone tags are a part of the information used to derive Design, but it's by no means a direct mapping:

  • sometimes multiple "tones" map to the same Design (e.g. tone/reviews, tone/livereview and tone/albumreview all become Design.Review)
  • sometimes Design is derived from one or more type tags (e.g. type/audio, type/video and type/gallery all become Design.Media)
  • sometimes Design is derived from the ContentType field (e.g. Design.Interactive comes from ContentType.Interactive)

and so on. Again, this is why we have new types with new names.

Design

Maps to DesignType: https://docs.google.com/document/d/1PLc-kGnO7aYJ-mkmsLctFK0etBNyHlWvHrS33hcLhtM/edit#heading=h.jkpehtc5tksn

As @gtrufitt said this is originally where the Format type came from, and much of this carries over to the Design field. However, we've updated and modified it since then (e.g. DesignType.Immersive is now a Display rather than a Design, AdvertisementFeature is Theme.Labs rather than a Design etc.).

@paperboyo What's a sport comment tone? (got an example?)

Sounds like DesignType = Comment, Pillar = Sport ?

In the Format world this would become:

const format: Format = {
  design: Design.Comment,
  theme: Pillar.Sport,
  display: Display.Standard,
};

Pillar (aka Theme)

Pillar
Looks like maps to… Pillar

Be careful referring to this field as pillar, it's actually theme because of special reports and labs. Pillar is a subset of Theme.

it is essential that the type of article is correctly model in our Content API.

If we would like to deprecate tone I think we should in the long term do this CAPI and Composer level not only at rendering level.

I agree @mchv. @rcrphillips has already facilitated a conversation between the Dotcom, Apps, CAPI and Tools teams about the possibility of Format making its way upstream to CAPI and the tools (Composer).

@oliverlloyd

oliverlloyd commented Jan 21, 2021

Copy link
Copy Markdown
Contributor Author

@blishen @paperboyo @mchv @JamieB-gu @gtrufitt Some of us discussed this yesterday but we didn't come to a firm conclusion and I wanted to bring this up again as this decision feeds into a lot of the core work we are doing in DCR.

My feeling here is that, by convention, Print Shop articles are a thing. We call them 'Print Shop' articles. But in Composer they are just a trick, they are what happens when you set display hint to immersive but then don't set main media.

I think that it is okay, valid even, for us to change the model that we use for DCR and AR to encapsulate this 'type' of article, even if it isn't represented by CAPI and even if we do nothing in Composer. We are already doing this in many other situations.

So where an article has tag with id artanddesign/series/guardian-print-shop, set Design to PrintShop. If this logic turns out to be wrong, missing some scope or not handling all design aspects, then I think it's valid to revisit this and refactor. We do this all the time in other areas and it is the intended flow (as far as I see it).

If we don't set this Design then the alternative is we must accept that we cannot fully represent all articles using Format and that, as well as Editorial Palette based on Format, we will also have additional logic in the code. So instead of:

const getHeadlineColour = (format: Format): string => {
	switch (format.display) {
		case Display.Immersive:
			return 'white';
		case Display.Showcase:
		case Display.Standard: {
			switch (format.designType) {
				case 'Review':
				case 'Recipe':
				case 'Feature':
					return pillarPalette[format.pillar].dark;
				case 'Interview':
					return 'white';
				default:
					return 'black';
			}
		}
		default:
			return 'black';
	}
};

we will need to:

const getHeadlineColour = (format: Format, noMainMedia: boolean): string => {
	switch (format.display) {
		case Display.Immersive:
                        if(noMainMedia) return 'black';
                        else return 'white';
		case Display.Showcase:
		case Display.Standard: {
			switch (format.designType) {
				case 'Review':
				case 'Recipe':
				case 'Feature':
					return pillarPalette[format.pillar].dark;
				case 'Interview':
					return 'white';
				default:
					return 'black';
			}
		}
		default:
			return 'black';
	}
};

This is possible, perhaps inevitable, and seems innocent enough but it breaks the goals we - DCR, AR, Ben and Harry, etc - have been working towards for nearly a year now and my concern is once you cross this line in the sand the value of EditorialPalette will gradually reduce as more props are added to handle edge cases outside the model (or worse, just because future developers will read te code and learn that adding props is okay and assume this is the right way to do things).

@paperboyo

Copy link
Copy Markdown

an article has tag with id artanddesign/series/guardian-print-shop, set Design to PrintShop

The only problem I can see is that we don’t know if there are other articles outside of this series with no Main media and a first element in body set to Immersive role… I asked CAPI, but it’s not clear if we are able to search for them. There is nothing stopping users to have no Main media on any article, subsequently there is nothing stopping them to choosing any available role for the first element in the body (incl. Immersive and Dessign Hint is Immersive too).

@gtrufitt

gtrufitt commented Jan 21, 2021

Copy link
Copy Markdown

We need to unblock this, so based on conversation and current behaviour in platforms, we're going to go ahead with this approach:

  • PrintShop becomes a Design and has special handling. We want to keep the integrity of the model to ensure that future maintenance and flexibility of the platforms is maintained.
  • Convention will apply (as is the case in many places) to 'No main media in immersive articles' not being supported outside of PrintShop (and the other minor cases). This will have to be the case if the Editorial Tools do not explicitly prevent the user from doing this.
  • Preview will work as is currently the case
  • If there are future cases where we want this behaviour, they will explicitly go through a design process and become a new or follow on from an existing Design

We will get final confirmation from central production that there are no other cases that we need to support outside of those identified.

We can iterate on this, of course, and if we find it's the wrong decision then we will need to refactor but at this point this is purest approach that doesn't tie ourselves in knots for the future.

@JamieB-gu

Copy link
Copy Markdown
Contributor

we don’t know if there are other articles outside of this series with no Main media and a first element in body set to Immersive role

This was my concern too - it's not currently artanddesign/series/guardian-print-shop that causes these styles, it's that ^.

  • Convention will apply (as is the case in many places) to 'No main media in immersive articles' not being supported outside of PrintShop (and the other minor cases).

This sounds like a sensible solution to me - we only support this for print shop.

I believe one consequence of this is that if an article is tagged "print shop" but does have a main media set, the main media will be ignored? I think this is the right behaviour, but just bringing it up in case it puzzles someone in Editorial @paperboyo.

Excellent summary btw @gtrufitt, very well put!

@oliverlloyd

Copy link
Copy Markdown
Contributor Author

if an article is tagged "print shop" but does have a main media set, the main media will be ignored?

Actually, no, not right now. It will break the current design because the headline text will be black, not white, but there's no logic to ignore the main media if it exists. If you break the convention like this then you break the article.

It's worth pointing out though that going forward where DCR is used for Preview (most places now) then things like this will be immediately evident. The risk is, as @paperboyo says, if there is legacy Immersive content with no main media which is what we want to learn from cp.

@JamieB-gu

Copy link
Copy Markdown
Contributor

@oliverlloyd will this be v3.0.0?

@paperboyo

Copy link
Copy Markdown

risk is [other than series/print-shop] legacy Immersive content with no main media

Or, them breaking the convention for this series as arbitrarily as they have adopted it? Or existing content in this series that is not using this trick (+photoEssay, anyone?)?. Or other ppl figuring out this trick? Or DCAR starting to render other content types in this series: picture, interactive etc?

@oliverlloyd

Copy link
Copy Markdown
Contributor Author

@oliverlloyd will this be v3.0.0?

Yep 👍 Although, adding new types isn't breaking for DCR as far as I recall because we use switch statements and default out but we can't depend on that being the case everywhere

@oliverlloyd

Copy link
Copy Markdown
Contributor Author

risk is [other than series/print-shop] legacy Immersive content with no main media

Or, them breaking the convention for this series as arbitrarily as they have adopted it? Or existing content in this series that is not using this trick (+photoEssay, anyone?)?. Or other ppl figuring out this trick? Or DCAR starting to render other content types in this series: picture, interactive etc?

For all new content, I'm less concerned because this trick will no longer work. From now on (once we merge and add these changes), if you remove main media from an immersive article it will look wrong in Preview (except for a few article types over the next few weeks while we finish the DCR migration which still show in the Frontend version in Preview)

@oliverlloyd
oliverlloyd merged commit 79f0b72 into main Jan 21, 2021
@oliverlloyd
oliverlloyd deleted the oliver/PrintShop-Design branch January 21, 2021 22:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants