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

v3 UI #7496

Open
wants to merge 65 commits into
base: develop
Choose a base branch
from
Open

v3 UI #7496

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
521c1f9
Re-implement v3 toolbar on the latest working branch
quincylvania Mar 17, 2020
f4bf6c0
Merge branch '2.x' into v3-toolbar
quincylvania Mar 17, 2020
0966192
Don't show more than seven favorites if generic presets are shown
quincylvania Mar 17, 2020
02b4632
Reduce variability in the preset browser width
quincylvania Mar 17, 2020
cb8448d
Make the cancel drawing toolbar button work with repeat drawing
quincylvania Mar 17, 2020
0e431de
Fix hidden preset tooltip
quincylvania Mar 17, 2020
ba7f9db
Show error feedback when attempting to add a vertex as a standalone p…
quincylvania Mar 17, 2020
6d5d414
Fix small preset image size
quincylvania Mar 17, 2020
43c843c
Fix issue where stored add geometry would not be used
quincylvania Mar 17, 2020
1eb3ad2
Show the add geometry toolbar item even when just one geometry is sup…
quincylvania Mar 17, 2020
4ff984a
Update recent presets tool icon
quincylvania Mar 17, 2020
2ee5389
Improve the "add feature" icon
quincylvania Mar 17, 2020
a9cdd09
Improve small vertex icons
quincylvania Mar 17, 2020
9731baf
Fix preset browser country coding
quincylvania Mar 17, 2020
53438f5
Fix eslint warnings
quincylvania Mar 18, 2020
2036456
Use single object argument for draw modes instead of arguments list
quincylvania Mar 18, 2020
b14a27c
Show disabled add geometry buttons during drawing
quincylvania Mar 18, 2020
b474936
Fix map tooltips
quincylvania Mar 18, 2020
e2b5da9
Show poplist labels on narrow windows
quincylvania Mar 18, 2020
f26feb1
Enable adding "weak" presets like addresses with the v3 toolbar (clos…
quincylvania Mar 18, 2020
57286ab
Fix preset browser scrolling issue with an overflowing toolbar
quincylvania Mar 18, 2020
861a835
Don't redeclare preset button drag behavior on every update
quincylvania Mar 18, 2020
d52d1ef
Make structure tool icons smaller
quincylvania Mar 18, 2020
4b37fcf
Remove unread argument
quincylvania Mar 19, 2020
54f60fd
Remove sidebar toggle shortcut
quincylvania Mar 19, 2020
a98920f
Add additional keys for toggling the preset browser (close #7258)
quincylvania Mar 19, 2020
f901d70
Use dispatch instead of passing handlers to preset browser
quincylvania Mar 19, 2020
6114780
Let the key used to open the feature browser to close it if pressed q…
quincylvania Mar 19, 2020
e873596
Prevent opening the preset browser via hotkey
quincylvania Mar 19, 2020
f66486c
Fix styling issues with nested popovers
quincylvania Mar 19, 2020
7cd524a
Improve performance of the preset browser
quincylvania Mar 19, 2020
9063a4b
Merge branch 'develop' into v3-toolbar
quincylvania Mar 20, 2020
5a664de
Merge branch 'develop' into v3-toolbar
quincylvania Mar 22, 2020
1758a87
Merge branch 'develop' into v3-toolbar
quincylvania Mar 23, 2020
86be96e
Merge branch 'develop' into v3-toolbar
quincylvania Mar 24, 2020
2aa4fb5
Merge branch 'develop' into v3-toolbar
quincylvania Mar 25, 2020
c26f1ad
Fix save tooltip keyhint
quincylvania Mar 25, 2020
5c44562
Merge branch 'develop' into v3-toolbar
quincylvania Mar 28, 2020
8fb650e
Merge branch 'develop' into v3-toolbar
quincylvania Mar 29, 2020
e30388c
Replace global selectors in v3 toolbar (re: #7445)
quincylvania Mar 29, 2020
743e93a
Use namespaced DOM ids in v3 toolbar (re: #7445)
quincylvania Mar 29, 2020
2cc4373
Merge branch 'develop' into v3-toolbar
quincylvania Mar 31, 2020
78a660c
Merge branch 'develop' into v3-toolbar
quincylvania Mar 31, 2020
f9a6582
Merge branch 'develop' into v3-toolbar
quincylvania Apr 1, 2020
26c723f
Merge branch 'develop' into v3-toolbar
quincylvania Apr 1, 2020
58e5dca
Merge branch 'develop' into v3-toolbar
quincylvania Apr 1, 2020
7b76208
Merge branch 'develop' into v3-toolbar
quincylvania Apr 1, 2020
8fe814b
Merge branch 'develop' into v3-toolbar
quincylvania Apr 4, 2020
a8dc510
Fix invalid call to uiFlash
quincylvania Apr 5, 2020
ee6da94
Replace preset list UI with preset browser for switching presets
quincylvania Apr 5, 2020
0a6192b
Fix code test
quincylvania Apr 5, 2020
2ee8ddb
Flexbox more of the sidebar
quincylvania Apr 5, 2020
85b58f5
Remove unnecessary uiInspector
quincylvania Apr 5, 2020
fdd30b4
Open the preset browser by default when adding a new fallback feature
quincylvania Apr 5, 2020
a7e36ec
Flexbox the feature search sidebar
quincylvania Apr 6, 2020
71c781b
Merge branch 'develop' into v3-toolbar
quincylvania Apr 6, 2020
c2bbe40
Make the sidebar header shorter
quincylvania Apr 6, 2020
048c6e3
Merge branch 'develop' into v3-toolbar
quincylvania Apr 6, 2020
0e5cebf
Merge branch 'develop' into v3-toolbar
quincylvania Apr 6, 2020
4a9ee0c
Add folder border to preset category icons (close #6085)
quincylvania Apr 6, 2020
3305c13
Fix issue where turn restriction editor wouldn't render
quincylvania Apr 6, 2020
78183a9
Merge branch 'develop' into v3-toolbar
quincylvania Apr 7, 2020
096d204
Merge branch 'develop' into v3-toolbar
quincylvania Apr 12, 2020
e1fd409
Merge branch 'develop' into v3-toolbar
quincylvania Apr 13, 2020
34c148d
Merge branch 'develop' into v3-toolbar
quincylvania Apr 16, 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
636 changes: 399 additions & 237 deletions css/80_app.css

Large diffs are not rendered by default.

45 changes: 38 additions & 7 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,42 @@ en:
text: text
deselect: deselect
toolbar:
inspect: Inspect
undo_redo: Undo / Redo
recent: Recent
favorites: Favorites
add_feature: Add Feature
finish: Finish
generic:
title: Geometries
geometry:
key: T
repeat:
title: Repeat
tooltip:
point: "Add another {feature} after this one."
way: "Start another {feature} after finishing this one."
key: R
segments:
title: Segments
straight:
title: Straight
orthogonal:
title: Rectangular
key: A
structure:
none:
title: None
key: S
support:
title: Support
pole:
title: Pole
tower:
title: Tower
key: S
toolbox:
title: Tools
tooltip: Customize the toolbar.
title:
format:
context: "{base} – {context}"
Expand All @@ -25,9 +56,10 @@ en:
labeled_and_more: "{labeled} and {count} more"
modes:
add_feature:
title: Add a feature
description: "Search for features to add to the map."
key: Tab
search_placeholder: Search feature types
description: "Browse features to add to the map."
# The hotkey to open the Add Feature preset browser. Expect the key adjacent to the number row.
key: "`"
result: "{count} result"
results: "{count} results"
add_area:
Expand All @@ -45,6 +77,8 @@ en:
description: "Add restaurants, monuments, postal boxes or other points to the map."
tail: Click on the map to add a point.
filter_tooltip: points
warning:
vertex_placement: This must be placed along a line or area.
add_note:
title: Note
label: Add Note
Expand Down Expand Up @@ -442,9 +476,6 @@ en:
loading_auth: "Connecting to OpenStreetMap..."
report_a_bug: Report a bug
help_translate: Help translate
sidebar:
key: '`'
tooltip: Toggle the sidebar.
feature_info:
hidden_warning: "{count} hidden features"
hidden_details: "These features are currently hidden: {details}"
Expand Down
63 changes: 53 additions & 10 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,55 @@
"deselect": "deselect"
},
"toolbar": {
"inspect": "Inspect",
"undo_redo": "Undo / Redo",
"recent": "Recent",
"favorites": "Favorites",
"add_feature": "Add Feature"
"add_feature": "Add Feature",
"finish": "Finish",
"generic": {
"title": "Geometries"
},
"geometry": {
"key": "T"
},
"repeat": {
"title": "Repeat",
"tooltip": {
"point": "Add another {feature} after this one.",
"way": "Start another {feature} after finishing this one."
},
"key": "R"
},
"segments": {
"title": "Segments",
"straight": {
"title": "Straight"
},
"orthogonal": {
"title": "Rectangular"
},
"key": "A"
},
"structure": {
"none": {
"title": "None"
},
"key": "S"
},
"support": {
"title": "Support",
"pole": {
"title": "Pole"
},
"tower": {
"title": "Tower"
},
"key": "S"
},
"toolbox": {
"title": "Tools",
"tooltip": "Customize the toolbar."
}
},
"title": {
"format": {
Expand All @@ -30,9 +74,9 @@
},
"modes": {
"add_feature": {
"title": "Add a feature",
"description": "Search for features to add to the map.",
"key": "Tab",
"search_placeholder": "Search feature types",
"description": "Browse features to add to the map.",
"key": "`",
"result": "{count} result",
"results": "{count} results"
},
Expand All @@ -52,7 +96,10 @@
"title": "Point",
"description": "Add restaurants, monuments, postal boxes or other points to the map.",
"tail": "Click on the map to add a point.",
"filter_tooltip": "points"
"filter_tooltip": "points",
"warning": {
"vertex_placement": "This must be placed along a line or area."
}
},
"add_note": {
"title": "Note",
Expand Down Expand Up @@ -574,10 +621,6 @@
"loading_auth": "Connecting to OpenStreetMap...",
"report_a_bug": "Report a bug",
"help_translate": "Help translate",
"sidebar": {
"key": "`",
"tooltip": "Toggle the sidebar."
},
"feature_info": {
"hidden_warning": "{count} hidden features",
"hidden_details": "These features are currently hidden: {details}"
Expand Down
21 changes: 5 additions & 16 deletions modules/behavior/add_way.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
import { dispatch as d3_dispatch } from 'd3-dispatch';

import { behaviorDraw } from './draw';
import { modeBrowse } from '../modes/browse';
import { utilRebind } from '../util/rebind';


export function behaviorAddWay(context) {
var dispatch = d3_dispatch('start', 'startFromWay', 'startFromNode');
var dispatch = d3_dispatch('start', 'startFromWay', 'startFromNode', 'cancel', 'finish');
var draw = behaviorDraw(context);

function behavior(surface) {
draw.on('click', function() { dispatch.apply('start', this, arguments); })
.on('clickWay', function() { dispatch.apply('startFromWay', this, arguments); })
.on('clickNode', function() { dispatch.apply('startFromNode', this, arguments); })
.on('cancel', behavior.cancel)
.on('finish', behavior.cancel);
.on('cancel', function() { dispatch.apply('cancel', this, arguments); })
.on('finish', function() { dispatch.apply('finish', this, arguments); });

context.map()
.dblclickZoomEnable(false);

surface.call(draw);
}


behavior.off = function(surface) {
surface.call(draw.off);
};

context.map().dblclickZoomEnable(true);

behavior.cancel = function() {
window.setTimeout(function() {
context.map().dblclickZoomEnable(true);
}, 1000);

context.enter(modeBrowse(context));
surface.call(draw.off);
};


behavior.tail = function(text) {
draw.tail(text);
return behavior;
};


return utilRebind(behavior, dispatch, 'on');
}
10 changes: 8 additions & 2 deletions modules/behavior/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ var _lastSpace = null;

export function behaviorDraw(context) {
var dispatch = d3_dispatch(
'move', 'click', 'clickWay', 'clickNode', 'undo', 'cancel', 'finish'
'move', 'click', 'clickWay', 'clickNode', 'undo', 'cancel', 'finish',
'rejectedVertexAsPoint'
);

var keybinding = utilKeybinding('draw');
Expand Down Expand Up @@ -138,7 +139,12 @@ export function behaviorDraw(context) {
dispatch.call('clickWay', this, choice.loc, edge, d);
return;
}
} else if (mode.id !== 'add-point' || mode.preset.matchGeometry('point')) {
} else {
if (mode.id === 'add-point' && !mode.preset.matchGeometry('point')) {
// attempting to add a vertex as an independent point
dispatch.call('rejectedVertexAsPoint', this);
return;
}
var locLatLng = context.projection.invert(loc);
dispatch.call('click', this, locLatLng, d);
}
Expand Down
Loading