sortable icon indicating copy to clipboard operation
sortable copied to clipboard

Experiment with different API for `bucketable_list`

Open andrie opened this issue 6 years ago • 0 comments

Continued from #17 .

The current API is:

bucketable_list(
  text = "This is a bucketable list. You can drag items between the lists.",
  group_name = "bucketable",
  add_sortable_list(
    text = "Drag from here",
    labels = c("a", "bb", "ccc")
  ),
  add_sortable_list(
    text = "to here",
    labels = NULL
  )
)

It would be useful to be able to insert any object into the bucketable_list, so the API becomes:

bucketable_list(
  text = "",
  ...
)

Where the ... can be replaced by one or more sortable_list() calls.

This would require either:

  1. intercept the call and modify the call, or
  2. modify the (deeply nested) list constructed by sortable_list().

I experimented with both approaches and came to the conclusion:

  1. is dangerous, because the user may have constructed the call in any of a number of ways
  2. is very difficult, since the underlying structure of the sortable_list can easily change in future versions, so knowing exactly where to modify the list is hard.

@schloerke is going to look at this.

andrie avatar Jun 25 '19 06:06 andrie