Skip to content

Conversation

@hasparus
Copy link
Member

@hasparus hasparus commented Sep 5, 2025

Description

@martinbonnin proposed making the "How it Works" code samples interactive on Slack.

We already had CodeMirror, and I already needed to restyle it for the docs, so it required just a new schema, some refactoring and shuffling things around.

I think the idea makes sense, and lets the user experience GraphQL immediately. Even if they're non-programmers, they can maybe get a feel how the data flows and what the experience is like.

I changed the section CTA to state "Try GraphiQL", because we're already trying it out live.

image

To-do

  • Write a small GraphQL Schema for this example
  • Double check if next/dynamic worked and we don't have CodeMirror in the main bundle
    • (I actually wrote dynamic(import instead of dynamic(() => import initially so it's good I double checked).
  • Add a test for this

@hasparus hasparus force-pushed the landing--interactive-editor-on-landing branch from 16bcd6c to 755ba27 Compare October 20, 2025 23:11
@jonathanawesome
Copy link
Contributor

Found an issue with how the InteractiveEditor sits on top of the static bits.

Screen.Recording.2025-10-24.at.2.12.45.PM.mov

@hasparus hasparus marked this pull request as draft October 26, 2025 07:21
@hasparus
Copy link
Member Author

Converted to draft to fix the mobile view bug Jon found in #2113 (comment).

@hasparus hasparus marked this pull request as ready for review October 27, 2025 21:56
Copy link
Contributor

@jonathanawesome jonathanawesome left a comment

Choose a reason for hiding this comment

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

Screen.Recording.2025-10-27.at.5.41.43.PM.mov

{inView && (
<ol
// this is rendered *on top* of the static version to avoid layout shift
className="max-lg:before pointer-events-none absolute inset-0 list-none gap-px [counter-set:list-item_1] *:pointer-events-auto max-lg:before:absolute max-lg:before:inset-x-0 max-lg:before:-top-2 max-lg:before:bottom-[98%] max-lg:before:bg-[rgb(var(--nextra-bg))] max-sm:top-[191px] sm:max-lg:top-[214px] lg:grid lg:grid-cols-3 lg:[&>:first-child]:col-start-2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be [counter-set:list-item_0] and lg:[&>:first-child]:col-start-1.

Copy link
Member Author

Choose a reason for hiding this comment

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

uh but the counters are okay now, aren't they?

Copy link
Member Author

Choose a reason for hiding this comment

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

even on the video where you recorded the bug

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, actually, I think you're right. It's possible that I hadn't pulled down your latest changes before checking, because I'm a different machine now, pulled your PR down fresh and it looks good!

)

return (
<>
Copy link
Contributor

Choose a reason for hiding this comment

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

rendering the first list item here, along with the css changes above, cleans things up nicely for me. it means rendering the first list item twice, but seems like a fair trade off.

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.

3 participants