Did we break PageDecoration when upgrading to 0.9?

I just find that all my pageDecorations are gone after my latest upgrade to 0.9, which are defined as following in the SETTINGS space-style block:

pageDecorations:
- where: "tags = 'person'"
  prefix: "🧑 "
- where: "tags = 'work'"
  prefix: "👜 "
- where: "tags = 'book'"
  prefix: "📔 "

I checked the documentation and related parts are already modified to a new syntax. But unfortunately I didn’t make it work with the new syntax as well. I wonder how this happens?

The settings key name has changed (now objectDecorators) and so has the syntax (slightly). Defining your example in SETTINGS (or space-config) would now be:

objectDecorators:
- where: 'tags = "person"'
  attributes:
    pageDecoration.prefix: '"🧑 "'
- where: 'tags = "work"'
  attributes:
    pageDecoration.prefix: '"👜 "'
- where: 'tags = "book"'
  attributes:
    pageDecoration.prefix: '"📔 "'

Hi Dan, Thanks for your help.

Your config helped me find out that there are two quotes used in this example. '"<emoji> "', which I neglected previously.

Why would this be the case? Wouldn’t that be redundant?

You’re welcome! Glad you got it sorted.

That’s a question for Zef, sorry. Think I did see him comment why it has to be this way, but I can’t find the comment now

Thanks for the explaination Dan!

It’s not redundant. We’re embedding an expression language expression inside of a yaml string. So to encode a string you need quotes around the quotes.

1 Like

Hi @zef, nice to see you.

Oh, that is cool. Does that mean I can do some complex expression in that string? Would be nice to see some example usage of such feature!

Have you found the manual page? It has some examples and more details.

OH, I did skimed that part but didn’t connect two together. :smile:

As far as I can see now, I can see how it is useful for the board object decoration concept, not specifically for the PageDecoration. But I’m looking forward to see creative usages of this flexible syntax!

Indeed, this is why I removed the original page decoration feature (which was super specific) and replaced it with something more generally useful.

That said…

Yes, but I’m also afraid of it :joy:

1 Like

By the way, not that I intend to do breaking changes all the time, but if you’re a power user it may be worth keep an eye on the CHANGELOG

Under 0.8.5 it mentions the old version of pageDecorations was removed and replaced by this one.

Ah, that is the reason I didn’t see the breaking change notification on 0.9.0. I didn’t keep an eye on the release on 0.8.5 so I missed that part. I was also curious why you didn’t mention this breaking change in the Changelog :rofl:

Breaking change is okey for me. TBH I think that is the necessary part that keeps a software moving forward.