Describe the bug
Even if I set brandTitle, brandUrl, brandImage on theme object, It doesn't work at all(5.1.0-alpha.27)
To Reproduce
Set any combinations of brandTitle, brandUrl, brandImage of defined, undefined, null on theme object.
Expected behavior
SidebarHeading should be rendered according to the inputs from options
System:
It also doesn't work in 5.0.6
@KaboomFox Just FYI, reason for not working is different for version 5.0.6 and this 5.1.0-alpha.27.
Released version 5.0.6 had a bug and PR that fixes merged to 5.1.0.-alpha.7 which is not released yet.
Problem with this version(5.1.0-alpha.27 actually from 5.1.0-alpha.10) is that It is not working at all.
π
@lonyele So if I cherry-pick https://github.com/storybooks/storybook/pull/6120 into master do you think it will fix 5.0.x?
@shilman Yes, If you cherry-pick into master then It will fix for 5.0.x (solve #5866 #6476 )
However, If you release 5.1.x then the bug will arise with the exact same problem I stated here.
Thanks for the clarification @lonyele !
I'll release the patch and follow-up to make sure that the new bug gets fixed in 5.1.x
κ°μ¬ν©λλ€ π
@shilman Whaaaaaat μλ νμΈμ~ Recently, I've started trying to contribute to open source as a mean of learning. Let's see how it goes
@lonyele νμ΄ν ! γ γ γ γ
I just cleared my localstorage and this is what the brand section looks like

@hipstersmoothie I'm releasing a new version now with the fix from #6120. Can you try again in a few mins?
Yeah sure. I'm stepping through the code and it seems like my theme is represented in two different places in the state.

you can see ui.theme has the brandImage set properly and on the root (theme) does not
Also I'm currently on the latest storybook alpha
seems to be something to do with checkDeprecatedThemeOptions(options)
this line always returns true https://github.com/storybooks/storybook/blob/f07b2b7574611388ef45a4cb8a89389b434e257d/lib/api/src/modules/layout.ts#L119
which overrides all of these options on this line
Also from my reading of the code it seems like the keys of deprecatedThemeOptions are the deprecations and not the values. I think the appropriate code is
const checkDeprecatedThemeOptions = (options: Options) => {
// Check the deprecated options exist
if (Object.keys(deprecatedThemeOptions).find(v => !!options[v])) {
return applyDeprecatedThemeOptions(options);
}
return {};
};
applyDeprecatedThemeOptions would also need to be changed because it will override the configured theme.
const applyDeprecatedThemeOptions = deprecate(
({ name, url }: Options, userOptions: any): PartialThemeVars => ({
brandTitle: userOptions.brandTitle || name,
brandUrl: userOptions.brandUrl || url,
brandImage: userOptions.brandImage || null,
}),
deprecationMessage(deprecatedThemeOptions)
);
@shilman PR opened https://github.com/storybooks/storybook/pull/6543
My PR seems to fix the brandTitle and brandUrl but the image is still not there
It is this line
this prevents the user from setting a brandImage
Although it seems like the combination of these two PRs would solve my issues
https://github.com/storybooks/storybook/pull/6522
https://github.com/storybooks/storybook/pull/6476
Feel free to choose those over mine! It does about the same thing
Shiver me timbers!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.30 containing PR #6543 that references this issue. Upgrade today to try it out!
Because it's a pre-release you can find it on the @next NPM tag.
Ooh-la-la!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.10 containing PR #6543 that references this issue. Upgrade today to try it out!