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

Added excerpt panel to document inspector #4264

Merged
merged 4 commits into from Sep 2, 2020
Merged

Conversation

mariano-formidable
Copy link
Contributor

@mariano-formidable mariano-formidable commented Aug 28, 2020

Summary

This PR adds the Excerpt Panel to the document inspector. It also adds a TextArea Storybook sample and ExcerptPanel tests.

Relevant Technical Choices

The figma design displays a 100 character limit, but I choose to up it to 200 characters based on Pascal's suggestion (it follows how Twitter does it) in the main ticket (#490).

User-facing changes

The "Excerpt Panel" will now appear within the "Document" tab for the entire story (above the "Permalink Panel").

Testing Instructions

1.) Open up a new or existing story in the Editor.
2.) Click on "Document" in the panel to the right to revel the document inspector.
3.) Scroll down the document inspector to find the "Excerpt" panel. It should be located below "Publishing" and above "Permalink".
4.) In the Excerpt panel you should be able to do the following:

  • Type up a small excerpt. Click save. Refresh the page and notice that the excerpt remains (meanings it was saved off with the story).
  • You should be able to remove the excerpt and save with an empty excerpt.
  • Type in or copy-n-paste a message over 200 characters and it should be auto-truncated to 200 chars.

Fixes #490

Screenshots

Empty Excerpt panel:

Nicely filled Excerpt panel:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2020

Size Change: +765 B (0%)

Total Size: 1.23 MB

Filename Size Change
assets/js/edit-story.js 490 kB +471 B (0%)
assets/js/stories-dashboard.js 576 kB +294 B (0%)
ℹ️ View Unchanged
Filename Size Change
assets/css/edit-story.css 268 B 0 B
assets/css/stories-dashboard.css 305 B 0 B
assets/css/web-stories-embed-block.css 515 B 0 B
assets/js/chunk-web-stories-template-0-********************.js 10.2 kB 0 B
assets/js/chunk-web-stories-template-1-********************.js 10.3 kB 0 B
assets/js/chunk-web-stories-template-2-********************.js 10 kB 0 B
assets/js/chunk-web-stories-template-3-********************.js 10.5 kB 0 B
assets/js/chunk-web-stories-template-4-********************.js 10.6 kB 0 B
assets/js/chunk-web-stories-template-5-********************.js 6.86 kB 0 B
assets/js/chunk-web-stories-template-6-********************.js 9.91 kB 0 B
assets/js/chunk-web-stories-template-7-********************.js 9.78 kB 0 B
assets/js/web-stories-activation-notice.js 63.6 kB 0 B
assets/js/web-stories-embed-block.js 16.9 kB 0 B

compressed-size-action

@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #4264 into main will decrease coverage by 0.13%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4264      +/-   ##
==========================================
- Coverage   83.35%   83.22%   -0.14%     
==========================================
  Files         831      834       +3     
  Lines       14535    14659     +124     
==========================================
+ Hits        12116    12200      +84     
- Misses       2419     2459      +40     
Flag Coverage Δ
#karmatests 71.28% <77.77%> (-0.14%) ⬇️
#unittests 66.00% <88.88%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...components/inspector/document/documentInspector.js 100.00% <ø> (ø)
assets/src/edit-story/components/form/textArea.js 86.66% <86.66%> (ø)
...dit-story/components/inspector/document/excerpt.js 100.00% <100.00%> (ø)
assets/src/dashboard/theme.js 83.33% <0.00%> (ø)
...s/src/dashboard/app/views/templateDetails/index.js 96.36% <0.00%> (ø)
...src/dashboard/components/cardGallery/components.js 100.00% <0.00%> (ø)
assets/src/dashboard/utils/useGridViewKeys.js 29.68% <0.00%> (ø)
...sets/src/dashboard/components/cardGallery/index.js 96.49% <0.00%> (+1.36%) ⬆️
... and 3 more

@mariano-formidable mariano-formidable changed the title [WIP] Added excerpt panel to document inspector Added excerpt panel to document inspector Aug 28, 2020
@mariano-formidable mariano-formidable marked this pull request as ready for review August 28, 2020 19:03
Copy link
Contributor

@barklund barklund left a comment

Choose a reason for hiding this comment

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

Works as expected and looks great - just two minor comments about simplifications.

assets/src/edit-story/components/form/textArea.js Outdated Show resolved Hide resolved
Copy link
Contributor

@dmmulroy dmmulroy left a comment

Choose a reason for hiding this comment

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

Had two small nits but this looks great and works well 👍

assets/src/edit-story/components/form/textArea.js Outdated Show resolved Hide resolved
assets/src/edit-story/components/form/textArea.js Outdated Show resolved Hide resolved
Copy link
Contributor

@BrittanyIRL BrittanyIRL left a comment

Choose a reason for hiding this comment

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

Text area works as you've laid out in the editor both with cursor and keyboard. Storybook add is great, thank you for doing that! And unit tests are working locally for me.

@swissspidy swissspidy added the Type: Enhancement New feature or improvement of an existing feature label Sep 2, 2020
@swissspidy swissspidy merged commit f8c63ec into main Sep 2, 2020
@swissspidy swissspidy deleted the task/490-add-excerpt branch September 2, 2020 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post / Story - Excerpt in Document Panel
5 participants