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

Update help and walkthrough for touch interactions #7745

Merged
merged 37 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0bc56f9
Start touch support for walkthrough (re: #7692)
quincylvania Jun 26, 2020
f443dc0
Merge branch 'develop' into touch-walkthrough-update
quincylvania Jun 26, 2020
9cdc89d
Merge branch 'develop' into touch-walkthrough-update
quincylvania Jun 29, 2020
af4aca1
Use standard kbd styling for keys in help documentation
quincylvania Jun 29, 2020
ac0dcf8
Use placeholder references in the help docs for strings used elsewher…
quincylvania Jun 29, 2020
fab750d
Use more placeholder references in the help docs
quincylvania Jun 29, 2020
fe73567
Use placeholders for Imagery Offset and Space strings in help docs
quincylvania Jun 29, 2020
8234079
Show operation icon colors in the help pane
quincylvania Jun 29, 2020
96c29d5
Reference the name of the turn restrictions field in the help pane
quincylvania Jun 29, 2020
8bd331f
Reference add note shortcut key in the help docs
quincylvania Jun 29, 2020
3f5073d
Use title case for Keyboard Shortcuts menu label
quincylvania Jun 29, 2020
4e13ca7
Make help table of contents scale better to narrow screen sizes
quincylvania Jun 29, 2020
90f2121
Use the square button icon instead of name, for consistency
quincylvania Jun 29, 2020
6e04e31
Merge branch 'develop' into touch-walkthrough-update
quincylvania Jun 30, 2020
45f337e
Merge branch 'develop' into touch-walkthrough-update
quincylvania Jul 10, 2020
cf5bf61
Use the same string replacements for the walkthrough as the help docs
quincylvania Jul 10, 2020
b670954
Merge branch 'develop' into touch-walkthrough-update
quincylvania Jul 10, 2020
3892600
Reduce redundant strings in the walkthrough
quincylvania Jul 10, 2020
e93e0fd
Update buildings walkthrough chapter for touchscreens
quincylvania Jul 10, 2020
0d4946f
Update more help pane strings for touchscreens
quincylvania Jul 10, 2020
d54e738
Fix disabled operation icon styling
quincylvania Jul 10, 2020
91ce939
Merge branch 'develop' into touch-walkthrough-update
quincylvania Jul 10, 2020
3229390
Clean up the mouse icons' size and clarity
quincylvania Jul 11, 2020
365fa1b
Add tap and longpress icons to walkthrough
quincylvania Jul 11, 2020
1514648
Add doubletap and touch-and-drag icons to the walkthrough
quincylvania Jul 12, 2020
bf5ed60
Update walkthrough touch icons
quincylvania Jul 12, 2020
89da4a2
Merge branch 'develop' into touch-walkthrough-update
quincylvania Jul 12, 2020
477b7a2
Start updating the documentation for touch input
quincylvania Jul 13, 2020
a4f3cd3
Make tap circle larger in longpress icon
quincylvania Jul 13, 2020
f5d2806
Add mousewheel icon to help and walkthrough
quincylvania Jul 13, 2020
31740f1
Add pinch-to-zoom icon to help and walkthrough
quincylvania Jul 13, 2020
27faeae
Add touch info to keyboard shortcuts screen
quincylvania Jul 13, 2020
a347525
Update more of the documentation for touch input
quincylvania Jul 13, 2020
d3d80be
Prioritize the UI button over the hotkey for closing the feature edit…
quincylvania Jul 13, 2020
d734edb
Add leftclick icon
quincylvania Jul 13, 2020
85e02de
Add info about touchscreen multiselection to the help pane
quincylvania Jul 13, 2020
9938335
Update doubletap icon
quincylvania Jul 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 12 additions & 35 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,16 @@ button[disabled].action {
height: 20px;
}

.icon.operation use {
fill: #222;
color: #79f;
}
button.disabled .icon.operation use,
.icon.operation.disabled use {
fill: rgba(32,32,32,.2);
color: rgba(40,40,40,.2);
}

.icon.monochrome use {
fill: currentColor;
}
Expand Down Expand Up @@ -3754,19 +3764,6 @@ li.issue-fix-item:not(.actionable) .fix-icon {
margin-bottom: 20px;
}

.help-pane .left-content .body p code {
padding: 3px 4px;
font-size: 12px;
color: #555;
vertical-align: baseline;
background-color: #f6f6f6;
border: solid 1px #ccc;
margin: 0 2px;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}

.help-pane .left-content .icon.pre-text {
vertical-align: text-top;
margin-right: 0;
Expand All @@ -3775,7 +3772,8 @@ li.issue-fix-item:not(.actionable) .fix-icon {
}

.help-pane .toc {
width: 40%;
width: 100%;
max-width: 200px;
float: right;
margin-left: 20px;
margin-bottom: 20px;
Expand Down Expand Up @@ -4408,11 +4406,6 @@ img.tile-debug {
.flash-icon use {
color: #222;
}

.flash-icon.operation use {
fill: #222;
color: #79f;
}
.flash-icon.disabled use,
.flash-icon.operation.disabled use {
fill: rgba(32,32,32,0.7);
Expand Down Expand Up @@ -4939,15 +4932,6 @@ img.tile-debug {
color: #555;
}

svg.mouseclick use.left {
fill: rgba(112, 146, 255, 1);
color: rgba(112, 146, 255, 0);
}
svg.mouseclick use.right {
fill: rgba(112, 146, 255, 0);
color: rgba(112, 146, 255, 1);
}

.modal-shortcuts .shortcut-keys .gesture {
color: #333;
padding: 3px;
Expand Down Expand Up @@ -5414,15 +5398,8 @@ li.hide + li.version .badge .tooltip .popover-arrow {
}

.edit-menu-item use {
fill: #222;
color: #79f;
pointer-events: none;
}
.edit-menu-item.disabled use {
fill: rgba(32,32,32,.2);
color: rgba(40,40,40,.2);
}


/* Lasso
------------------------------------------------------- */
Expand Down
282 changes: 164 additions & 118 deletions data/core.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions data/shortcuts.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"text": "shortcuts.browsing.selecting.title"
},
{
"shortcuts": ["Left-click", "shortcuts.key.space"],
"shortcuts": ["Left-click", "Tap", "shortcuts.key.space"],
"text": "shortcuts.browsing.selecting.select_one"
},
{
Expand All @@ -131,7 +131,7 @@
"text": "shortcuts.browsing.with_selected.title"
},
{
"shortcuts": ["Right-click", "☰"],
"shortcuts": ["Right-click", "Long-press", "☰"],
"text": "shortcuts.browsing.with_selected.edit_menu"
},
{
Expand Down Expand Up @@ -193,7 +193,7 @@
"text": "shortcuts.editing.drawing.add_note"
},
{
"shortcuts": ["Left-click", "shortcuts.key.space"],
"shortcuts": ["Left-click", "Tap", "shortcuts.key.space"],
"text": "shortcuts.editing.drawing.place_point"
},
{
Expand Down
282 changes: 164 additions & 118 deletions dist/locales/en.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions modules/core/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export function coreContext() {
/* User interface and keybinding */
let _ui;
context.ui = () => _ui;
context.lastPointerType = () => _ui.lastPointerType();

let _keybinding = utilKeybinding('context');
context.keybinding = () => _keybinding;
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ uiCmd.display = function(code) {
'↘': mac ? '↘ ' + t('shortcuts.key.pgdn') : t('shortcuts.key.pgdn'),
'⇞': mac ? '⇞ ' + t('shortcuts.key.home') : t('shortcuts.key.home'),
'⇟': mac ? '⇟ ' + t('shortcuts.key.end') : t('shortcuts.key.end'),
'↵': mac ? ' ' + t('shortcuts.key.return') : t('shortcuts.key.enter'),
'↵': mac ? ' ' + t('shortcuts.key.return') : t('shortcuts.key.enter'),
'⎋': mac ? '⎋ ' + t('shortcuts.key.esc') : t('shortcuts.key.esc'),
'☰': mac ? '☰ ' + t('shortcuts.key.menu') : t('shortcuts.key.menu'),
};
Expand Down
13 changes: 11 additions & 2 deletions modules/ui/curtain.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ export function uiCurtain(containerNode) {
* @param {integer} [options.duration] transition time in milliseconds
* @param {string} [options.buttonText] if set, create a button with this text label
* @param {function} [options.buttonCallback] if set, the callback for the button
* @param {function} [options.padding] extra margin in px to put around bbox
* @param {String|ClientRect} [options.tooltipBox] box for tooltip position, if different from box for the curtain
*/
curtain.reveal = function(box, text, options) {
options = options || {};

if (typeof box === 'string') {
box = d3_select(box).node();
}
Expand All @@ -76,8 +79,14 @@ export function uiCurtain(containerNode) {
box.top -= containerRect.top;
box.left -= containerRect.left;
}

options = options || {};
if (box && options.padding) {
box.top -= options.padding;
box.left -= options.padding;
box.bottom += options.padding;
box.right += options.padding;
box.height += options.padding * 2;
box.width += options.padding * 2;
}

var tooltipBox;
if (options.tooltipBox) {
Expand Down
12 changes: 10 additions & 2 deletions modules/ui/edit_menu.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { event as d3_event, select as d3_select } from 'd3-selection';
import { dispatch as d3_dispatch } from 'd3-dispatch';

import { geoVecAdd } from '../geo';
import { localizer } from '../core/localizer';
import { uiTooltip } from './tooltip';
import { utilRebind } from '../util/rebind';
import { svgIcon } from '../svg/icon';


export function uiEditMenu(context) {
var dispatch = d3_dispatch('toggled');

var _menu = d3_select(null);
var _operations = [];
// the position the menu should be displayed relative to
Expand Down Expand Up @@ -99,7 +103,7 @@ export function uiEditMenu(context) {
.call(tooltip)
.append('div')
.attr('class', 'icon-wrap')
.call(svgIcon('#iD-operation-' + d.id, 'operation-icon'));
.call(svgIcon('#iD-operation-' + d.id, 'operation'));
});

if (showLabels) {
Expand Down Expand Up @@ -161,6 +165,8 @@ export function uiEditMenu(context) {
}
lastPointerUpType = null;
}

dispatch.call('toggled', this, true);
};

function updatePosition() {
Expand Down Expand Up @@ -269,6 +275,8 @@ export function uiEditMenu(context) {

_menu.remove();
_tooltips = [];

dispatch.call('toggled', this, false);
};

editMenu.anchorLoc = function(val) {
Expand All @@ -290,5 +298,5 @@ export function uiEditMenu(context) {
return editMenu;
};

return editMenu;
return utilRebind(editMenu, dispatch, 'on');
}
6 changes: 3 additions & 3 deletions modules/ui/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function uiFlash(context) {
var _iconName = '#iD-icon-no';
var _iconClass = 'disabled';
var _text = '';
var _textClass;
var _textClass;

function flash() {
if (_flashTimer) {
Expand All @@ -31,7 +31,7 @@ export function uiFlash(context) {

var iconEnter = contentEnter
.append('svg')
.attr('class', 'flash-icon')
.attr('class', 'flash-icon icon')
.append('g')
.attr('transform', 'translate(10,10)');

Expand All @@ -56,7 +56,7 @@ export function uiFlash(context) {

content
.selectAll('.flash-icon')
.attr('class', 'flash-icon ' + (_iconClass || ''));
.attr('class', 'icon flash-icon ' + (_iconClass || ''));

content
.selectAll('.flash-icon use')
Expand Down
21 changes: 15 additions & 6 deletions modules/ui/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export function uiInit(context) {
var _initCounter = 0;
var _needWidth = {};

var _lastPointerType;


function render(container) {

Expand Down Expand Up @@ -95,13 +97,15 @@ export function uiInit(context) {
if ('PointerEvent' in window) {
d3_select(window)
.on('pointerdown.ui pointerup.ui', function() {
var pointerType = d3_event.pointerType || 'mouse';
if (container.attr('pointer') !== pointerType) {
var pointerType = d3_event.pointerType || 'mouse';
if (_lastPointerType !== pointerType) {
_lastPointerType = pointerType;
container
.attr('pointer', pointerType);
}
}, true);
} else {
_lastPointerType = 'mouse';
container
.attr('pointer', 'mouse');
}
Expand Down Expand Up @@ -481,6 +485,10 @@ export function uiInit(context) {
ui.ensureLoaded();
};

ui.lastPointerType = function() {
return _lastPointerType;
};

ui.flash = uiFlash(context);

ui.sidebar = uiSidebar(context);
Expand Down Expand Up @@ -587,7 +595,11 @@ export function uiInit(context) {
};


var _editMenu; // uiEditMenu
var _editMenu = uiEditMenu(context);

ui.editMenu = function() {
return _editMenu;
};

ui.showEditMenu = function(anchorPoint, triggerType, operations) {

Expand All @@ -606,9 +618,6 @@ export function uiInit(context) {
surfaceNode.focus();
}

// don't load the menu until it's needed
if (!_editMenu) _editMenu = uiEditMenu(context);

operations.forEach(function(operation) {
if (operation.point) operation.point(anchorPoint);
});
Expand Down
Loading