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

Is there a way to clear the logs on story change? #25

Open
NikkiTheBugSlayer opened this issue Dec 19, 2019 · 5 comments
Open

Is there a way to clear the logs on story change? #25

NikkiTheBugSlayer opened this issue Dec 19, 2019 · 5 comments

Comments

@NikkiTheBugSlayer
Copy link

Is there a way to clear the logs on story change?

@d9k
Copy link

d9k commented Aug 1, 2021

:(

if (configureActions) {
configureActions({
clearOnStoryChange: false,
});
}

It's "feature" since Jul 21, 2019

e26d10b

I think plugin must not override other plugins options without ability to change that behavior

@d9k
Copy link

d9k commented Aug 1, 2021

You can still undo effect of clearOnStoryChange: false if you add lines:

import { configureActions } from '@storybook/addon-actions';

configureActions({
  clearOnStoryChange: true,
});

to .storybook/preview.js

@Cakeday
Copy link

Cakeday commented Nov 18, 2021

I dont think that this works^^:

// preview.js
const panelExclude = setConsoleOptions({}).panelExclude;
setConsoleOptions({
  panelExclude: [...panelExclude, /[msw]/, /[warn]/],
});
configureActions({
  clearOnStoryChange: true
})

Actions panel still does not clear between stories.

UPDATE from 2 minutes later: the above solution works if configureActions is called before setConsoleOptions:

configureActions({
  clearOnStoryChange: true
})
const panelExclude = setConsoleOptions({}).panelExclude;
setConsoleOptions({
  panelExclude: [...panelExclude, /[msw]/, /[warn]/],
});

@takurinton
Copy link
Contributor

@ndelangen
Do you know why this is being overwritten?
I couldn't tell from looking at past commits and issues in this repository...

#25 (comment)

I think plugin must not override other plugins options without ability to change that behavior

I agree. I am thinking that I could remove this part of the code.
What do you think??

@ndelangen
Copy link
Member

I don't really have a preference about it to be honest.

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

No branches or pull requests

5 participants