Modify

Opened 4 years ago

Last modified 3 years ago

#20227 new defect

[Patch] Presets not displayed when creating new relation

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

Description (last modified by Don-vip)

When creating a new relation, presets are not displayed. One needs to close the relation dialog and re-open it.

I guess that this is because in org.openstreetmap.josm.gui.tagging.TagEditorModel#getTaggingPresetTypes, primitive is null.

I cannot fully test it, since ant run wont work for me (does not compile, some dependecy problems I dont want to dig into now), but this should fix it (at least when doing it manually in the debugger, it works):

  • src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

     
    381381        }
    382382
    383383        public void run() {
    384             RelationEditor.getEditor(MainApplication.getLayerManager().getEditLayer(), null, null).setVisible(true);
     384            RelationEditor.getEditor(MainApplication.getLayerManager().getEditLayer(), new Relation(), null).setVisible(true);
    385385        }
    386386
    387387        @Override

Attachments (3)

Bildschirmfoto von 2020-12-12 21-34-38.png (27.8 KB ) - added by michael2402 4 years ago.
Before fix
Bildschirmfoto von 2020-12-12 21-35-13.png (36.0 KB ) - added by michael2402 4 years ago.
Before fix - re-open
Bildschirmfoto von 2020-12-12 21-49-34.png (30.0 KB ) - added by michael2402 4 years ago.
after fix, new relation

Download all attachments as: .zip

Change History (10)

by michael2402, 4 years ago

Before fix

by michael2402, 4 years ago

Before fix - re-open

by michael2402, 4 years ago

after fix, new relation

comment:1 by michael2402, 4 years ago

Description: modified (diff)

comment:2 by GerdP, 4 years ago

Patch works as expected. There is an issue with some presets in the relation editor, see #20044.

comment:3 by michael2402, 4 years ago

That whole link workflow is broken. When opening a link, it opens a new modal window. You can change values there, then press OK, then press cancel in the original window => sub-dialog is applied.

Even worse: Click on a building, edit the building preset, click on the address link, then use 'New Relation',

A relation editor opens, but only contains the tags that you changed in that sub-dialog. Fields that are already filled are not applied to the new relation.

Next issues: Open the 'Annotation / Contact' window, then input something in 'wikipedia', then click on the link to the other contact preset (=> Value is missing), then apply that preset (=> value is written), then apply the original preset (=> value is silently overwritten deleted again)

I think that whole workflow is broken. By fixing the workflow and getting rid of modals opening new modals, we should be able to fix this.

I have two suggestions:
(1): Do not display the 'Edit also…' section in the preset editor. Instead, above the 'Tags' table, we not only display the current presets, but we also display a list of suggested presets (we can mark then with a 'suggested')
(2): Do not open a new window when clicking on that link. Instead, display it as an expandable panel inside the current preset editor. Use adapter pattern to provide a new tag adapter. We will need some work to make parallel editing possible (e.g. the two contact editors in one window)

comment:4 by GerdP, 4 years ago

That whole link workflow is broken.

Yes, and we already have some tickets about this. In my eyes the concept of relation editor being a modal dialog itself is broken or at least it is constant source for trouble, but my experience with dialog design is to poor to offer better solutions.

in reply to:  3 comment:5 by Klumbumbus, 4 years ago

Replying to michael2402:

(1): Do not display the 'Edit also…' section in the preset editor.

-1 That is a useful feature and a lot users will miss it. Also it is currently a fundamental feature as the whole presets file is based on this, e.g. all shops link to the contact, address and payment presets.

Instead, above the 'Tags' table, we not only display the current presets, but we also display a list of suggested presets (we can mark then with a 'suggested')

-1 The vertical space there is limited and by displaying the matching presets it is already sometimes too much used space compared to the rest of the dialog/the other dialogs. Displaying there possible matching presets too would overwhelm that list. (We already have the preference keys properties.presets.visible and properties.presets.top)

in reply to:  4 comment:6 by michael2402, 4 years ago

Replying to GerdP:

Yes, and we already have some tickets about this. In my eyes the concept of relation editor being a modal dialog itself is broken or at least it is constant source for trouble, but my experience with dialog design is to poor to offer better solutions.

Yes, especially since the relation editor (non-blocking modal, ok/cancel), presets (blocking modal, ok/cancel) and normal tag editor (sidebar, automatically applied) is very different and having all those editing schemes in one editor is really confusing for new users or users that don't use the editor that often. I don't think this can be changed though - JOSM users are very conservative, we won't get any new UI concepts or big ui changes there, so it is not even worth spending the effort in designing something new.

comment:7 by Don-vip, 3 years ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to michael2402.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.