Skip to content

feat: Add real-time character limit warning tooltip for tag values#11844

Open
JaiswalShivang wants to merge 7 commits intoopenstreetmap:developfrom
JaiswalShivang:fix/255-char-warning
Open

feat: Add real-time character limit warning tooltip for tag values#11844
JaiswalShivang wants to merge 7 commits intoopenstreetmap:developfrom
JaiswalShivang:fix/255-char-warning

Conversation

@JaiswalShivang
Copy link
Contributor

@JaiswalShivang JaiswalShivang commented Feb 3, 2026

Fixes #10241

Summary

Adds a visual warning tooltip that appears in real-time when users exceed the 255 character limit for tag values in the raw tag editor.

Problem

Previously, users had no immediate feedback when entering tag values that exceeded OpenStreetMap's 255 character limit. They would only discover the issue later, leading to confusion and a poor editing experience.

Solution

  • Added a warning tooltip that appears dynamically below the value input field when the character limit is exceeded
  • Tooltip displays: "only 255 characters are allowed"
  • Styled with a red background and upward-pointing arrow for clear visibility
  • Smooth fade-in/fade-out animation for better UX

Changes

  • modules/ui/sections/raw_tag_editor.js - Added warning span element and real-time input validation
  • css/80_app.css - Added tooltip styling with arrow indicator
  • data/core.yaml - Added translation key for warning message

Demo

2026-02-03.13-37-43.mp4

Testing

  1. Open iD editor and select any feature
  2. In the raw tag editor, add or edit a tag value
  3. Type more than 255 characters
  4. Observe the warning tooltip appears below the input field
  5. Delete characters to go below 255 - tooltip disappears

Checklist

  • Code follows the project's coding standards
  • No breaking changes to existing functionality

@JaiswalShivang
Copy link
Contributor Author

Hi @tordans,
I previously uploaded the wrong code /demo for this issue. This new PR contains the correct implementation and demo.
I have also closed the previous PR to avoid confusion.
Please review when you have time. Thank you!

Copy link
Member

@tyrasd tyrasd left a comment

Choose a reason for hiding this comment

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

Did you try to use the existing module uiLengthIndicator? I do actually like the styling of the error case with the redish background color and underline. But the styling should be consistent between the different places where this error can occur (i.e. regular fields vs. in the raw tag editor), so if possible this should be incorporated into the existing length indicator ui widget.

@JaiswalShivang

This comment was marked as outdated.

@JaiswalShivang
Copy link
Contributor Author

@tyrasd I’ve implemented the suggested changes so that each tag row now uses its own instance of uiLengthIndicator, and the character limit warning appears correctly for each input. I’ve also removed obsolete code and translation keys as discussed.

I’m attaching a short video to demonstrate the updated behavior: you’ll see that the warning now displays as expected when a tag value exceeds the character limit, and each row handles its own indicator independently. Please let me know if you have any further feedback or requests!

Video

2026-02-03.14-57-22.mp4

@tyrasd tyrasd added the usability An issue with ease-of-use or design label Feb 3, 2026
@JaiswalShivang

This comment was marked as spam.

@matkoniecz

This comment was marked as outdated.

@JaiswalShivang
Copy link
Contributor Author

Oops, accidentally hit the close button! Reopened it right away. The PR is updated and ready for review.

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

Labels

usability An issue with ease-of-use or design

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag values over 255 characters long are silently truncated in raw tag editor

3 participants