-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a button in the mapillary image photo viewer to "add the current image id as field to feature" #10046
Add a button in the mapillary image photo viewer to "add the current image id as field to feature" #10046
Conversation
more info see openstreetmap#6196 (comment) I do the b. (set button) and c. (view button) order: click OSM object -> click mapillary layer will close the OSM input field. need to do in reverse order
It is the a. part in openstreetmap#6196 (comment) still need to add button disabled logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey. This is awesome!
There are only a few minor-ish things I would change:
- The icon used inside of the mapillary viewer is not all too intuitive: One might assume that it refreshes the image or something like that. Maybe the
load
icon would be better? Or theoperation-extract
one? Or the+
fromoperations-merge
? - The used strings should be made independent from the photo service provider to be able to be used them in the future with the other street level photo providers as well. See suggestions below.
- The button to set the mapillary tag should be disabled or hidden if no OSM entity is selected.
- The button to open the viewer should be disabled if the photo is already currently displayed
- If the mapillary id of an OSM object is invalid or does not exist, the viewer is opened showing the last selected photo (or remains open if it was already showing a photo). It would be better if the viewer would show some kind of error state in this situation.
refactor the code expandability for other photo_overlay Not sure about context.features().on('change'), and hash part
1 problem remain: if entity select and close the photoviewer, view button will not update class, still clickable though
set button in field and photoviewer are both use to set current id to input,
|
and update input.js
button disable class reacts to photoviewer close
'_' change to '-'
@laigyu why did you close this PR? I was looking forward to seeing it as part of iD at some point? |
@laigyu I tested the UI and I suggest you split of a few things just to make this easier to merge an iterate on. The part that is most clear to me is his use case: UseCase A: Add the Mapillary field. And if an mapillary image is selected, provide an action to copy the iD into the field.This part of the UI and interaction looks good to me with some adjustments
iconI assume we are using font awesome free icons here, right? I looked at some options, here are my picks
border radiusIt looks like, this CSS needs to change: .ideditor[dir='ltr'] .form-field-input-identifier > input:last-child,
.ideditor[dir='rtl'] .form-field-input-identifier > input:first-child,
- .ideditor[dir='ltr'] .form-field-input-identifier > button {
+ .ideditor[dir='ltr'] .form-field-input-identifier > button:last-child {
border-bottom-right-radius: 4px;
} so the radius is only applied to the last button I suggest to make a PR that only includes this change, which should be much easier to merge. |
About the other usecases… UseCase B: Show current mapillary image from the sidebarI think this is a nice idea, but it has a lot of edge cases that are hard to get right. I suggest to work on this last, because there is a feature to show the current image already. It is not as ideal, because it opens it in an new tab, but the other use cases are more important IMO. This is what it looks like now The issues I see is, that one can show an image but that show click does not activate the mapillary overlay, it only shows the current image. Apart from that, I think the Icon and interaction is good. There is also this issue from #10046 (review)
|
About the other usecases UseCase C: Add a
|
so there should be only two button right ? |
|
I remove a and b part , only left C part
I think the svg is from svg
I think already has tooltip. currently is
I think position is already at the top left corner. but I dont know why your pic is not as same as mine. plz check if still wrong
I see your pic show two button + + , could you give me step to reproduce it functionality : currently the button is listen to Any suggestions are welcome.Thank you |
I think reducing the footprint of this feature is good thing. Some feedback:
I thing this svg is the wrong folder it is https://github.com/openstreetmap/iD/tree/develop/svg/iD-sprite which tyrasd referenced in #10046 (review) The
If possible, I really think we should use the black tooltip for this.
It is working now. I opened #10193 about the technical issue behind it.
This is gone now, as well. No idea why the Btw, selecting multiple feature and using the feature also works like it should. open issue 1: show button once feature is selected
Yes, that is an issue that needs to be fixed somehow. open issue 2: hide button once no feature is selected (anymore)The other issue is, that the open issue 3: disable, not hide buttonIn #10046 (review) the suggestion is to disable the buttons, not hide them. (They need a visual disabled state for that; maybe a
|
besides button svg, I think is good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looks like I never clicked "send" on those wording suggestions.
data/core.yaml
Outdated
@@ -788,6 +788,10 @@ en: | |||
inch: in | |||
max_length_reached: "This string is longer than the maximum length of {maxChars} characters. Anything exceeding that length will be truncated." | |||
set_today: "Sets the value to today." | |||
set_photo_from_viewer: "Store this photo on the currently selected map object" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_photo_from_viewer: "Store this photo on the currently selected map object" | |
set_photo_from_viewer: "Tag this photo id on the currently selected map object" |
"Store" suggest an upload / file. But it is only the id that is referenced as a tag. Maybe like this?
data/core.yaml
Outdated
@@ -788,6 +788,10 @@ en: | |||
inch: in | |||
max_length_reached: "This string is longer than the maximum length of {maxChars} characters. Anything exceeding that length will be truncated." | |||
set_today: "Sets the value to today." | |||
set_photo_from_viewer: "Store this photo on the currently selected map object" | |||
set_photo_from_field: "Use the currently displayed photo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_photo_from_field: "Use the currently displayed photo" | |
set_photo_from_field: "Use the id of the currently displayed photo" |
data/core.yaml
Outdated
@@ -788,6 +788,10 @@ en: | |||
inch: in | |||
max_length_reached: "This string is longer than the maximum length of {maxChars} characters. Anything exceeding that length will be truncated." | |||
set_today: "Sets the value to today." | |||
set_photo_from_viewer: "Store this photo on the currently selected map object" | |||
set_photo_from_field: "Use the currently displayed photo" | |||
show_photo_from_field: "Open image in viewer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show_photo_from_field: "Open image in viewer" | |
show_photo_from_field: "Open image in street-level photo viewer" |
Just to make it a bit more precise.
@laigyu this looks great, thanks. And @tyrasd I think this is ready for another review from you. Maybe @tyrasd can polish off the wordings / resolve the wording suggestions? There is a minor thing that gave me pause: Whenever I select an image which was already added as tag, the image PLUS is disabled. However, there is no help in the UI that explains why it is disabled. What do do…
|
@tordans I think we dont need usecase a button,which is offer the same functionanality as the usecase c button, |
(this one is also used in other similar UI locations, e.g. the "add tag" in the raw tags editor, etc.)
code: we should not to not rely on directly manipulating/accessing other components DOM elements
Sorry for the long wait on this PR. I've in the meantime fixed one last(?) bug: The "add mapillary tag" button was not shown if a map feature was newly created while a street level photo was open1. Also, I refactored some parts of the code: It's not good practice to directly rely on other modules' DOM elements, as the implementation details could change at any moment and would break the functionality here. The implementation now directly manipulates the respective OSM entities2 instead. There is now also a limit of (an arbitrary) 100m to the distance between the map feature and the photo to prevent accidentally adding a mapillary tag to a far away map feature. Finally, I've made minor tweaks to the icon (slightly smaller @tordans maybe you would like to give it a final look-over to check whether this didn't introduce any new bugs? 🙇 Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tyrasd thanks for the update <3. I checked the frontend / UX just now and all works great.
There are things to optimize, but I am not sure they are relevant enough as to hold this back…
-
when I add an image with
+
, then move up/down the image-path (AKA next/prev image), I cannot overwrite the image (anymore?) – this is something I see myself doing. However, I can still remove the image from the field first, then reselect the feature, then add with+
- note that the same does work, when I change to a different image, so both cases (the one below) might actually be the same
-
add image with
+
, then use the undo or trash icon on the mapillary field to remove the image id again. Now the plus will be disabled with the "already_set" reason until I un-and-reselect the feature. — I don't think this is a relevant use case, so I would leave it as is. -
The same issue is true for the undo action: use
+
to add the image id to a building, use cmd+z to undo the change => now i cannot re-add the image, or the next/prev image (which would be my use case) but instead have to reselect the building first.
good catch, this should now work as expected
this works for me (already before today's fix commit)?! maybe I'm overlooking an edge case where this is not updating properly? If this still exists: could you maybe open a new issue and list the individual steps to reproduce it? |
#9339
#6196 (comment)
edit : this pr only focus on button in viewer