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

feat: node actions #18248

Merged
merged 25 commits into from
Nov 3, 2023
Merged

feat: node actions #18248

merged 25 commits into from
Nov 3, 2023

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Oct 27, 2023

Problem

The gap cursor logic didn't feel great the first time around

Still todo: Nice empty states to further encourage insertion of nodes in empty docs

Changes

  • Add a new "tiny" button style
  • Make the SlashCommandsPopover component more generic to support new insertion option
  • Moved some classes and constants into the utils file to avoid some circular dependencies
  • Remove the old NodeGapInsertionExtension
  • Remove the LemonButtonWithDropdown and add a linting rule on top of the deprecation

How did you test this code?

Made sure everything still worked manually

interaction

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why these broke...

@@ -87,7 +87,7 @@ export const TextOnly = (): JSX.Element => {
}

export const Sizes = (): JSX.Element => {
const sizes: LemonButtonProps['size'][] = ['small', 'medium', 'large']
const sizes: LemonButtonProps['size'][] = ['tiny' | 'small', 'medium', 'large']
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const sizes: LemonButtonProps['size'][] = ['tiny' | 'small', 'medium', 'large']
const sizes: LemonButtonProps['size'][] = ['tiny', 'small', 'medium', 'large']

@@ -102,7 +102,7 @@ export const Sizes = (): JSX.Element => {
}

export const SizesIconOnly = (): JSX.Element => {
const sizes: LemonButtonProps['size'][] = ['small', 'medium', 'large']
const sizes: LemonButtonProps['size'][] = ['tiny' | 'small', 'medium', 'large']
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const sizes: LemonButtonProps['size'][] = ['tiny' | 'small', 'medium', 'large']
const sizes: LemonButtonProps['size'][] = ['tiny', 'small', 'medium', 'large']

@@ -63,7 +63,7 @@ export interface LemonButtonPropsBase
/** Like plain `disabled`, except we enforce a reason to be shown in the tooltip. */
disabledReason?: string | null | false
noPadding?: boolean
size?: 'small' | 'medium' | 'large'
size?: 'tiny' | 'small' | 'medium' | 'large'
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if xsmall is better? Fits better with the tailwind-esque xs, sm, md, lg etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep 👍 Ideally we'd move everything to the xs, sm, etc... legend

{actions.map((x, i) => (
<LemonButton
key={i}
size="tiny"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the below should just be

/>
)
})
export const SlashCommandsPopover = forwardRef<SlashCommandsRef, SlashCommandsPopoverProps>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Something in here isn't working. With one node in the book, if I click add and pick something it replaces the node....

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

Lookin good. I pushed a small icon change but otherwise lets goooo

@daibhin daibhin merged commit f9c3f9f into master Nov 3, 2023
73 of 74 checks passed
@daibhin daibhin deleted the dn-feat/node-actions branch November 3, 2023 10:22
tomasfarias pushed a commit that referenced this pull request Nov 6, 2023
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