sentry-docs icon indicating copy to clipboard operation
sentry-docs copied to clipboard

`SignInNote` should be rendered via `CodeBlock`

Open evanpurkhiser opened this issue 2 years ago • 7 comments

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

evanpurkhiser avatar Sep 05 '23 23:09 evanpurkhiser

Routing to @getsentry/product-owners-docs for triage ⏲️

getsantry[bot] avatar Sep 06 '23 19:09 getsantry[bot]

@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?

  1. 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.
  2. 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 👀

natikgadzhi avatar Oct 30 '23 00:10 natikgadzhi

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!

shanamatthews avatar Oct 31 '23 16:10 shanamatthews

Thank you for the early feedback! ❤️

Yep, I’ll work on this today then.

natikgadzhi avatar Oct 31 '23 16:10 natikgadzhi

@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.

natikgadzhi avatar Oct 31 '23 23:10 natikgadzhi

Is this issue still relevant @stephanie-anderson, @shanamatthews ?

a-hariti avatar Mar 04 '24 14:03 a-hariti

Yes, I still think this would be nice to have @a-hariti!

lizokm avatar Mar 04 '24 19:03 lizokm

Is this actually complete in the new website?

evanpurkhiser avatar May 06 '24 15:05 evanpurkhiser

@evanpurkhiser no, we will probably work on it after the deployment

a-hariti avatar May 06 '24 18:05 a-hariti