Skip to content
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

🐛 Widgets incorrectly positioned onscreen after items refresh #341

Open
4 tasks done
TimboZero opened this issue Nov 8, 2024 · 21 comments
Open
4 tasks done

🐛 Widgets incorrectly positioned onscreen after items refresh #341

TimboZero opened this issue Nov 8, 2024 · 21 comments
Labels
bug Something isn't working

Comments

@TimboZero
Copy link

TimboZero commented Nov 8, 2024

Skin section

Widgets

Current Behavior

I have several favourites that are links to a streaming addon, each for a separate tv show.
I am using the ‘Detailed’ mode for my 1101 customised Home, so just widgets in row per ‘category’. My Back Button is set to ‘previous’
Favourites are in the hub config as Favourites://
When exiting one show I will occasionally (50:50 estimated chance) get false gfx and title but correct ‘cursor’ position. This seems to usually be the third icon from the widget row below, which is the streaming addon (but not related to favourites, tv shows etc)
Moving the ‘cursor’ with my remote changes the title or row correctly but the incorrect image seems to persist in favourites widget (it changes correctly if I change widget row) until I click OK on remote.
The ‘feel’ of the bug is like it needs to (but isn’t) flushing the old data and reloading the new data for the previous back button action.


EDIT: by @jurialmunkey See below for related issue #519 originally posted by @Beats24-7

Skin section

Widgets

Current Behavior

When playback of an item is complete and you return to the home screen, the skin loses focus of the correct / current widget row.
IMG_20241231_165959

Focus always moves downards two rows somehow. The fanart and info section is still showing the correct item.

Expected Behavior

The skin should focus on the current item in a widget, or if it's removed (when watched), on the nearest / next item.
IMG_20241231_170020

Steps To Reproduce

I am using the classic main menu + detailed mode (widgets+information). I have tested several different view types including landscape (+detailed or no info), landscape(s), board, square, etc...

Choose an item in a widget, finish playback and return to home screen.

Screenshots and Additional Info

No response

Checklist

  • I have made a separate issue for each bug that I am reporting.
  • I have searched the issues and this bug has not been reported.
  • I am using the most recent skin version.
  • I have confirmed that this bug does not occur in the default skin.
@TimboZero TimboZero added the bug Something isn't working label Nov 8, 2024
@jurialmunkey
Copy link
Owner

Can you shows some screenshots (or better, a video) of the issue? I'm not 100% clear on the behaviour you're describing

@TimboZero
Copy link
Author

My ADSL is pitiful (0.6mbit upstream) until late January when I get fibre, sent you a PM on forum

@jurialmunkey
Copy link
Owner

jurialmunkey commented Nov 9, 2024

If I'm understanding correctly, you basically have something like this occur where the the information and widget focused is the one above (or below) the one that is visible on screen:

screenshot00872

If so, that is due to one of the widgets above that position having no items when the widgets refresh.

When the widget has no items, it gets hidden and Kodi shifts everything in the group up because otherwise there'd just be a massive gap (and if the reverse happens where a widget without items now does have items after a refresh, then they all get pushed down out of position in the opposite direction).

The problem is that Kodi doesn't also reposition the grouplist focus to bring the current widget back on screen.

If that's what you're describing, then there's not much the skin can do about this behaviour. It is down to how Kodi handles grouplists. The behaviour also occurs in Estuary if one of the widgets above the one you're on happens to be blank.

@TimboZero
Copy link
Author

TimboZero commented Nov 9, 2024

No this is not what I mean.
The row above favourites is my local music library and is instantly displayed, the row below favourites is my streaming addon (which can take a short time to load focused info but is works correctly like A) below)

The only row that appears to exhibit this bug is the favourites row and it occasionally either…
A) takes time to load displayed info with blank background, title and widget rectangles (expected behaviour especially with my 5mbit ADSL)
B) displays last favourite title and background whilst correct info is loading (hasn’t flushed last widget, happens about 40-50% of the time)
C) displays the third item of the row below but the focus is correct and changing widget row will instantly display the correct info, but moving left/right (i.e. remaining in the favourites row) will change the title to the correct title but the background/info remains incorrect until the new focused favourite is selected when either A) or sometimes B) will occur (happens about 10-15% of the time).

I could try and piece together a video but the streaming video is an unsupported one and my upload speed is 0.6mbit (until mid January when fibre arrives).
The issue is not urgent, might just be a flaw in how I ‘crowbarred’ in favourites into the widgets only view with favourites:// (as it’s not currently an included option). When it happens, as I know what to expect, it’s manageable.

@TimboZero
Copy link
Author

TimboZero commented Nov 11, 2024

Update:
The issue also occurs with Smart Playlists

Reproduction Method.

  1. Create a smart playlist (2 is better to allow left/right testing later), in my case they are films collections using the ‘universe’ technique.
    https://kodi.wiki/view/HOW-TO:Movie_universe
    I do not believe this is specifically needed type of smart playlists but it is the only one I have tested.

  2. set skin to a custom hub in detailed mode with a few widget ‘rows’, playlists being one of them (preferably with another above and below it). Additionally set the Behaviour/Navigation/Content>Back button action to ‘previous’.
    (After our previous discussions no warning from me is needed on setting back button like this in detailed mode)

  3. select the playlist row and one of the playlists within it, then play (only a few seconds needed then you can press stop) one of the playlists entries.

  4. after stopping or completing the selected played item, use the back button and note the behaviour of each press. The first will set the cursor to the start position of the playlist (if it wasn’t already the first item played), the second should exit to the playlist row which it will do however the displayed info on the screen will be the correct cursor position title but the screen will display as if the cursor is on the row below.
    From here you can confirm the cursor is in the correct position with either left/right, up/down or ok/enter.

I believe this method is consistent and without using any unsupported addons.

@jurialmunkey
Copy link
Owner

This sounds like the behaviour I described in my previous comment.

@TimboZero
Copy link
Author

TimboZero commented Nov 12, 2024

“ If I'm understanding correctly, you basically have something like this occur where the the information and widget focused is the one above (or below) the one that is visible on screen:”

it’s the reverse, the focused item is correct and the displayed item is the row below (always below for me, never above).

“ If so, that is due to one of the widgets above that position having no items when the widgets refresh.”

In the case of favourites this is possible as the item below is the unsupported addons which will generally take time to load. With smart playlists the item below is tv shows which are local and always instantly load for me.

in short it’s is similar to how you describe but the reverse and the row below does have items.

The playlists version is impossible to test in Estuary as playlists (afaik) cannot be made a menu item, with favourites in estuary the item below is addons (again can’t make the unsupported addon a menu item).
The same behaviour doesn’t happen with same configuration (all the same rows and back set to previous) in classic mode.

@jurialmunkey jurialmunkey changed the title 🐛 Bug in favourites:// as widget in Detailed mode 🐛 Widgets incorrectly positioned onscreen after items refresh Dec 31, 2024
@Beats24-7
Copy link

Thanks for the info and update @jurialmunkey. Seems like that could be the issue. It's only working fine for the first widget row in the first category on the home screen. Probably because there isn't any row above.

However, anywhere else the rows above all still have items, but they are being refreshed and the position of the items change. The skin then moves two rows down below to the widget row including the currently selected item.

So I guess there is no workaround for this?

I will try again with static widget rows (alphabetically ordered) if the issue persists. Thanks again

@jurialmunkey
Copy link
Owner

jurialmunkey commented Jan 2, 2025

Seems like that could be the issue. It's only working fine for the first widget row in the first category on the home screen. Probably because there isn't any row above.

So I guess there is no workaround for this?

The only real "workaround" is to check that you don't have any widgets that end up blank.

On my main loungeroom setup I never encounter this issue because all of my widgets always have content -- but if I add in a "blank" playlist as a widget with no items then I can make it happen reliably.

In my setup, for things like "in-progress movies" that might sometimes end up empty, I use a Skin Variables filter to fallback to a different list (for progress I like falling back to my trakt recommendations list) if the main list is empty.

You can do this with SkinVariables like so:

  1. Open SkinVariables via Videos > Add-ons
  2. Choose "Add new" and add your main list first, then when it prompts to add another list, add your fallback.
  3. Go through the other filter/sort options and choose "none" (or whatever you want really).
  4. Save the filter with a name, then find it and open context menu and choose "edit"
  5. In the edit menu, there is a flag "fallback" - switch it to "true" and save the filter again.
  6. Now add the filter in place of your widget (just how you normally add a widget but go via video addons > skin variables > your filter).

jurialmunkey added a commit that referenced this issue Jan 2, 2025
@FrostByteLXV
Copy link

FrostByteLXV commented Jan 2, 2025

Can this be disabled, or at least skip to next Widget on Home when empty if the first widget is empty?

Reason: I have a Continue Watching widget as my first widget on Home. Previous version would automatically jump to the next widget at startup when this widget was empty, which it is 99% of the time.

Here is a screen shot. Previous version it would land on Next Episode if Continue watching was empty and nothing would be displayed for the empty widget.

Preference would be to hide it because I don't need to see Continue Watching is there isn't anything to continue watching.

Screenshot_20250102-052152

@FrostByteLXV
Copy link

FrostByteLXV commented Jan 2, 2025

Creating a backup widget doesn't really solve the issue either as I want it to land on Next Episode if continue watching is blank.

Displaying an empty place holder seems unnecessary and a waste of space.

@OfficerKD637
Copy link
Contributor

@FrostByteLXV - Map this hidden setting somewhere (like in your options tray) and click on it once. Then reload the skin for it to take effect.
Skin.ToggleSetting(Widgets.DisableNoResultsItem)

This will disable the 'No Results' image. Clicking on that setting again (followed by a skin reload) will enable it.

@FrostByteLXV
Copy link

@OfficerKD637 Excellent. Thank you very much.

@jurialmunkey
Copy link
Owner

Creating a backup widget doesn't really solve the issue either as I want it to land on Next Episode if continue watching is blank.

Displaying an empty place holder seems unnecessary and a waste of space.

It is necessary to prevent this bug in this issue thread.

@FrostByteLXV
Copy link

Understand. Never seen this bug myself with any of my favorites, etc and it wouldn't really bother me much if it didn't affect the landing of my first widget on startup. Imagine that image being the first thing you see every time.

I can just make a small change to Includes_Widgets.xml (or make my own setting) though thanks to the pointer by OfficerKD637.
Thanks

@jurialmunkey
Copy link
Owner

jurialmunkey commented Jan 2, 2025

Understand. Never seen this bug myself with any of my favorites, etc

It's not really anything to do with favourites, that's a red herring.

The issue is fairly easy to reproduce if you go to a widget further down that is a tvshow, open the tvshow (so that you go to different window), play something, stop playback, then press back to return home.

The widgets will end up in the wrong position because the top widget will briefly be visible (to reload) and then hide (due to no items), which causes Kodi to shift everything up and the current widget ends up offscreen.

it wouldn't really bother me much if it didn't affect the landing of my first widget on startup. Imagine that image being the first thing you see every time.

Yeah I completely understand and it definitely wasn't my first choice either to address the issue either. I'd much rather hide the widgets as I was before but it was sort of forced by skinning engine limitations.

The other side is that I also think quite a few users might not even realise that their setups contain empty widgets (due to being hidden) and that's a performance drain since Kodi still needs evaluate and reload all those empty widgets after each refresh. So at least with a conspicuous "empty widget" placeholder it might force those users to fix their setups to remove the dead weight.

I can just make a small change to Includes_Widgets.xml (or make my own setting) though thanks to the pointer by OfficerKD637.

No need to edit anything. The setting is provided for exactly this purpose. I just hadn't added a toggle in the skin settings to expose it.

@FrostByteLXV
Copy link

Okay, I think I've seen that with music albums then. Clicked back after playing and I'm brought back in the section below (after shift). Guess it never really bothered me enough to mention it before (though I probably should have).

I can definitely see the empty widget being worked on during startup. Sits there for a second or two loading with a little spinner.

I was thinking you were going to add that eventually and just hadn't gotten to it :) Looked and couldn't find anywhere you were actually setting Widgets.DisableNoResultsItem. For now, I just removed the "!" from the bottom of Includes_Widgets.xml.

Anyhow, thanks as always for taking the time to explain things. I've learned a lot as usual.

@Beats24-7
Copy link

The only real "workaround" is to check that you don't have any widgets that end up blank.

On my main loungeroom setup I never encounter this issue because all of my widgets always have content -- but if I add in a "blank" playlist as a widget with no items then I can make it happen reliably.

In my setup, for things like "in-progress movies" that might sometimes end up empty, I use a Skin Variables filter to fallback to a different list (for progress I like falling back to my trakt recommendations list) if the main list is empty.

You can do this with SkinVariables like so:

1. Open SkinVariables via Videos > Add-ons

2. Choose "Add new" and add your main list first, then when it prompts to add another list, add your fallback.

3. Go through the other filter/sort options and choose "none" (or whatever you want really).

4. Save the filter with a name, then find it and open context menu and choose "edit"

5. In the edit menu, there is a flag "fallback" - switch it to "true" and save the filter again.

6. Now add the filter in place of your widget (just how you normally add a widget but go via video addons > skin variables > your filter).

Thanks for the explanation and info, very much appreciated! I even forgot that I had "in-progress movies and episodes" in my widget list because I've almost never any content in that list. I also didn't know that these two widgets could cause this issue for the entire setup. I've disabled them and it's working perfectly fine now! I will try to set up a skin variables filter later. Thanks again

@FrostByteLXV
Copy link

FrostByteLXV commented Jan 3, 2025

@jurialmunkey -is it possible to have an option for the skin's initial focus be on the first non-empty widget on startup? Instead of the first widget with this new option enabled.

For instance, my first widget is one which displays movie/shows that I stopped playing and need to continue watching. This is empty 99% of the time. IF I have the setting to display the empty widget icon, then the skin would land on the next widget which is Next Up episode on startup. IF Next Up is blank then the initial focus would be whatever widget comes next

You could then scroll up and see the empty widget icon if you want, but it wouldn't be the first thing you see on start.

Reason: saves time not having to scroll down to the next widget with data, plus it is better looking at start not having the initial focus being the empty widget icon.

I do not want to add a backup widget because to me that's just adding something I never really wanted bad enough before which just delays me getting to my next priority widget.

Add a first non-empty widget option here:

Screenshot_20250103-131018

@jurialmunkey
Copy link
Owner

jurialmunkey commented Jan 3, 2025

@FrostByteLXV it's a nice idea but unfortunately I don't think it'd be possible.

The reason is down to a skinning limitation I often run into where the skin can only "know" how many items will be in the widget after the widget loads but theres no way to trigger an action at that point - ie there's no trigger for onwidgetload or similar which is what would be needed to check.

Btw the option to hide these place holders is in the most recent version under the viewtypes skin settings section.

@FrostByteLXV
Copy link

@FrostByteLXV it's a nice idea but unfortunately I don't think it'd be possible.

The reason is down to a skinning limitation I often run into where the skin can only "know" how many items will be in the widget after the widget loads but theres no way to trigger an action at that point - ie there's no trigger for onwidgetload or similar which is what would be needed to check.

Btw the option to hide these place holders is in the most recent version under the viewtypes skin settings section.

Ahh...np.
btw Thanks for that setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants