Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: snapshot notebook template #17413

Merged
merged 18 commits into from
Sep 14, 2023
Merged

Conversation

pauldambra
Copy link
Member

At some point lists stopped working in notebooks :/

This doesn't fix that (or at least not yet)

Update the introduction to render the formatting examples and add a story for it so we get a snapshot of rendered types

@pauldambra pauldambra requested a review from a team September 13, 2023 10:16
Copy link
Contributor

@daibhin daibhin left a comment

Choose a reason for hiding this comment

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

One tiny thing in the template but can be updated once we get to the root cause of lists

@@ -68,11 +69,56 @@ export const LOCAL_NOTEBOOK_TEMPLATES: NotebookType[] = [
],
},
{ type: 'paragraph', content: [{ type: 'text', text: '- List ' }] },
{ type: 'paragraph', content: [{ type: 'text', text: '1. Numbered list' }] },
{
type: 'bulletList',
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this not need to be orderedList if we're including numbers?

Copy link
Member Author

Choose a reason for hiding this comment

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

That might be the hook to grab hold of...

This was just from me typing into the UI. Weirdly the numbered list appears to work correctly but - and * lists don't

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm switching this up...

Will make a set of "if the JSONContent is correct" stories so we know we render valid JSONContent"

And then we can figure out how to test

"if someone types blah then we would render <template>blah</template> or whatevs

@pauldambra pauldambra force-pushed the chore/snapshot-notebook-template branch from 7014a14 to 27a2e90 Compare September 14, 2023 09:50
@PostHog PostHog deleted a comment from posthog-bot Sep 14, 2023
@PostHog PostHog deleted a comment from posthog-bot Sep 14, 2023
@PostHog PostHog deleted a comment from posthog-bot Sep 14, 2023
@PostHog PostHog deleted a comment from posthog-bot Sep 14, 2023
@PostHog PostHog deleted a comment from posthog-bot Sep 14, 2023
@PostHog PostHog deleted a comment from posthog-bot Sep 14, 2023
cy.get('li').contains('Notebooks').should('exist').click()
cy.get('[data-attr="new-notebook"]').click()
// we don't actually get a new notebook because the API is mocked
// so, press enter twice to "exit" the timestamp block we start in
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we should also be able to press esc to remove the insertion suggestion if that's what this is trying to achieve

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@pauldambra pauldambra merged commit 5906ea8 into master Sep 14, 2023
@pauldambra pauldambra deleted the chore/snapshot-notebook-template branch September 14, 2023 13:25
> ul {
list-style: initial;
> p {
display: inline-block;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we needed this? It makes the blinking cursor invisible in an empty list item. Removing it doesn't affect anything as far as I can see

Copy link
Member Author

Choose a reason for hiding this comment

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

At the point I added it it stopped the text dropping below the bullet point... may have been chance or fixed accidentally after that

Copy link
Contributor

Choose a reason for hiding this comment

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

No worries, I think the styles got a little mixed up since but was pretty easy to fix in #17521

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