Skip to content

keep recently edited relations in membership dropdown for entire session#11588

Open
k-yle wants to merge 1 commit intodevelopfrom
kh/add-relation-memory
Open

keep recently edited relations in membership dropdown for entire session#11588
k-yle wants to merge 1 commit intodevelopfrom
kh/add-relation-memory

Conversation

@k-yle
Copy link
Copy Markdown
Collaborator

@k-yle k-yle commented Nov 17, 2025

Closes #3622

The relation dropdown list now remembers relations that you've already added during this edit session. Even if those relations are no longer visible on screen.

Showing every downloaded relation as originally proposed in #3622 becomes pretty chaotic, I think this is a reasonable compromise which is still quite helpful

1ec5
1ec5 previously approved these changes Nov 18, 2025

if (d.relation) {
recentlyAdded.add(d.relation.id);
allAdded.add(d.relation.id);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would end up being a negative counter decrementing from zero.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i think the choice of variable names is a bit confusing, adding doesn't mean creating a new relation, but rather adding a member to a relation.

for example:

  • select w7634775
  • click + in the sidebar to add w7634775 as a member of any relation
  • pan somewhere completely different, and the relation you selected earlier will still be visible

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, so “selected” is probably a less confusing name internally. I hope users can figure out that that’s why these relations are lingering in the menu.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we think this will be confusing, we could exclude some relations that are always "local", for example type=restriction.

but as always when we hardcode random tags, it could cause even more confusion because no one can understand the logic

@1ec5 1ec5 dismissed their stale review November 18, 2025 09:23

Actually, this doesn’t seem to work for me. If I pan out of view, the relation list includes all the relations that aren’t in view, except for the ones I created.

Comment on lines +320 to +321
// any relation that has previously been added will remain
// in the dropdown for the rest of the edit session.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be more intuitive if we sort some or all of the relations by recency instead of relation ID, as proposed in #7964?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think that would help, but a much more significant improvement would be openstreetmap/id-tagging-schema#1538 - this would filter out all the illogical options.

e.g. it would stop you from adding a road directly to a superroute, or adding a tree to a boundary relation, etc. etc.

var _maxMemberships = 1000;
/** @type {Set<string>} relations that were added after this panel was opened */
const recentlyAdded = new Set();
/** @type {Set<string>} all relations that had members added during this edit session */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only added? maybe also keep ones where members were removed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only added is intentional and desirable - then can you edit PR title?

@matkoniecz
Copy link
Copy Markdown
Contributor

From discussion: idea sounds nice, but there are some potential problems.

What about turn restrictions? If someone adds bunch of no-left-turn with excellent iD turn restrictor editor "helpfully" listing them forever is not going to be useful.

When user splits road with 50 bus relations they do not want to be haunted by this horde of Flixbus routes, probably.

Maybe limit it to some subset of relations?

@k-yle
Copy link
Copy Markdown
Collaborator Author

k-yle commented Mar 5, 2026

yeah, I've changed my mind about this idea, after using this PR for several months.

  • It's great for type=route and type=boundary relations (which are inherently large).
  • but it's annoying for 'local' relations like site=traffic_signals or type=restriction, since their bbox is always small.

So I'm happy to close this and revisit it after openstreetmap/id-tagging-schema#1538, when the list of relations will be significantly smaller1

Footnotes

  1. because implausible/invalid options won't be shown anymore

@matkoniecz
Copy link
Copy Markdown
Contributor

Which in turn is blocked by ideditor/schema-builder#134

I guess that if anyone is interested in pushing them forward then commenting there on proposed code may be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep relations in relation membership dropdown for entire session

3 participants