wirecloud icon indicating copy to clipboard operation
wirecloud copied to clipboard

Add ability to define different widget layouts for different screen sizes

Open oxixes opened this issue 8 months ago • 11 comments

Proposed changes

Allows to define different widget configurations for different screen sizes, so that a phone can have a different view than a PC. You can define the boundaries in the workspace configuration, and these can also be different by tab if the user wants to.

Their position and size are adjusted dynamically when the window size changes.

Types of changes

What types of changes does your code introduce to the project: Put an x in the boxes that apply

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [x] I have read the CONTRIBUTING doc
  • [x] I have signed the CLA
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added necessary documentation (if appropriate)
  • [ ] Any dependent changes have been merged and published in downstream modules

Further comments

To do this, widgets now store their position for each different screen size. All widgets must have one and only one defined position for every screen size possible, so the boundaries must cover the whole range of possible screen sizes (from 0 to infinity) without gaps or overlaps.

One current limitation is that the layout (column, free, sidebars...) is stored at the widget level, meaning that a widget can only belong to a single layout, and therefore if you change the layout of a widget in one screen size, it will change in every screen size. This limitation can be solved in the future, but this PR is long enough, so it will be part of a different one.

Moreover, all widgets have to be visible in every layout configuration, so in the future we could add the ability to hide widgets in a specific screen size, so one could effectively design completely different layouts (with different widgets) for each screen size.

oxixes avatar Jun 17 '24 11:06 oxixes