Skip to content

PB-501 Show dropdown for year selection in the time slider on tablet screens#846

Merged
schtibe merged 11 commits intodevelopfrom
feat-pb-501-dropdown-timeslider-on-tablets
May 27, 2024
Merged

PB-501 Show dropdown for year selection in the time slider on tablet screens#846
schtibe merged 11 commits intodevelopfrom
feat-pb-501-dropdown-timeslider-on-tablets

Conversation

@schtibe
Copy link
Contributor

@schtibe schtibe commented May 16, 2024

On small screens (but not mobile) show a Dropdown instead of the time slider.

  • Add Dropdown on the time slider for small devices such as tablets
  • Fix the play button icon
  • Refactor the data flow in the time slider
  • Prevent from updating layers with invalid year data
  • Debounce the store updating

Test link

@cypress
Copy link

cypress bot commented May 16, 2024

Passing run #2312 ↗︎

0 208 20 0 Flakiness 0

Details:

PB-501 Debounce the input year validation
Project: web-mapviewer Commit: c4e76f41c1
Status: Passed Duration: 04:42 💡
Started: May 27, 2024 8:40 AM Ended: May 27, 2024 8:45 AM

Review all test suite changes for PR #846 ↗︎

@schtibe schtibe changed the title Feat pb 501 dropdown timeslider on tablets PB-501 Show Dropdown for year selection in the time slider on table screens May 16, 2024
@schtibe schtibe marked this pull request as ready for review May 16, 2024 14:38
@schtibe schtibe force-pushed the feat-pb-501-dropdown-timeslider-on-tablets branch from 7939943 to c3865c5 Compare May 16, 2024 14:38
@schtibe schtibe requested review from ltshb and pakb May 16, 2024 14:38
@ltshb
Copy link
Contributor

ltshb commented May 16, 2024

Should be a bit shrinked
image

@schtibe
Copy link
Contributor Author

schtibe commented May 17, 2024

@ltshb Done.

I was also thinking: the dropdown probably isn't very user friendly when it contains 150+ entries. Maybe we can (some time) search for other solutions.

Some spontaneous ideas:

  1. Have a dropdown where you can also enter the year (a searchable dropdown component or so)
  2. Have the time slider at the bottom of the screen. There's much more space there.
  3. Have a vertical time slider...

(speaking of entering numbers: should we use <input type="number"> in the time slider input?)

@schtibe schtibe marked this pull request as draft May 17, 2024 08:42
@schtibe schtibe marked this pull request as ready for review May 17, 2024 09:21
@schtibe schtibe changed the title PB-501 Show Dropdown for year selection in the time slider on table screens PB-501 Show Dropdown for year selection in the time slider on tablet screens May 17, 2024
@schtibe schtibe changed the title PB-501 Show Dropdown for year selection in the time slider on tablet screens PB-501 Show dropdown for year selection in the time slider on tablet screens May 17, 2024
@schtibe schtibe marked this pull request as draft May 17, 2024 09:39
@schtibe schtibe force-pushed the feat-pb-501-dropdown-timeslider-on-tablets branch 2 times, most recently from 9820f8c to 483f343 Compare May 21, 2024 17:16
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

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

It kind of work on the tablet, but the buttons are a bit small.
One general issue is that when typing a number in the dropdown and press enter it action the play button instead of validating the entry. This happens when you enter an invalid number like 100. In this case the field should be marked as invalid as on the slider.

@schtibe schtibe force-pushed the feat-pb-501-dropdown-timeslider-on-tablets branch 8 times, most recently from 0a62c4b to 5601e18 Compare May 24, 2024 12:45
@schtibe schtibe requested a review from ltshb May 24, 2024 13:13
@schtibe schtibe marked this pull request as ready for review May 24, 2024 13:13
Copy link
Contributor

@ltshb ltshb left a comment

Choose a reason for hiding this comment

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

Very nice, just two minor issues:

  • Button class consistency
  • When entering an invalid year input, the tippy for invalid year is shown (which is correct), but then if you change the language the tippy lang is updated and stays display but the year is reseted to the previous selected year which is valid. In this case we need either to not reset to the previous selected year or also reset the tippy

})
}
})
tippyTimeSliderInfo?.destroy()
Copy link
Contributor

Choose a reason for hiding this comment

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

I find dangerous to put the tippy destroy in a function which could be called anytime in the future. I would let the tippy destroy in the onMounnted callback it is safer for the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, that's a rebasing error, thanks!


<div class="input-group-append btn-group btn-group">
<button
class="btn border btn-light d-flex align-items-center rounded-start-0 rounded-end-0"
Copy link
Contributor

Choose a reason for hiding this comment

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

For code consistency you should use btn-outline-group instead of btn-light for button groups.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK! The name is a bit misleading ;)

@schtibe schtibe force-pushed the feat-pb-501-dropdown-timeslider-on-tablets branch 5 times, most recently from 871dce0 to 22c26eb Compare May 27, 2024 08:26
schtibe added 11 commits May 27, 2024 10:36
The play button icon didn't reset to "play" after pausing the playing of
the years
The data flow of the time slider was overly complicated and sometimes
lead to triggering setting the same value twice. Tried to remodel the
route that the data takes. Everything now more or less writes to the same
computed property, which triggers setting the store if the data is correct.

In my opinion, with this solution, there are less side effects and (almost)
a single source of truth for the year. Two watchers could be eliminated.
The slider allows for selecting more years that are potentially
available on all the displayed layers. When unmounting the slider, we
shouldn't be setting the layers to invalid years.
Replace the simple time slider select with a searchable dropdown similar
to the one in the provider urls
If the year cursor is moved, the store gets updated after a slight
amount of time. But it isn't necessary to release the mouse anymore, the
map will update when only the cursor is moved
Debounce the input year validation a bit so that the error isn't
immediately shown when the user starts typing
@schtibe schtibe force-pushed the feat-pb-501-dropdown-timeslider-on-tablets branch from 22c26eb to c4e76f4 Compare May 27, 2024 08:36
@schtibe schtibe merged commit 281f5f9 into develop May 27, 2024
@schtibe schtibe deleted the feat-pb-501-dropdown-timeslider-on-tablets branch May 27, 2024 08:48
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.

2 participants