`SignInNote` should be rendered via `CodeBlock`
Instead of having to specify <SignInNode /> everywhere, we should detect code blocks that are using user-specific variables and render a nice indication that they need to sign in
Routing to @getsentry/product-owners-docs for triage ⏲️
@evanpurkhiser, I have a few free days, and I would love to work on this if you don't mind.
It looks like the docs automatically substitute ___PUBLIC_DSN___ and other keywords with a project selector (or an auth token generator button) if the user is signed in, in src/components/codeKeywords.tsx.
Nothing stopping us from lifting the regex test into src/components/codeBlock.tsx, checking it there, and render the invitation for the user to sign in if the block is using variables.
Would it make sense to do this in a few steps?
- Make the variable check in
CodeBlock, and render a notice block similar to the existing one above the code blocks that leverage user's information. I.e. just replace the current prompts with automatic ones. - Make it look nicer, perhaps put the login button into the code block top bar on the right, near the filename and the copy button?
If this approach makes sense, I can try putting a PR together 👀
Hey @natikgadzhi !
Sorry, I was out with covid for a couple of days there.
The approach sounds reasonable to me, if you still want to take a stab at it, I'd be happy to review!
Thank you for the early feedback! ❤️
Yep, I’ll work on this today then.
@shanamatthews alright, it seems to work well — I will clean up the existing SignInNotes, we can then review and ship this, and then see if we want to tweak the UI / visuals.
Is this issue still relevant @stephanie-anderson, @shanamatthews ?
Yes, I still think this would be nice to have @a-hariti!
Is this actually complete in the new website?
@evanpurkhiser no, we will probably work on it after the deployment