-
Notifications
You must be signed in to change notification settings - Fork 3
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
Almost working: allow/document how to use this when root storybook hosted at path #9
Comments
In case helpful, here's the PR where I made most of the changes (tho I did a few on mainline after merging): CivicTechTO/polis-storybook#8 |
Hello @patcon! Thank you for using the addon and for the kind words, much appreciated 🙏 This is not well documented but you can provide a custom hostname and base URL to the addon from your Storybook configuration in the Here is an exemple based on your configuration: /** @type { import('@storybook/react').Preview } */
const preview = {
parameters: {
branches: {
hostname: "civictechto.github.io/polis-storybook",
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};
export default preview; But I will check if we can use a Storybook variable to compute this value. |
Ah, thanks a million! Spent a little while exploring, but wasn't having any luck. But I tried your suggestion, and it mostly works -- so your message is perfectly timed to leave me with a small feeling of success at the end of the day :) It now mostly works, but even when I copy that param config change to all branches, I can get to the branch instances (from Screen.Recording.2024-10-07.at.7.17.41.PM.movI'll see if I can reason through what the issue is, but thanks for your help already 🙏 |
|
Ah wow. OK, I lost a few hours on this, but when working locally: I didn't realize that it was getting a specific commit from github, and checking that out, instead of the branch head. Might want to make it more clear in the output what commit is being checked out. I was committing my troubleshooting changes to all branches, but wasn't pushing it beyond local. If this seems like an understandable point of confusion, I can imagine 2 possible mitigations:
Would either of these be acceptable to you as PRs? PS, it also seems to be the case that the above hack you suggested only works when Thanks again |
Wondering if maybe a {
// ...
"provider": {
"type": "local",
// See below for thoughts on key name.
"featureBranches": {
"PR-7": "7-some-branch",
"PR-9": "9-some-other-branch",
"random-label": "literally-whatever-commit-ish",
}
}
}
Happy to spin this out into its own issue, if you think it has merit :) |
Another edge-case: Screen.Recording.2024-10-08.at.3.11.30.PM.mov |
This is such a cool addon, and great for avoiding the limits of Chromatic and just hosting on github pages! Thank you, thank you, thank you 🙌
Just one issue: the picker links don't deal with storybooks hosted at
username.github.io/
, but notusername.github.io/repo/
I'm assuming this happens during the build, because the label "PR-7" comes from github itself. Will scope around a bit more, but I don't think there's a setting for this.
If it is, I'm happy to improve the document and submit a PR :)
Thanks for any advice
The text was updated successfully, but these errors were encountered: