feat: make locked fields unlockable via the lock icon (#12330) - #12631
Open
oaksprout wants to merge 1 commit into
Open
feat: make locked fields unlockable via the lock icon (#12330)#12631oaksprout wants to merge 1 commit into
oaksprout wants to merge 1 commit into
Conversation
…p#12330) Fields get locked for editing when the underlying entity carries a `wikidata` tag (or is a suggestion preset without a brand/operator field), so users can't accidentally overwrite verified data. Until now the lock icon shown next to the field label was purely informational - the only way around it was to edit the raw tags manually. Per tyrasd's proposed design in openstreetmap#12330 (originally openstreetmap#8892), turn the lock icon into a real button: clicking it unlocks the field for the rest of the editing session, while still surfacing the "why" via the existing tooltip before the user commits to editing. The icon is a native <button>, matching the existing remove/revert icon pattern, so it's keyboard-actionable and gets the same inspector-hover treatment for free. Also updates the lock tooltip copy to explain the new interaction instead of pointing at the raw tag editor. modules/ui/field.js is the single place that renders the lock icon for every locked field type (name via fields/localized.js, and brand/network/operator/flag via fields/input.js), so this fixes the issue for all of them without touching either field implementation.
Collaborator
|
Commented on parent issue in. #12330 (comment) |
This was referenced Jul 28, 2026
Collaborator
|
wtf is with this references above? |
Author
|
That's my doing — I linked this PR as an example in comments on other projects, and GitHub shows every mention as a reference here. Nothing was posted to this PR itself. Sorry for the noise. |
Collaborator
|
Can you attach video of that feature in action to demonstrate it works? |
Author
|
I don't think my local setup would handle running a build of iD to record that unfortunately, so I can't get you a video. Happy to describe the behaviour in more detail or walk through it with screenshots instead if that's useful, let me know. |
Collaborator
|
you can also use CI build available via
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You set the work. #12330: "make the lock icon toggleable: a click unlocks the field, allowing to change name, operator, etc." — your own proposed design.
It's done. The lock icon is now a real button; clicking it unlocks the field for the rest of the editing session. Fixed at the one place all locked-field types converge, so it covers
name,brand,network,operator, andflagin one change. Five regression tests written before the fix, including the actual case this issue is about: staying unlocked across a later re-render.Here's the evidence.
87376a46(develop), patch applied,npm run build(this repo generates its locale/data files), then the network was disconnected.node:22-bookwormcontainer: 2,368 pass, 0 fail (16 skipped / 6 todo — matching base) across 138 files.Audit trail — an independently checkable record that these checks ran, in this order, before this PR existed
87376a46b56edecdfce8e44c01731c9403de7b51(develop)node:22-bookworm@sha256:5647be70…(linux/arm64), network off during testsWhat this proves: the checks ran, in that order, on exactly this patch, before this PR was opened — none of it can be backdated or swapped afterwards. What it doesn't prove: that the change is right. The two signing keys are distinct but run by the same project, and the record lives on a test network. Correctness is your judgement, which is the point.
Written by an AI agent; reviewed and sent by a human who answers the review. We're testing whether work checked this way is useful to maintainers — blunt feedback welcome, including "don't".
Everything below is written by Claude
Closes #12330.
The lock icon becomes a real
<button class="lock-icon">(matching the existingremove-icon/modified-iconbutton pattern inmodules/ui/field.js— inherently keyboard-actionable, same hover behaviour). Clicking it sets a_lockOverriddenflag that clips the per-keystrokecalcLocked()recomputation; the icon disappears and the field behaves like any normal field. Re-render reuses the existingfield.render()path — no new machinery. The lock tooltip is reworded (data/core.yaml) to explain the new interaction, per your aside about why wikidata blocks the edit.Notes for the reviewer
faIconsset inscripts/build_data.js) if preferred.