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(react-native): Add ability to filter story list from React-Native #4806

Merged
merged 5 commits into from
Nov 23, 2018

Conversation

estevaolucas
Copy link

@estevaolucas estevaolucas commented Nov 19, 2018

Issue: N/A

What I did

  1. Add the feature of filtering the story list from React-Native.
  2. Wrap storybook view with KeyboardAvoidingView to make the story list present the whole list while the filter bar is open. (Basically doing this PR fix(react-native): prevent the Navigation bar to stay underneath the keyboard #4710, but adding an option, shouldDisableKeyboardAvoidingView, to disable this KeyboardAvoidingView, preventing the problem with nested KeyboardAvoidingView)
  3. Remove KeyboardAvoidingView from OnDeviceUI/addons/wrapper.js. Looks like it's not working, as expected, and know with KeyboardAvoidingView as Storybook wrapper, it's no longer needed;
  4. Close keyboard when moves from story list or addons view to the preview.



How to test

  • Is this testable with Jest or Chromatic screenshots? N
  • Does this need a new example in the kitchen sink apps? N
  • Does this need an update to the documentation? Y

If your answer is yes to any of these, please make sure to include it in your PR.

@codecov
Copy link

codecov bot commented Nov 19, 2018

Codecov Report

Merging #4806 into next will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #4806      +/-   ##
==========================================
- Coverage   35.53%   35.45%   -0.09%     
==========================================
  Files         560      560              
  Lines        6829     6845      +16     
  Branches      916      919       +3     
==========================================
  Hits         2427     2427              
- Misses       3921     3934      +13     
- Partials      481      484       +3
Impacted Files Coverage Δ
app/react-native/src/preview/index.js 0% <ø> (ø) ⬆️
...-native/src/preview/components/OnDeviceUI/index.js 0% <0%> (ø) ⬆️
...tive/src/preview/components/StoryListView/index.js 0% <0%> (ø) ⬆️
...rc/preview/components/OnDeviceUI/addons/wrapper.js 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b45a59...d0d0eba. Read the comment docs.

@Gongreg
Copy link
Member

Gongreg commented Nov 22, 2018

Hey @elucaswork, great job!. Did you test it with android? Both landscape and portrait? Does switching between them with keyboard open works correctly? :)

This is a great new feature. Moving forward we want to try to do a POC of displaying story list as webview, maybe that would allow us to reuse the code from the web part. It would also give us an option for collapsable story list.

sections={data}
stickySectionHeadersEnabled={false}
/>
<React.Fragment>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe lets not use fragment yet? They are only added in React 16.2. It will break backwards compatibility.

Copy link
Author

Choose a reason for hiding this comment

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

oh, sure. done._

@Gongreg
Copy link
Member

Gongreg commented Nov 22, 2018

Since you've been contributing a lot lately, I've added you @elucaswork to the Storybook team! Welcome :)

@estevaolucas estevaolucas force-pushed the feat/rn-add-filter-bar branch from d7bd102 to d0d0eba Compare November 23, 2018 03:18
@estevaolucas
Copy link
Author

Hey @elucaswork, great job!. Did you test it with android? Both landscape and portrait? Does switching between them with keyboard open works correctly? :)

Thanks!.
Yep, tested it on both Android and iOS with landscape and portrait mode. Working fine for me.

This is a great new feature. Moving forward we want to try to do a POC of displaying story list as webview, maybe that would allow us to reuse the code from the web part. It would also give us an option for collapsable story list.

i see. let me know if I can help, somehow.

Since you've been contributing a lot lately, I've added you @elucaswork to the Storybook team! Welcome :)

awesome 🎉

@Gongreg
Copy link
Member

Gongreg commented Nov 23, 2018

Lets see how it will do :)

Regarding webview for story list we have to wait till @ndelangen finishes working on refactoring of it so we could use it too.

The idea would be to create a mini bundle with code necessary to run the sidebar, then load it in a page and use postmessages to communicate between webview and react native part.

@Gongreg Gongreg merged commit a8b2649 into storybookjs:next Nov 23, 2018
@Gongreg
Copy link
Member

Gongreg commented Nov 23, 2018

#3905 is the issue about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants