Skip to content

Distinguish source fields between changesets and presets#258

Merged
erictheise merged 1 commit into
stagingfrom
1ec5-field-source-preset-1275
May 28, 2026
Merged

Distinguish source fields between changesets and presets#258
erictheise merged 1 commit into
stagingfrom
1ec5-field-source-preset-1275

Conversation

@1ec5
Copy link
Copy Markdown
Member

@1ec5 1ec5 commented Apr 19, 2026

Copied id-tagging-schema’s Sources field into a separate Source field for use in presets, leaving the Sources field largely unmodified. Also simplified the code to generate indexed variants of the Source field. This effectively restores the original combo box Sources field to the changeset editor, where we haven’t implemented multiple source fields and don’t expect as much source metadata as on elements. iD does some magic with the changeset-only Sources field that we don’t want to get in the way of.

Fields that can appear multiple times now use stringsCrossReference to inherit the label from the original base field with the index appended, all independently of the raw key. Added parentheses around the index in the label and localize it according to the current locale’s numeral system.

Source, Source (1), Source (2) Nguồn with a dropdown of preset options plus gpx.

Fixes OpenHistoricalMap/issues#1275.

Copied id-tagging-schema’s Sources field into a separate Source field for use in presets, leaving the Sources field largely unmodified. Simplified the code to generate indexed variants of the Source field.

Fields that can appear multiple times now use stringsCrossReference to inherit the label from the original base field with the index appended, all independently of the raw key. Added parentheses around the index in the label and localize it according to the current locale’s numeral system.
@1ec5 1ec5 requested a review from erictheise April 19, 2026 03:16
@1ec5 1ec5 self-assigned this Apr 19, 2026
@1ec5 1ec5 added the bug label Apr 19, 2026
@1ec5 1ec5 force-pushed the 1ec5-field-source-preset-1275 branch from ba17e2d to 7255655 Compare April 19, 2026 03:18
@1ec5
Copy link
Copy Markdown
Member Author

1ec5 commented Apr 19, 2026

To verify that this fixes OpenHistoricalMap/issues#1275, I pointed my local copy to an OAuth application I registered on api06.dev.openstreetmap.org, saved a changeset with custom source=* values, then tried opening and closing the changeset editor. I also reproduced the issue on staging, set a breakpoint before the error, and manually defined sourceField.impl.setCustomOptions() as a no-op to verify that this prevents the error.

@1ec5
Copy link
Copy Markdown
Member Author

1ec5 commented Apr 19, 2026

For convenience when reviewing this pull request, it does not include changes that result from running npm run build or npm run dist. We’ll have to rebuild iD before deploying it to staging. OpenHistoricalMap/issues#1342 tracks making this a normal part of the branch management process.

Copy link
Copy Markdown
Member

@erictheise erictheise left a comment

Choose a reason for hiding this comment

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

Not possible to test without incorporating into ohm-website.

@erictheise erictheise merged commit 979b872 into staging May 28, 2026
6 checks passed
erictheise added a commit to OpenHistoricalMap/ohm-website that referenced this pull request May 28, 2026
erictheise added a commit to OpenHistoricalMap/ohm-deploy that referenced this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upload screen reappears after dismissing post-save screen

2 participants