Christian Grøngaard

@hamburger.cloud

Father of two children and countless software bugs Currently working on the text editor used in the very core of the @Sanity.io Content Operating System: https://github.com/portabletext/editor.

As expected, it was *incredibly* difficult to delete my Facebook account. However, after some UI debugging and browser switching, I finally succeeded, and it looks like 2026 is off to a flying start.

Maybe a 🌶️ take, but I generally don't like this trick. If one of your default/known values changes - e.g., "alert" is renamed to "warning" - your call sites won't break, and subtle, hard-to-discover bugs can be introduced. Any string is allowed, remember?

Jamie Kyle@jamie.build · last yr.

Neat little TypeScript trick: If you have a string or number type that you have some default/known values for: type Role = "alert" | "alertdialog" | string TypeScript will simplify the type to just: Role: string However if you wrap it like `string & {}` you'll preserve the autocompletions

Looks like last.fm still doesn't offer a way to export your data. So... I guess I might as well revive my 20-year-old account for the second(?) time! Do you have one? www.last.fm/user/christi... (I want to listen to more music again, and maybe this can be a weird sort of motivation.)

christianhg’s Music Profile | Last.fm

Listen to music from christianhg’s library (85,044 tracks played). christianhg’s top artists: Radiohead, The Beatles, Tom Waits. Get your own music profile at Last.fm, the world’s largest social music...

last.fm

It really is a special feeling sitting in your car, listening to a podcast, as you've done so many times before, but this time YOU'RE THE GUEST! Thank you, @simeongriggs.dev, for inviting me on to talk about Portable Text, text editors, Behaviours, Gherkin and state machines and more.

My car dashboard showing Code && Content episode "The final boss of front-end: block editors"
Simeon Griggs@simeongriggs.dev · last yr.

Have you ever tried building a block editor? I never enjoyed it until the Portable Text Editor arrived, so I had to talk to the guy (@hamburger.cloud) who built it! Watch on YouTube or listen to the podcast: youtu.be/_m_yyQ2HAZc

The Behavior API for @sanity.io's Portable Text Editor will allow you to configure the editor in ways that where previously not possible. Behaviors can be bundled in Plugins to easily turn them on and off. Here's an example of a simple <OneLinePlugin /> that restricts the editor to one block.

So cool that we can finally ship this as the first step towards a more pleasant and modern writing experience in the @sanity.io Studio. For the interested, here's a link to the source code of the markdown behaviours found in the Portable Text Editor repository: github.com/portabletext...

github.com

Simeon Griggs@simeongriggs.dev · 2y ago

One of those "finally!" features shipped in yesterday's Sanity Studio release. Markdown formatting shortcuts for the Portable Text Editor!

I wish GitHub (git?) was better at showing stacked diffs. Me: Let me carefully and surgically refactor this function in one commit and then rename it in the next commit GitHub: EVERYTHING CHANGED