Modify

Opened 2 years ago

Closed 21 months ago

Last modified 20 months ago

#7671 closed enhancement (fixed)

Show last 5 used tags in "Add key/value" dialog for selecting with a single click

Reported by: flaimo Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description (last modified by Don-vip)

When working in a certain area, you often need the same 5-10 key/value combinations. It would make working with the add key/value dialog much quicker, if, instead of always having to enter the key again and again (or trying to find the preset in the hierarchy of the preset dropdown menu), you could select from the last 5-10 used key/value combinations with a single click. The list could get displayed above or below the fields for key value. See attached mockup screen:

Mockup of the add key/value dialog

Attachments (12)

add_key_value_mockup.png (28.3 KB) - added by flaimo 2 years ago.
Mockup of the add key/value dialog
7671.patch (4.8 KB) - added by simon04 23 months ago.
7671.png (5.8 KB) - added by simon04 23 months ago.
7671v2.patch (5.1 KB) - added by Don-vip 21 months ago.
7671v2.png (8.7 KB) - added by Don-vip 21 months ago.
7671v3.patch (10.5 KB) - added by Don-vip 21 months ago.
7671v3.png (31.6 KB) - added by Don-vip 21 months ago.
7671_layoutbug.png (28.4 KB) - added by Don-vip 21 months ago.
add_tag_without_wrap.png (108.4 KB) - added by skyper 21 months ago.
screenshot
bug_add_tag.png (48.0 KB) - added by Don-vip 21 months ago.
7671-LongName.osm (366 bytes) - added by AlfonZ 21 months ago.
7671-CutItem.png (11.0 KB) - added by AlfonZ 21 months ago.

Download all attachments as: .zip

Change History (52)

Changed 2 years ago by flaimo

Mockup of the add key/value dialog

comment:1 Changed 2 years ago by flaimo

  • Summary changed from Show last 5 used tags in "Add key/value" dialog for selecting ith a single click to Show last 5 used tags in "Add key/value" dialog for selecting with a single click

comment:2 Changed 2 years ago by Don-vip

  • Description modified (diff)

comment:3 Changed 2 years ago by skyper

nice enhancement

Changed 23 months ago by simon04

Changed 23 months ago by simon04

comment:4 Changed 23 months ago by simon04

  • Summary changed from Show last 5 used tags in "Add key/value" dialog for selecting with a single click to [Patch] Show last 5 used tags in "Add key/value" dialog for selecting with a single click


comment:5 Changed 23 months ago by flaimo

i have one additional request: it would be nice if those 5 tags could be accessed directly using keyboard shortcuts. preferably with combinations that play nice with the default keyboard shortcut for accessing the "new key/value" dialog, so you don't break your fingers.

comment:6 Changed 23 months ago by simon04

How to know what the i-th tag will be (when not having a dialog)?

comment:7 Changed 23 months ago by flaimo

just put a 1., 2., a.s.o. in front of the text for the tag and the corresponding shortcut would be something like ctrl+alt+1 ,2, 3,...

comment:8 Changed 23 months ago by simon04

I don't think that users should have to recall the tags associated to indices 1–5 (esp., as they might change). Aren't (custom) presets better suited in this case?

comment:9 Changed 23 months ago by flaimo

if you put the numbers 1-5 in front of every tag (numbered list) that should be no problem. it is actually more hindersome to users like me if you do not implement keyboard shortcuts, because then i am forced to switch between keyboard and mouse for triggering functions. keyboard-shortcuts are always faster if you learned to use them.

comment:10 Changed 23 months ago by Don-vip

I liked the idea in the original mockup of having a small icon, too :)

comment:11 Changed 23 months ago by flaimo

since there must be some algorithm which determinates the icons displayed in the map (based on the tags), maybe it can be utilized to also display the icon beside the tag in the dialog.

comment:12 Changed 22 months ago by anonymous

You're saying "trying to find the preset in the hierarchy of the preset dropdown menu", but for this case, the F3 shortcut seems enough for me. It brings a dialog box when you can filter the presets, and the previously used ones are placed on top of the list.

But, your proposal is interesting for tags that are not in presets. I use Ctrl-C / Ctrl-Shift-V but it works for only one set of tags.

An other solution could be to add a feature for easily create a new preset (in my memory, we have to edit a text file outside from josm).

Nicolas Dumoulin (josm user)

comment:13 Changed 22 months ago by simon04

An alternative idea: Like for repeating search operations or selections in the selection dialog, we could also here use the drop-down menu indicated on the "Add" button.

Changed 21 months ago by Don-vip

Changed 21 months ago by Don-vip

comment:14 Changed 21 months ago by Don-vip

New patch version to add numbers, hand cursor and tooltip. Still missing: icons and keyboard shortcuts (Ctrl+1, Ctrl+2, etc ?)


Changed 21 months ago by Don-vip

Changed 21 months ago by Don-vip

comment:15 follow-up: Changed 21 months ago by Don-vip

New patch version. I have removed the numbers, the result wasn't good with the icons. The shortcuts have been implemented and appear in tooltips:


What about the dummy icon ? Should we hide it or keep it ?

comment:16 follow-up: Changed 21 months ago by stoecker

Looks like "Checkin now" for me. :-)

The lines are clickable?

comment:17 in reply to: ↑ 16 Changed 21 months ago by Don-vip

Replying to stoecker:

The lines are clickable?

Yes, with a hand cursor that do not appear when I make a screenshot, like in search dialog.

comment:18 follow-up: Changed 21 months ago by akks

I like this idea and patch!

I hope there will be not many conservators with extra-small displays. Maybe you can do extended parameter to hide slection panel for them. :)

Another idea: if you click label with Ctrl (or Shift), tag can be added automatically without closing a window and if with Shift(Ctrl?), tag is added and windows closes automatically.

Last edited 21 months ago by akks (previous) (diff)

comment:19 in reply to: ↑ 15 Changed 21 months ago by bastiK

Replying to Don-vip:

New patch version. I have removed the numbers, the result wasn't good with the icons. The shortcuts have been implemented and appear in tooltips:


Looks nice.

What about the dummy icon ? Should we hide it or keep it ?

The warning icon just indicates tagging errors, in this case a node tagged as oneway=yes. So I think it should be hidden. The MapImage class has a "name" field, that could be used for filtering.

comment:20 in reply to: ↑ 18 Changed 21 months ago by Don-vip

Replying to akks:

Maybe you can do extended parameter to hide slection panel for them. :)

Sounds reasonable and does no harm :)

Another idea: if you click label with Ctrl (or Shift), tag can be added automatically without closing a window and if with Shift(Ctrl?), tag is added and windows closes automatically.

Sounds complicated. I think Ctrl+(1-5) + Enter is enough for power users using keyboard only :)

comment:21 Changed 21 months ago by akks

Problem is not Enter, but Alt-A after Enter :). Ctrl-123 (release ctrl) would be the best to add all tags 1,2 and 3, but harder to implement.

I hope, number of recent tags will be configurable?

Last edited 21 months ago by akks (previous) (diff)

comment:22 Changed 21 months ago by Don-vip

  • Resolution set to fixed
  • Status changed from new to closed

In 5383/josm:

fix #7671 - Show last N used tags in "Add key/value" dialog for selecting with a single click

LRU tags are shown in reverse order (most recent first).

This can be customized by setting the property properties.recently-added-tags to an integer between 1 and 9.
This can be disabled by setting the same property to a number lesser or equal to 0.

Keyboard shortcuts Ctrl+1 to Ctrl+9 are available in the context of the "Add property" dialog only.

comment:23 Changed 21 months ago by Don-vip

Thank you all for your feedback ! And Simon for initializing the patch :)

comment:24 Changed 21 months ago by Don-vip

  • Resolution fixed deleted
  • Status changed from closed to reopened

Changed 21 months ago by Don-vip

comment:25 Changed 21 months ago by Don-vip

Something broke the dialog layout:


comment:26 Changed 21 months ago by skyper

Looks similar to #7543

comment:27 Changed 21 months ago by Don-vip

  • Resolution set to fixed
  • Status changed from reopened to closed

In 5385/josm:

Hope it fixes #7671 layout bug (happened only once and cannot reproduce)

comment:28 follow-ups: Changed 21 months ago by Zverik

  1. When clicking on a last used tag, sometimes it autocompletes (e.g. was "service=driveway", pastes "service:what:ever=driveway").
  2. After writing a long key (e.g. "addr:street"), lines in last used tags list are reformatted and occupy several lines, thus hiding "OK" and "Cancel" buttons.

comment:29 in reply to: ↑ 28 Changed 21 months ago by skyper

Replying to Zverik:

  1. When clicking on a last used tag, sometimes it autocompletes (e.g. was "service=driveway", pastes "service:what:ever=driveway").
  2. After writing a long key (e.g. "addr:street"), lines in last used tags list are reformatted and occupy several lines, thus hiding "OK" and "Cancel" buttons.

Can not reproduce. Lines do not wrap leading to dialog boxes which are wider than screen width.

Please submit more info.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-08-01 01:31:11
Last Changed Author: Don-vip
Revision: 5387
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-07-31 23:27:44 +0200 (Tue, 31 Jul 2012)
Last Changed Rev: 5387

Identification: JOSM/1.5 (5387 de)
Memory Usage: 38 MB / 248 MB (7 MB allocated, but free)
Java version: 1.6.0_18, Sun Microsystems Inc., OpenJDK Client VM
Operating system: Linux
Dataset consistency test: No problems found

screenshot

Last edited 21 months ago by skyper (previous) (diff)

Changed 21 months ago by skyper

screenshot

comment:30 Changed 21 months ago by Don-vip

  • Resolution fixed deleted
  • Status changed from closed to reopened

Changed 21 months ago by Don-vip

comment:31 in reply to: ↑ 28 Changed 21 months ago by Don-vip

Replying to Zverik:

  1. After writing a long key (e.g. "addr:street"), lines in last used tags list are reformatted and occupy several lines, thus hiding "OK" and "Cancel" buttons.

I agree on that point:


comment:32 Changed 21 months ago by Don-vip

  • Summary changed from [Patch] Show last 5 used tags in "Add key/value" dialog for selecting with a single click to Show last 5 used tags in "Add key/value" dialog for selecting with a single click

comment:33 Changed 21 months ago by Don-vip

In 5424/josm:

see #7671, see #7951 - incorrect contents of value combobox when clicking on a "Recently added tags"

comment:34 Changed 21 months ago by Don-vip

In 5425/josm:

see #7671, see #7951 - prevents unwanted line breaks with values composed of several words

comment:35 in reply to: ↑ 28 ; follow-up: Changed 21 months ago by Don-vip

Replying to Zverik:

  1. When clicking on a last used tag, sometimes it autocompletes (e.g. was "service=driveway", pastes "service:what:ever=driveway").

Reproduced, with source=Bing becoming source:addr:postcode=Bing

comment:36 in reply to: ↑ 35 Changed 21 months ago by Don-vip

Replying to Don-vip:

Replying to Zverik:

  1. When clicking on a last used tag, sometimes it autocompletes (e.g. was "service=driveway", pastes "service:what:ever=driveway").

Reproduced, with source=Bing becoming source:addr:postcode=Bing

OK this occurs when you click on a tag with a key already existing for this object. I will disable the links in this case with an explanation tooltip.

comment:37 Changed 21 months ago by Don-vip

  • Resolution set to fixed
  • Status changed from reopened to closed

In 5427/josm:

fix #7671 - Fix (last ?) problem with recently added tags (unwanted autocompletion when the key already exists)

Changed 21 months ago by AlfonZ

Changed 21 months ago by AlfonZ

comment:38 Changed 21 months ago by AlfonZ

Could you please try following steps:

  1. Open 7671-LongName.osm.
  2. Add new node, keep it selected.
  3. Add new tag note=q w e r t y.
  4. Add new tag name=foo. After switching to the value field, the item in recently added tags list gets distorted.
  5. Undo both new tags.
  6. Open new tag dialog. Select note=q w e r t y from the list. The value gets autocompleted to q w e r t y u i o p a s d f g h j k l z x c v b n m (value from the other node). As I understand it, this isn't common situation, as it happens only when the value is not in the current dataset (because it was added in other dataset, or the last remaining instance was changed/removed).
Identification: JOSM/1.5 (5432 SVN en)
Memory Usage: 123 MB / 1484 MB (102 MB allocated, but free)
Java version: 1.7.0_05, Oracle Corporation, Java HotSpot(TM) Client VM
Operating system: Windows XP
Dataset consistency test: No problems found

comment:39 Changed 21 months ago by Don-vip

In 5433/josm:

fix #7671 for good (forgot this last fill() in my last commit). Thanks to AlfonZ for the bug report.

comment:40 Changed 20 months ago by flaimo

I just tried out the feature I requested for the first time. Looks good, but I think it needs some refinement: http://josm.openstreetmap.de/ticket/8024

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.