Skip to content

chore: rework number and date inputs #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

timakro
Copy link
Collaborator

@timakro timakro commented Apr 9, 2025

This PR restyles the number and date inputs and adds error handling:

image

image

Due to the error handling this PR closes #264 and closes #159 and closes #307.

I don't think stacking the date inputs as suggested in #265 is a good idea. This PR removes the "from" and "to" texts so it might be a little bit less wide than before.

I also added optional units to the numer inputs as I figured we might need them at some point.

Things that are still to do:

  • Translate custom error messages
  • Decide if we want to put styles inside the components .svelte files
  • Decide if we want to use the circular buttons for all catalogue items

@timakro timakro marked this pull request as draft April 9, 2025 12:52
@patrickskowronekdkfz
Copy link
Collaborator

patrickskowronekdkfz commented Apr 11, 2025

Here are my thoughts on the changes:

  1. I like the addition of the number input type—it makes it clearer to the user what should be entered. However, I’d prefer placing it only at the end, maybe something like .
Bildschirmfoto 2025-04-11 um 08 38 16 Since we are size-constrained, I’d always aim to keep it as compact as possible.
  1. I prefer the plus button over the arrow. I’d suggest using it for all inputs.

  2. Removing the 'from' and 'to' text is a good improvement. Similar to point 1, I’d group all min/max inputs into one bracket, as it saves a lot of space. I tried stacking them but couldn’t make it work. We can probably close [Feature]: Make Dateinput stacked instead of side by side #265—I measured the sizes, and we reduced the width by about 100px, which looks much better.

  3. I think providing feedback when a user enters an invalid value is a great idea. The error messages should be translated and improved for better clarity.

  4. Regarding styling, I prefer keeping it within the component, as discussed. However, does it make sense to place it at the bottom part? Is there a standard from svelte where to put the html, script and style part. I think we should maintain a consistent order across all files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants