Repository navigation
Date Range after iD update - #142
Conversation
| const section = uiSection('date_ranges', context) | ||
| .label(t('date_ranges.title')) | ||
| .disclosureContent(renderDisclosureContent) | ||
| .expandedByDefault(false); |
There was a problem hiding this comment.
In the future, maybe we could consider replacing this separate section with a selectively disclosed row right under the “OpenHistoricalMap Data” checkbox in the Data Layers section. This would make the date filter more discoverable and also consistent with the street-level imagery date filter.
|
I'm not reviewing this at code level but I have been testing locally, building on my comment above. In this view, the Hotel Seattle in fact disappears, as it should. But all these other things hand around: I am digigng into it to understand why... |
|
@danrademacher I think that’s due to #142 (comment); the fix hasn’t been pushed yet. |
Yes! I have the filtering really working this time. I was referring to the wrong commit in my notes yesterday, chased a red herring for some time. |
1ec5
left a comment
There was a problem hiding this comment.
Thanks for iterating on this PR. I think the only thing remaining is to see if we can minimize the number of times utilNormalizeDateString() gets called within featureFitsDateRange() (which is called frequently), partly by offloading some of that to ensureValidInputs().
Other than that, this should be good to merge. @danrademacher, have you gotten a chance to try it out again? I think it’s feeling pretty good at this point, but you seem to have the more extensive testbed. 😉
1ec5
left a comment
There was a problem hiding this comment.
We’re so close – thank you for your detailed work on this feature. I can’t approve the PR, so here’s some final feedback while we wait for an approval.
|
Just wanted to show my appreciation here 👏 this is fantastic work @1ec5 @gregallensworth - can't wait to see this go live. |
Moved the format to the placeholder for consistency with the Start Date and End Date inspector fields, and to avoid user confusion that the “e.g.” might need to be part of the input.
If a feature’s date range begins at the same time that the selected date range ends or vice versa, consider it an overlap and show the feature, because it may overlap at a higher precision expressed by the feature or filter.
| tooltip: The end date in YYYY-MM-DD format, for example 1969-07-16. Use -0001 for the year 2 BCE. | ||
| placeholder: YYYY-MM-DD |
There was a problem hiding this comment.
I went to fix a typo but wound up swapping the example and format between the tooltip and placeholder. This makes the placeholder consistent with the placeholder in the Start Date and End Date fields of the inspector. I also added another example to illustrate negative years, since some mappers might be unaware of the potential for off-by-one error caused by Year 0.
Avoid early returns based on whether any filters are enabled. This premature check resulted in vertices becoming unhidden independently of parent features based on whether the filters were enabled.
1ec5
left a comment
There was a problem hiding this comment.
This feature seems to be working as advertised now, and it’s looking nicely polished thanks to @gregallensworth’s persistence. I’m going to keep kicking the tires on this one just in case, but we can address any remaining issues that come up in separate PRs.
Since we ended up implementing the filter as a special case instead of just another rule, there are changes scattered throughout features.js. We’ll need to be careful about testing this functionality the next time we do a major merge from upstream. I’ve added a cursory test of the date filtering functionality, but it doesn’t cover all the edge cases.


Refer to OpenHistoricalMap/issues#395