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

Use LinkButton in Excerpt #3268

Merged
merged 1 commit into from Apr 8, 2021
Merged

Use LinkButton in Excerpt #3268

merged 1 commit into from Apr 8, 2021

Conversation

lyzadanger
Copy link
Contributor

This PR updates the Excerpt component to use a LinkButton with a common pattern instead of a custom-styled <button> element for its inline controls for expanding or collapsing long excerpts. There is a user-visible change here: to better match our other link-styled buttons, this button now has an underline and is not italic.

Before:

image

After:

image

it('displays inline controls if collapsed', () => {
const wrapper = createExcerpt({ inlineControls: true }, TALL_DIV);
assert.isTrue(wrapper.exists('.Excerpt__inline-controls'));
assert.isTrue(wrapper.exists('InlineControls'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating to not use a classname selector while I'm in here...

@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #3268 (5a75740) into master (0b6b760) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3268   +/-   ##
=======================================
  Coverage   97.93%   97.93%           
=======================================
  Files         211      211           
  Lines        7693     7693           
  Branches     1756     1756           
=======================================
  Hits         7534     7534           
  Misses        159      159           
Impacted Files Coverage Δ
src/sidebar/components/Excerpt.js 92.30% <ø> (ø)

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 0b6b760...5a75740. Read the comment docs.

.Excerpt__toggle-link {
// A container for a button with a gradient background; this gives partial
// opacity behind the More/Less button so that it is easier to read
.Excerpt__toggle-container {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed this classname for clarity

Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

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

LGTM. I see clear pros and a possible con to the visual change but I think this is the right choice. Pros: Its more obvious that it is a clickable thing, and more consistent with other link-like buttons. Con: Since it has more visual weight than before, perhaps it might distract from the body? Could also be just a matter of getting used to it.

src/sidebar/components/test/Excerpt-test.js Outdated Show resolved Hide resolved
src/sidebar/components/test/Excerpt-test.js Outdated Show resolved Hide resolved
@lyzadanger lyzadanger merged commit 527aed4 into master Apr 8, 2021
@lyzadanger lyzadanger deleted the excerpt-link-button branch April 8, 2021 13:57
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