Skip to content

Commit 38a7d25

Browse files
brummCompuIves
authored andcommitted
More tooltips (codesandbox#239)
* Add more tooltips for some icon-only buttons * I noticed a very short flashing of scrollbars on the body when the .tiny-popper container was inserted into the DOM. Setting the container to `position: absolute` prevents this from happening. * `npm run add` :) * remove superfluous Tooltip * align tooltip labels
1 parent c8b3eab commit 38a7d25

File tree

7 files changed

+74
-28
lines changed

7 files changed

+74
-28
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@
149149
"code"
150150
]
151151
},
152+
{
153+
"login": "brumm",
154+
"name": "Philipp Brumm",
155+
"avatar_url": "https://avatars3.githubusercontent.com/u/170500?v=4",
156+
"profile": "https://github.com/brumm",
157+
"contributions": [
158+
"code"
159+
]
160+
},
152161
{
153162
"login": "ValentinH",
154163
"name": "Valentin Hervieu",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
3030
| [<img src="https://avatars0.githubusercontent.com/u/587016?v=3" width="100px;"/><br /><sub>Ives van Hoorne</sub>](http://ivesvh.com)<br />[💬](#question-CompuIves "Answering Questions") [📝](#blog-CompuIves "Blogposts") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3ACompuIves "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=CompuIves "Code") [🎨](#design-CompuIves "Design") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=CompuIves "Documentation") [💡](#example-CompuIves "Examples") [🚇](#infra-CompuIves "Infrastructure (Hosting, Build-Tools, etc)") [👀](#review-CompuIves "Reviewed Pull Requests") [⚠️](https://github.com/CompuIves/codesandbox-client/commits?author=CompuIves "Tests") [🔧](#tool-CompuIves "Tools") | [<img src="https://avatars0.githubusercontent.com/u/887639?v=3" width="100px;"/><br /><sub>Donavon West</sub>](http://donavon.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=donavon "Code") | [<img src="https://avatars0.githubusercontent.com/u/5266810?v=3" width="100px;"/><br /><sub>Jeff Allen</sub>](http://www.jeffallen.io/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=vueu "Code") | [<img src="https://avatars0.githubusercontent.com/u/1089897?v=3" width="100px;"/><br /><sub>Ben Gummer</sub>](https://github.com/bengummer)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=bengummer "Code") | [<img src="https://avatars3.githubusercontent.com/u/154732?v=3" width="100px;"/><br /><sub>James Gillmore</sub>](http://twitter.com/faceyspacey)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=faceyspacey "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Afaceyspacey "Bug reports") | [<img src="https://avatars1.githubusercontent.com/u/9636410?v=4" width="100px;"/><br /><sub>Ade Viankakrisna Fadlil</sub>](https://musify.id)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=viankakrisna "Code") | [<img src="https://avatars1.githubusercontent.com/u/1854763?v=4" width="100px;"/><br /><sub>Tushar Sonawane</sub>](https://twitter.com/tushkiz)<br />[💬](#question-Tushkiz "Answering Questions") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=Tushkiz "Code") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=Tushkiz "Documentation") [🤔](#ideas-Tushkiz "Ideas, Planning, & Feedback") |
3131
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
3232
| [<img src="https://avatars3.githubusercontent.com/u/1239401?v=4" width="100px;"/><br /><sub>Johann Hubert Sonntagbauer</sub>](https://github.com/johann-sonntagbauer)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Ajohann-sonntagbauer "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=johann-sonntagbauer "Code") | [<img src="https://avatars2.githubusercontent.com/u/9586897?v=4" width="100px;"/><br /><sub>Joachim Seminck</sub>](https://github.com/jseminck)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=jseminck "Code") | [<img src="https://avatars3.githubusercontent.com/u/5210019?v=4" width="100px;"/><br /><sub>Subramanya Chakravarthy</sub>](http://chakrihacker.github.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=chakrihacker "Code") | [<img src="https://avatars3.githubusercontent.com/u/23088?v=4" width="100px;"/><br /><sub>Robert (Robby) O'Connor</sub>](http://robby.oconnor.ninja)<br />[🚇](#infra-robbyoconnor "Infrastructure (Hosting, Build-Tools, etc)") | [<img src="https://avatars0.githubusercontent.com/u/2083930?v=4" width="100px;"/><br /><sub>Bogdan Luca</sub>](https://github.com/lbogdan)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Albogdan "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=lbogdan "Code") | [<img src="https://avatars3.githubusercontent.com/u/6177621?v=4" width="100px;"/><br /><sub>Divjot Singh</sub>](http://bogas04.github.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=bogas04 "Code") | [<img src="https://avatars3.githubusercontent.com/u/5249539?v=4" width="100px;"/><br /><sub>Jason Nall</sub>](http://www.jsonnull.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=jsonnull "Code") |
33+
| [<img src="https://avatars3.githubusercontent.com/u/170500?v=4" width="100px;"/><br /><sub>Philipp Brumm</sub>](https://github.com/brumm)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=brumm "Code") |
3334
| [<img src="https://avatars2.githubusercontent.com/u/2678610?v=4" width="100px;"/><br /><sub>Valentin Hervieu</sub>](http://valentin-hervieu.fr)<br /> |
3435
<!-- ALL-CONTRIBUTORS-LIST:END -->

src/app/components/Tooltip.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { Tooltip } from 'react-tippy';
44

55
// eslint-disable-next-line
66
injectGlobal`
7+
.tippy-popper {
8+
position: absolute;
9+
}
710
.tippy-tooltip [x-circle] {
811
background-color: rgb(21, 24, 25) !important;
912
}

src/app/components/sandbox/ModeIcons.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,28 @@ const getCurrentMode = ({
130130
setPreviewView,
131131
}: Props) => {
132132
const both = (
133-
<ViewIcon onClick={setMixedView} active={showEditor && showPreview}>
134-
<EditorIcon half />
135-
<PreviewIcon half />
136-
</ViewIcon>
133+
<Tooltip title="Show Split view">
134+
<ViewIcon onClick={setMixedView} active={showEditor && showPreview}>
135+
<EditorIcon half />
136+
<PreviewIcon half />
137+
</ViewIcon>
138+
</Tooltip>
137139
);
138140

139141
const editor = (
140-
<ViewIcon onClick={setEditorView} active={showEditor && !showPreview}>
141-
<EditorIcon />
142-
</ViewIcon>
142+
<Tooltip title="Show Editor view">
143+
<ViewIcon onClick={setEditorView} active={showEditor && !showPreview}>
144+
<EditorIcon />
145+
</ViewIcon>
146+
</Tooltip>
143147
);
144148

145149
const preview = (
146-
<ViewIcon onClick={setPreviewView} active={!showEditor && showPreview}>
147-
<PreviewIcon />
148-
</ViewIcon>
150+
<Tooltip title="Show Preview view">
151+
<ViewIcon onClick={setPreviewView} active={!showEditor && showPreview}>
152+
<PreviewIcon />
153+
</ViewIcon>
154+
</Tooltip>
149155
);
150156

151157
if (showEditor && !showPreview)
@@ -254,18 +260,18 @@ export default class ModeIcons extends React.PureComponent<Props> {
254260

255261
return (
256262
<Tooltips>
257-
<Tooltip title="Editor view">
263+
<Tooltip title="Show Editor view">
258264
<ViewIcon onClick={setEditorView} active={showEditor && !showPreview}>
259265
<EditorIcon />
260266
</ViewIcon>
261267
</Tooltip>
262-
<Tooltip title="Split view">
268+
<Tooltip title="Show Split view">
263269
<ViewIcon onClick={setMixedView} active={showEditor && showPreview}>
264270
<EditorIcon half />
265271
<PreviewIcon half />
266272
</ViewIcon>
267273
</Tooltip>
268-
<Tooltip title="Preview view">
274+
<Tooltip title="Show Preview view">
269275
<ViewIcon
270276
onClick={setPreviewView}
271277
active={!showEditor && showPreview}

src/app/pages/Sandbox/Editor/Content/Header/ShareView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ class ShareView extends React.PureComponent {
325325
HeaderComponent={Action}
326326
headerProps={{
327327
title: 'Share',
328+
tooltip: 'Share sandbox',
328329
Icon: ShareIcon,
329330
moreInfo: true,
330331
}}

src/app/pages/Sandbox/Editor/Content/Header/index.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,29 @@ export default class Header extends React.PureComponent<Props> {
219219
onClick={this.toggleLike}
220220
/>
221221
))}
222-
<Action onClick={this.forkSandbox} title="Fork" Icon={Fork} />
222+
<Action
223+
onClick={this.forkSandbox}
224+
tooltip="Fork sandbox"
225+
title="Fork"
226+
Icon={Fork}
227+
/>
223228
<Action
224229
onClick={canSave ? this.massUpdateModules : null}
225230
placeholder={canSave ? false : 'All modules are saved'}
231+
tooltip="Save sandbox"
226232
title="Save"
227233
Icon={Save}
228234
/>
229-
<Action title="Download" Icon={Download} onClick={this.zipSandbox} />
235+
<Action
236+
tooltip="Download sandbox"
237+
title="Download"
238+
Icon={Download}
239+
onClick={this.zipSandbox}
240+
/>
230241
{user.jwt &&
231242
sandbox.owned && (
232243
<Action
244+
tooltip="Deploy sandbox"
233245
title="Deploy"
234246
Icon={NowIcon}
235247
onClick={this.deploySandbox}
@@ -242,7 +254,12 @@ export default class Header extends React.PureComponent<Props> {
242254
<Media query="(max-width: 1560px)">
243255
{matches =>
244256
matches ? (
245-
<Action href={searchUrl()} Icon={SearchIcon} tooltip="Search" />
257+
<Action
258+
href={searchUrl()}
259+
Icon={SearchIcon}
260+
tooltip="Search"
261+
title="Search"
262+
/>
246263
) : (
247264
<div style={{ marginRight: '0.5rem', fontSize: '.875rem' }}>
248265
<HeaderSearchBar />

src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry/EditIcons.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import AddFileIcon from 'react-icons/lib/go/file-symlink-file';
77
import AddDirectoryIcon from 'react-icons/lib/go/file-symlink-directory';
88

99
import fadeIn from 'app/utils/animation/fade-in';
10+
import Tooltip from 'app/components/Tooltip';
1011

1112
import { Icon } from '../../../Icon';
1213

@@ -43,24 +44,32 @@ export default ({
4344
{hovering && (
4445
<Container>
4546
{onEdit && (
46-
<Icon onClick={handleClick(onEdit)}>
47-
<EditIcon />
48-
</Icon>
47+
<Tooltip title="Edit">
48+
<Icon onClick={handleClick(onEdit)}>
49+
<EditIcon />
50+
</Icon>
51+
</Tooltip>
4952
)}
5053
{onCreateFile && (
51-
<Icon onClick={handleClick(onCreateFile)}>
52-
<AddFileIcon />
53-
</Icon>
54+
<Tooltip title="New Module">
55+
<Icon onClick={handleClick(onCreateFile)}>
56+
<AddFileIcon />
57+
</Icon>
58+
</Tooltip>
5459
)}
5560
{onCreateDirectory && (
56-
<Icon onClick={handleClick(onCreateDirectory)}>
57-
<AddDirectoryIcon />
58-
</Icon>
61+
<Tooltip title="New Directory">
62+
<Icon onClick={handleClick(onCreateDirectory)}>
63+
<AddDirectoryIcon />
64+
</Icon>
65+
</Tooltip>
5966
)}
6067
{onDelete && (
61-
<Icon onClick={handleClick(onDelete)}>
62-
<CrossIcon />
63-
</Icon>
68+
<Tooltip title="Delete">
69+
<Icon onClick={handleClick(onDelete)}>
70+
<CrossIcon />
71+
</Icon>
72+
</Tooltip>
6473
)}
6574
</Container>
6675
)}

0 commit comments

Comments
 (0)