Repository navigation
Widget improvements: Fixed height option, scrollable, auto-sync when new appointments are received, show per-calendar, height re-adjusts after (auto)refreshing.- #735 - #736
Conversation
There was a problem hiding this comment.
Still there's things to fix here.. Would have been better if you just opened an issue and explained what you wanted..
npm run test are still showing a warning.. That is a no go!
The Scrollable part you have mentioned in the changelogs does not work, and will not work because Homey intercepts the scroll touch events.. Remove everything that you have added for this part.
| if (getEventsFinished.length === 0) { | ||
| app.broadcastCalendarUpdate(); | ||
| } |
There was a problem hiding this comment.
Actually, there's no need to have this call in an if. At this point, we alreay know that getEventsFinished is 0
| display: inline-block; | ||
| min-height: 0; | ||
| overflow: hidden; | ||
| overflow-y:auto; |
|
|
||
| .cal-footer { | ||
| position: fixed; | ||
| bottom:var(--homey-su-2); |
| } | ||
|
|
||
| function resizeToContent() { | ||
| if(useFixedHeight) { |
| if (calendars.length === 0) { | ||
| return []; | ||
| } | ||
| if(calendarToShow && calendarToShow!=='__all__') { |
| async (query: string, _settings): Promise<Widget.SettingAutocompleteResults> => { | ||
| const results = [{ id: "__all__", name: this.homey.__("calendar.all") }] as any; | ||
| results.push(...this.getCalendars().filter(item => item.name.toLowerCase().includes(query.toLowerCase()))); | ||
| return results; | ||
| } |
There was a problem hiding this comment.
You are sending back way too much in results.. this.getCalendars() returns an array of calendars with their name and all of their events..
Also, don't use any. It defeats the purpose of using TypeScript!
| "version": "3.7.6", | ||
| "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.7.6.tgz", | ||
| "integrity": "sha512-6KSjliQAXK8ZLgFQO4B7iE4Rpf/B3rItzCFuXezBY/XIAGxOdLd7vRNK9/StRPwiS/yJsVbB7HKpW46B8tcEuQ==", | ||
| "dev": true, | ||
| "license": "MIT" | ||
| }, | ||
| "node_modules/@types/node": { | ||
| "version": "26.6.2", | ||
| "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz", | ||
| "integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==", | ||
| "version": "26.6.3", | ||
| "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz", | ||
| "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", |
There was a problem hiding this comment.
Don't do this!! Dependency updates on dev packages is not done like this!! Revert this file!!
| "version": "2.2.7", | ||
| "resolved": "https://registry.npmjs.org/rrule-temporal/-/rrule-temporal-2.2.7.tgz", | ||
| "integrity": "sha512-sd4ee2vAeb5VtGfQSVg9KWc522cHRIz2O2waSiwgRXMYeAu3LFl1qzNqR0RkoqwKWH2bKYKN8WMFdDE+ffuwPQ==", |
There was a problem hiding this comment.
Don't do this!! Dependency updates on dev packages is not done like this!! Revert this file!!
|
The scrollable feature is not working as expected. I've tested your changes by setting Sure, you can scroll some, but it's inconsistent. Probably because Homey captures the touch events. Sometimes i can scroll the full widget height, but mostly i can scroll 10-20px before it stops, even though my finger continues the swipe gesture. Tried with Not sure what device you have tested this on, but i'm testing it on an Android. Not going to implement this scrollbale feature until Athom fixes the widget scrolling. Sorry. The So please remove the scrollable feature from this PR. If you like you can open a different PR for the scrollable feature and i can come back to it if and when Athom fixes their widget scrolling. |
|
Thanks, i have removed the scrollable option (and made a separate branch in which it is still included so it can potentionally be added later). |
No description provided.