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

feat: nested grouping of stories with "group/story" syntax #486

Merged
merged 9 commits into from
Jul 14, 2023

Conversation

dannyhw
Copy link
Member

@dannyhw dannyhw commented Jun 18, 2023

Issue: #205

What I did

thanks to @Jonatthu for getting this started with #457

This adds an initial version of categories/nested stories in the sidebar

How to test

  • run example project and see the sidebar and storylist story
Screen.Recording.2023-06-18.at.20.45.42.mov

@socket-security
Copy link

socket-security bot commented Jun 18, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: [email protected]

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

@socket-security
Copy link

New and updated dependency changes detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives1 Size Publisher
@types/jest 🆕 29.5.2 None +0 79.3 kB types
react-native ⬆️ 0.71.3...0.71.8 None +8/-10 60.4 MB react-native-bot

Footnotes

  1. https://docs.socket.dev

@dannyhw
Copy link
Member Author

dannyhw commented Jun 18, 2023

@SocketSecurity ignore [email protected]

Copy link
Contributor

@jonathanj jonathanj left a comment

Choose a reason for hiding this comment

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

I just have two questions, one of which I commented on the changes for. I think that item.stories changes only when necessary instead of being recomputed on render, but thought I would ask anyway. The app in the video still looks snappy though, so there's probably not a serious performance regression, feel free to resolve my comment.

My other question is more of a (hypothetical) UX question: What happens if you have a few levels of nesting and medium length story names? Will list items end up squished towards the right? Might be easier to see what problems people run into and address them when/if they happen.

Otherwise this looks like a really nice improvement!

Comment on lines +60 to +69
export function useIsChildSelected(entries: StoryIndexEntry[]) {
return useAtomValue(
useMemo(
() =>
atom((get) => {
const contextId = get(storyContextAtom)?.id;
return !!entries.find(({ id }) => id === contextId);
}),
[entries]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not super clear from reading the calling code whether item.stories is a stable reference. Does it only change when Storybook core needs to update (because of HMR or whatever else)?

Copy link
Member Author

@dannyhw dannyhw Jul 13, 2023

Choose a reason for hiding this comment

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

When filtering the tree can be recreated, its based on the 'data' state which gets set when filtering

@dannyhw
Copy link
Member Author

dannyhw commented Jul 13, 2023

added flex-srhink and maximum lines for story headers so we get elipsis when it goes over

@dannyhw
Copy link
Member Author

dannyhw commented Jul 14, 2023

Going to merge and make a new alpha version with these changes.

@dannyhw dannyhw merged commit ea718f7 into next Jul 14, 2023
5 checks passed
hyochan pushed a commit to dooboolab-community/dooboo-ui that referenced this pull request Aug 2, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@storybook/addon-ondevice-actions](https://storybook.js.org/)
([source](https://togithub.com/storybookjs/react-native)) | [`6.5.4` ->
`6.5.5`](https://renovatebot.com/diffs/npm/@storybook%2faddon-ondevice-actions/6.5.4/6.5.5)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@storybook%2faddon-ondevice-actions/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@storybook%2faddon-ondevice-actions/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@storybook%2faddon-ondevice-actions/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@storybook%2faddon-ondevice-actions/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@storybook/addon-ondevice-knobs](https://togithub.com/storybookjs/react-native)
| [`6.5.4` ->
`6.5.5`](https://renovatebot.com/diffs/npm/@storybook%2faddon-ondevice-knobs/6.5.4/6.5.5)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@storybook%2faddon-ondevice-knobs/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@storybook%2faddon-ondevice-knobs/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@storybook%2faddon-ondevice-knobs/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@storybook%2faddon-ondevice-knobs/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [@storybook/react-native](https://storybook.js.org/)
([source](https://togithub.com/storybookjs/react-native)) | [`6.5.4` ->
`6.5.5`](https://renovatebot.com/diffs/npm/@storybook%2freact-native/6.5.4/6.5.5)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@storybook%2freact-native/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@storybook%2freact-native/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@storybook%2freact-native/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@storybook%2freact-native/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [@storybook/react-native-server](https://storybook.js.org/)
([source](https://togithub.com/storybookjs/react-native)) | [`6.5.4` ->
`6.5.5`](https://renovatebot.com/diffs/npm/@storybook%2freact-native-server/6.5.4/6.5.5)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@storybook%2freact-native-server/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@storybook%2freact-native-server/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@storybook%2freact-native-server/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@storybook%2freact-native-server/6.5.4/6.5.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>storybookjs/react-native
(@&#8203;storybook/addon-ondevice-actions)</summary>

###
[`v6.5.5`](https://togithub.com/storybookjs/react-native/releases/tag/v6.5.5)

[Compare
Source](https://togithub.com/storybookjs/react-native/compare/v6.5.4...v6.5.5)

##### What's Changed

- chore(deps): bump fast-xml-parser from 4.2.4 to 4.2.5 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[storybookjs/react-native#493
- chore(deps): bump semver from 5.7.1 to 5.7.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[storybookjs/react-native#496
- feat: nested grouping of stories with "group/story" syntax by
[@&#8203;dannyhw](https://togithub.com/dannyhw) in
[storybookjs/react-native#486
- chore(deps): bump word-wrap from 1.2.3 to 1.2.4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[storybookjs/react-native#499
- chore: update expo, ts and emotion by
[@&#8203;dannyhw](https://togithub.com/dannyhw) in
[storybookjs/react-native#498
- yarn berry changes by [@&#8203;dannyhw](https://togithub.com/dannyhw)
in
[storybookjs/react-native#500
- feat/require context by
[@&#8203;dannyhw](https://togithub.com/dannyhw) in
[storybookjs/react-native#501
- you can use --unstable_useRequireContext on storybook generate to try
this out

**Full Changelog**:
storybookjs/react-native@v6.5.4...v6.5.5

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/dooboolab-community/dooboo-ui).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNy4xIiwidXBkYXRlZEluVmVyIjoiMzYuMjcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@dannyhw dannyhw deleted the feat/nested-stories branch February 2, 2024 18:10
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

Successfully merging this pull request may close these issues.

None yet

2 participants