-
-
Notifications
You must be signed in to change notification settings - Fork 687
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
[widget audit] toga.DateInput, toga.TimeInput #1951
Conversation
1cbf8cf
to
99478b6
Compare
…he dummies as notrequired.
fa4856e
to
da29226
Compare
da29226
to
ef36395
Compare
For consistency with NumberInput, I've also renamed |
Good catch - 100% agreed.
Also agreed. It occurs to me that we should start logging specific tickets for the resolveable issues that we're finding as a result of this audit (e.g., styling of Selection on GTK, ActivityIndicator not implemented on Informs, etc). Prior to the audit, there wasn't a whole lot of value to having tickets for all the micro issues and missing platform features; now that we have coverage testing, we have a specific list of things that are missing, the platforms where they're missing, and a known contract that they should be adhering to. This sort of API inconsistency fits that pattern. |
@freakboy3742: The Android testbed is hanging intermittently, so this isn't quite ready to merge, but it would be useful for you to review it now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Periodic freezing notwithstanding, this looks pretty good; I've flagged a couple of things we should probably raise in the user-facing notes for the widgets, plus one possible approach for a "soft" min/max on Android TimeInput.
@@ -7,78 +7,67 @@ | |||
) | |||
from .internal.pickers import PickerBase | |||
|
|||
NO_MIN = date(1799, 1, 1) | |||
NO_MAX = date(9999, 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these values with a significance to Android? We should document why these dates in particular has been picked - both in the code, and in the user-facing widget notes as a functional limitation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I've changed the implementation to allow years between 1800 and 8999 on all platforms, and updated the documentation to match.
|
||
# Unlike DatePicker, TimePicker does not natively support min or max, so these | ||
# properties currently have no effect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth doing a "soft" min/max? i.e., we have control over get_value()
; if there's a min_value of 6AM, and the user picks 3AM, we could modify get_value()
to return 6AM. It's not ideal UX, but it would at ensure the Android implementation doesn't return values that aren't invalid.
from .base import Widget | ||
|
||
NO_MIN = WinForms.DateTimePicker.MinDateTime # Year 1753 | ||
NO_MAX = WinForms.DateTimePicker.MaxDateTime # Year 9998 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth documenting these limits in the user-facing notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
I've changed the min and max properties as follows:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Audit of the DateInput and TimeInput widgets.
Renames the widgets from Date/TimePicker to Date/TimeInput for consistency. The widget was previously undocumented, and is only currently implemented for Android and Windows, so the impact of this change should be minimal. A compatibility shim for the old name has been included.
Fixes #1962.
Audit checklist