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

Clicking anywhere in the file info tile copies the buffer path #232

Merged
merged 4 commits into from Jan 11, 2019

Conversation

Projects
None yet
2 participants
@jshorty
Copy link
Contributor

jshorty commented Jan 8, 2019

Description of the Change

Hovering over the edge areas of the file info tile (<status-bar-file>), but not its inner buffer path text (<a>), displays the Click to copy... tooltip. However, clicking within this area does not copy the path. Depending on editor theme, hover styling may additionally suggest that behavior will occur on a click. This can be confusing to the user, and in personal experience, I sometimes click this area quickly only to paste elsewhere and discover I didn't actually get the path onto the clipboard.

Edit by @rsese to add a screenshot of where copy doesn't work even though the tooltip is showing with the pointer on the left edge of the path

copy-tip-no-copy

This PR moves the click handling that adds the path to the clipboard and displays the Copied: ... tooltip to the path's parent element, so clicking anywhere on the tile has the desired effect.

Alternate Designs

One alternative I considered was moving where we add the Click to copy... tooltip so it only displays when hovering directly over the path. I felt this ultimately made the tile less useable, and other hover styling would still leave behind a misleading impression.

Benefits

Easier to copy paths from the file info tile; clicking in the edge areas does not 'fake out' the user.

Possible Drawbacks

  • Expanding the clickable area increases the chance someone could accidentally copy the path and lose something on their clipboard.
  • Themes where the path's <a> element has its own hover styling may mislead the user into thinking that clicking the path itself has different functionality from clicking the outer edges of the tile.

Applicable Issues

I did not find any issues related to this change.

jshorty added some commits Jan 8, 2019

Copy file path on click anywhere tooltip displays
While it varies somewhat with UI theme, it's currently possible to hover over the <status-bar-file> element and not its inner <a>, such that the tooltip displays, but clicking does not actually copy the file path. Another alternative here would be to display the tooltip only on <a> hover.
Change copied tooltip trigger to manual
This ensures the tooltip still displays despite @element now handling the click.
Show resolved Hide resolved spec/built-in-tiles-spec.coffee Outdated

@50Wliu 50Wliu merged commit 1aaaaa7 into atom:master Jan 11, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@50Wliu

This comment has been minimized.

Copy link
Member

50Wliu commented Jan 11, 2019

Thanks!

@50Wliu 50Wliu referenced this pull request Jan 11, 2019

Merged

Upgrade status-bar #18680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.