Skip to content

Adaptive Grid Collections Discussion

Andy Williams edited this page Apr 2, 2024 · 5 revisions

Note

This document is archived as it refers to a design process.

An adaptive grid collection widget has been requested frequently since collections have gone out and even certain areas within our own widgets such as file selector could use it. This page is for discussions around creating an adaptive grid collection widget.

  • The majority of how list works (other than layout) is how adaptive grid will work. Being a grid, items will be homogeneous and this will simplify the caching and layout of the grid
  • Adaptive grid should support growing EITHER horizontally or vertically
  • Layout will determine the width or height of the space depending on direction and layout items based on their template min size. For a vertically growing grid - width of the space available / item min width will give the number of items that can be laid out horizontally before going to the next line. If width available is 1000 and item min width is 100, this means 10 items can be laid out horizontally. The process will start in the top left corner and lay out 10 items horizontally, then move down by item min height and start the next row laying out horizontally and so on. Laying out an adaptive grid that grows horizontally will be the reverse of this.
  • If the available space changes from something such as a window resize, the grid will relayout automatically using the same calculations above
  • The data that adaptive grid takes in will be 1 dimensional just like the data list takes in. This is because there is no set structure of rows/columns as they are determined automatically

Questions

  • Grid lines? Yes? No? Optional?

    Stuart: I'm torn, most layouts don't have separators, but the collections do, so maybe yes

  • Would it be better combined with list as a layout option for list and cut down on duplicate code?

    Stuart: I think it would be better to keep them separate