elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.11k stars 377 forks source link

[BUG] Weird widget/sizing behavior upon eww reloading #484

Open ljmill opened 2 years ago

ljmill commented 2 years ago

Checklist before submitting an issue

Description of the bug

The sizing of widgets becomes incorrect when certain actions occur. I have observed this to occur when:

  1. eww reloads upon saving changes to the .yuck or .scss file
  2. manually invoking the eww reload command in order to refresh imported values
  3. updating variables used in labels with the eww update command

It is important to note the following:

  1. the sizing returns to normal upon saving the file again (or invoking eww reload a couple of times in a row)
  2. This behavior does not occur to updated literal widgets defined in deflisten variables

Reproducing the issue

Example 1: My widgets consist of a box containing horizontal boxes. These horizontal boxes contain overlays, each of which contain labels and a button. See image: sample1

For illustrative purposes, I will apply a background-color to the button class: sample2

Upon removing the background-color property from the scss file and saving the changes, the background-color persists and incorrectly alters the size of the button: sample3

Saving the file again to reload eww a second time (with zero changes made) causes the background-color to correctly be removed and the button sizes are returned to normal: sample4


Example 2:

My scss file imports color variables from another file for the purpose of dynamically updating the color of my widgets when I change my theme. Upon performing an eww reload to update the scss file after changes are made to the imported file, the widgets are cut off: sample7

This remains until a second eww reload is performed--after which the widgets are displayed correctly.


Example 3:

A label which gets its text from a variable: sample5

Upon changing the label/variable by invoking the eww update command on the variable, the size of the widget gets cut short: sample6

Unfortunately, I cannot simply perform subsequent eww reloads in this case because it would reset the state of the label.

Expected behaviour

  1. This bug is observed upon eww reloading a single time (such as when saving changes to the .yuck or .scss file). It fixes itself upon reloading/saving a subsequent time. It should not need to be saved/reloaded twice for the widgets to enter the correct state.
  2. Updating variables which are used to display within widgets shouldn't cause this behavior as it is impractical to perform eww reloads to fix it.

Additional context

No response

ljmill commented 2 years ago

Update: this is likely a spacing issue. Upon setting space-evenly to false and giving the widget more width, it renders as expected during updates and reloads.

However, it is still quite odd that reloading widgets 2 times consecutively would cause it to display accurately.