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

Release: Prerelease 8.5.0-alpha.8 #29657

Merged
merged 69 commits into from
Nov 19, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 19, 2024

This is an automated pull request that bumps the version from 8.5.0-alpha.7 to 8.5.0-alpha.8.
Once this pull request is merged, it will trigger a new release of version 8.5.0-alpha.8.
If you're not a core maintainer with permissions to release you can ignore this pull request.

To do

Before merging the PR, there are a few QA steps to go through:

  • Add the "freeze" label to this PR, to ensure it doesn't get automatically forced pushed by new changes.
  • Add the "ci:daily" label to this PR, to trigger the full test suite to run on this PR.

And for each change below:

  1. Ensure the change is appropriate for the version bump. E.g. patch release should only contain patches, not new or de-stabilizing features. If a change is not appropriate, revert the PR.
  2. Ensure the PR is labeled correctly with one of: "BREAKING CHANGE", "feature request", "bug", "maintenance", "dependencies", "documentation", "build", "unknown".
  3. Ensure the PR title is correct, and follows the format "[Area]: [Summary]", e.g. "React: Fix hooks in CSF3 render functions". If it is not correct, change the title in the PR.
    • Areas include: React, Vue, Core, Docs, Controls, etc.
    • First word of summary indicates the type: “Add”, “Fix”, “Upgrade”, etc.
    • The entire title should fit on a line

This is a list of all the PRs merged and commits pushed directly to next, that will be part of this release:

  • ✨ Feature Request: UI: Sidebar context menu addon API #29557
  • 📝 Documentation: Docs: Readme - Fix the Twitter links #29614
  • 📝 Documentation: Docs: Resolutions documentation minor cleanup #29630

If you've made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with this workflow and wait for it to finish. It will wipe your progress in this to do, which is expected.

Feel free to manually commit any changes necessary to this branch after you've done the last re-generation, following the Make Manual Changes section in the docs, especially if you're making changes to the changelog.

When everything above is done:


Generated changelog

8.5.0-alpha.8

Greptile Summary

This PR introduces a new sidebar context menu addon API in Storybook 8.5.0-alpha.8, enabling addons to inject custom links and actions through an experimental test provider interface.

  • Added sidebarContextMenu property to Addon_TestProviderType in code/core/src/types/modules/addons.ts for custom menu items
  • Implemented new ContextMenu component in code/core/src/manager/components/sidebar/ContextMenu.tsx for managing addon menu items
  • Added experimental test module in code/core/src/manager-api/modules/experimental_testmodule.ts for test provider state management
  • Modified TooltipLinkList in code/core/src/components/components/tooltip/TooltipLinkList.tsx to support custom content
  • Note: Manager bundle size increased by 7.6% (+156kB) due to new features

@github-actions github-actions bot requested a review from kylegach as a code owner November 19, 2024 12:37
@github-actions github-actions bot added the release For PRs that trigger new releases. Automated label Nov 19, 2024
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

49 file(s) reviewed, 17 comment(s)
Edit PR Review Bot Settings | Greptile

} else if (state.failed && !errorMessage) {
description = '';
} else if (state.crashed || (state.failed && errorMessage)) {
description = 'An error occured';
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: 'occured' is misspelled, should be 'occurred'

Comment on lines +31 to +32
const id = useRef(context.id);
id.current = context.id;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Storing id in ref and immediately updating current is redundant since id never changes. Could just use context.id directly.


export function PanelTitle() {
const [addonState = {}] = useAddonState(ADDON_ID);
const { hasException, interactionsCount } = addonState as any;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Replace as any with proper type definition for addonState to improve type safety

Comment on lines +16 to +20
{interactionsCount && !hasException ? (
<Badge status="neutral">{interactionsCount}</Badge>
) : null}
{hasException ? <Badge status="negative">{interactionsCount}</Badge> : null}
</Spaced>
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Badge rendering logic could be simplified to a single conditional with ternary operator to determine status

import { getRelativeTimeString } from '../manager';

export const RelativeTime = ({ timestamp, testCount }: { timestamp: Date; testCount: number }) => {
const [relativeTimeString, setRelativeTimeString] = useState(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

style: useState initial value should be typed as string | null

Comment on lines +33 to +34
const Description = state.description!;
const Title = state.title!;
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Non-null assertions (!) on state.description and state.title are unsafe. Should validate these exist before accessing.

Comment on lines 58 to 63
const SidebarMenuList: FC<{
menu: MenuList;
onHide: () => void;
}> = ({ menu, onHide }) => {
const links = useMemo(
() =>
menu.map((group) =>
group.map(({ onClick, ...rest }) => ({
...rest,
onClick: ((event, item) => {
if (onClick) {
onClick(event, item);
}
onHide();
}) as ClickHandler,
}))
),
[menu, onHide]
);
return <TooltipLinkList links={links} />;
onClick: () => void;
}> = ({ menu, onClick }) => {
return <TooltipLinkList links={menu} onClick={onClick} />;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Menu click handling has been simplified but may lose event/item data that was previously passed through. Verify this change doesn't break existing menu item click behaviors.

@@ -118,7 +101,7 @@ export const SidebarMenu: FC<SidebarMenuProps> = ({ menu, isHighlighted, onClick
<WithTooltip
placement="top"
closeOnOutsideClick
tooltip={({ onHide }) => <SidebarMenuList onHide={onHide} menu={menu} />}
tooltip={({ onHide }) => <SidebarMenuList onClick={onHide} menu={menu} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Passing onHide directly as onClick loses the event object that may be needed by menu item handlers

})),
},
getElements: fn(() => ({})),
} as any as API,
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider using a proper type instead of any as API to maintain type safety

Comment on lines +68 to +75
const managerContext: any = {
api: {
runTestProvider: fn().mockName('api::runTestProvider'),
cancelTestProvider: fn().mockName('api::cancelTestProvider'),
updateTestProviderState: fn().mockName('api::updateTestProviderState'),
setTestProviderWatchMode: fn().mockName('api::setTestProviderWatchMode'),
},
};
Copy link
Contributor

Choose a reason for hiding this comment

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

style: managerContext is typed as 'any' - consider creating a proper type for the API interface

@JReinhold JReinhold added freeze Freeze the Release PR with this label ci:daily Run the CI jobs that normally run in the daily job. labels Nov 19, 2024
@JReinhold JReinhold self-assigned this Nov 19, 2024
Copy link

nx-cloud bot commented Nov 19, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 48a7a51. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@storybook-pr-benchmarking
Copy link

Package Benchmarks

Commit: 48a7a51, ran on 19 November 2024 at 14:12:01 UTC

The following packages have significant changes to their size or dependencies:

@storybook/core

Before After Difference
Dependency count 46 46 0
Self size 19.08 MB 19.24 MB 🚨 +168 KB 🚨
Dependency size 14.29 MB 14.29 MB 0 B
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 47 47 0
Self size 22 KB 22 KB 0 B
Dependency size 33.37 MB 33.54 MB 🚨 +168 KB 🚨
Bundle Size Analyzer Link Link

sb

Before After Difference
Dependency count 48 48 0
Self size 1 KB 1 KB 0 B
Dependency size 33.39 MB 33.56 MB 🚨 +168 KB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 390 390 0
Self size 483 KB 483 KB 0 B
Dependency size 74.43 MB 74.60 MB 🚨 +168 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 270 270 0
Self size 612 KB 612 KB 0 B
Dependency size 64.43 MB 64.60 MB 🚨 +168 KB 🚨
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 105 105 0
Self size 1.11 MB 1.11 MB 0 B
Dependency size 42.37 MB 42.54 MB 🚨 +168 KB 🚨
Bundle Size Analyzer Link Link

@JReinhold JReinhold mentioned this pull request Nov 19, 2024
8 tasks
@JReinhold JReinhold merged commit 57a3301 into next-release Nov 19, 2024
106 of 111 checks passed
@JReinhold JReinhold deleted the version-non-patch-from-8.5.0-alpha.7 branch November 19, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:daily Run the CI jobs that normally run in the daily job. freeze Freeze the Release PR with this label release For PRs that trigger new releases. Automated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants