Skip to content

Conversation

@wKich
Copy link
Member

@wKich wKich commented Nov 9, 2021

Motivation

Storybook announced new feature interactive stories.

Approach

This spike shows how we can use that feature with our interactors.

  • The track method isn't exported for public usage.
  • We don't have a way to get interactor's and action's names as well as action's arguments to properly show them in Storybook debugger's UI.
  • We show all nested actions instead of top-level one.

@wKich wKich requested review from cowboyd and jnicklas November 9, 2021 06:59
@changeset-bot
Copy link

changeset-bot bot commented Nov 9, 2021

⚠️ No Changeset found

Latest commit: 4a0ae0f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Nov 9, 2021

✔️ Deploy Preview for interactors canceled.

🔨 Explore the source changes: 4a0ae0f

🔍 Inspect the deploy log: https://app.netlify.com/sites/interactors/deploys/61aefbbe98d7200007df999b

@cowboyd
Copy link
Member

cowboyd commented Nov 17, 2021

Dropping this here to track changes to storybook required to implement this storybookjs/storybook#16667

Comment on lines 102 to 108
wrapper: (
description: string,
action: () => Promise<T>,
type: ActionType,
options: InteractorOptions
) => () => Promise<T>
): () => boolean {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this wrapper should be a type:

export interface InteractionEvent<T> {
  description: string;
  action: () => Promise<T> ;
  type: ActionType;
  options: InteractionOptions;
}

export type InteractionHook<T> = (event: InteractionEvent<T>) => Promise<T>;

export function addActionWrapper<T>(hook: InteractionHook<T>): () => boolean {
  // add it
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. That was a little bit tricky to not break things

@wKich wKich requested a review from cowboyd December 3, 2021 07:13
@wKich
Copy link
Member Author

wKich commented Dec 7, 2021

Closed in favor of #162, #163, #164

@wKich wKich closed this Dec 7, 2021
@wKich wKich deleted the interactive-stories branch December 7, 2021 14:05
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