Skip to content

Conversation

@ndelangen
Copy link
Member

@ndelangen ndelangen commented May 23, 2023

Closes #22597

What I did

I moved the code to load manager-head.html to a preset value, then get the value needed by the builder-manager via presrt.apply.
This allows the user to set this value via main.ts if they so desire.

I also added this as a valid presetProperty in StorybookConfig interface.

How to test

In a sandbox:

// main.ts
export default {
  //...
  managerHead: (head) => `
    ${head}
    <style id="hello">
        * {
            background: indianred;
        }
    </style>
 `
}

@ndelangen ndelangen self-assigned this May 23, 2023
@ndelangen ndelangen added bug patch:yes Bugfix & documentation PR that need to be picked to main branch core builder-manager labels May 23, 2023
@ndelangen ndelangen requested a review from shilman May 23, 2023 15:14
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

I added a "how to test" section to the description if we want to support the 6.5 API. The default implementation should read the value of manager-head.html if it exists and return its contents.

@shilman shilman changed the title Fix managerHead configuration possibility in main.ts Core: Fix managerHead preset in main.ts May 23, 2023
@ndelangen
Copy link
Member Author

The default implementation should read the value of manager-head.html if it exists and return its contents.

That's what it does, of course..
Am I missing something?

@shilman
Copy link
Member

shilman commented May 24, 2023

@ndelangen it just returns the filename. It does not return the contents of the file. Pleas read my "how to test" addition to the PR description

@ndelangen
Copy link
Member Author

Understood, I'll fix it.

@ndelangen
Copy link
Member Author

ok, fixed, and used your steps on how to test:
Screenshot 2023-05-24 at 09 55 25

@shilman shilman merged commit ec72653 into next May 24, 2023
@shilman shilman deleted the norbert/managerHead-in-main branch May 24, 2023 08:24
@shilman shilman mentioned this pull request May 24, 2023
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 24, 2023
shilman added a commit that referenced this pull request May 24, 2023
Core: Fix `managerHead` preset in `main.ts`
@shilman shilman mentioned this pull request May 24, 2023
@ndelangen ndelangen removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug builder-manager core patch:done Patch/release PRs already cherry-picked to main/release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Documentation]:

3 participants