Replies: 2 comments 1 reply
-
@nbenn. I like the idea of having a configuration class for elements in a separate file given that we don't have many UI elements: stack, block, field , + possible children tags (block header, block footer, ...). What I am more concerned about is the way we collapse elements (Bootstrap based) in the JS part: |
Beta Was this translation helpful? Give feedback.
-
I like the idea of being framework agnostics but I think it's too ambitious.
If we want to be framework agnostics we have to developers to write their own functions, e.g.: S3 methods where we could define methods for each and every field, as well as stacks, and blocks components. Note: this complicates quite a few things, we still need some commonality on the front-end, how we handle that? |
Beta Was this translation helpful? Give feedback.
-
For many of the "actions" (e.g. add new block to stack) we have some basic (and evolving) API (e.g.
add_block()
in blockr).What is much more vague currently is how the interface looks like for "presentation" aspects. A related issue here is #106.
For laying out fields of a block, we probably want this to be up to the block designer. In #106 we sketch two possible approaches1:
layout
that holds a function which can customize the layoutThe block UI is currently provided by
generate_ui.block()
:https://github.com/blockr-org/blockr/blob/cec323cb8a290084fac13dd3b29f544e640ebf1c/R/ui.R#L17-L91
With this we have many implicit assumptions on what kind of behavior the frontend should support (like collapsible elements) and what kind of HTML class attributes need to be recognized (of which there's a mix of bootstrap e.g.
card shadow-sm p-2 mb-2 border
and our own e.g.block-validation
). How can we make this cleaner?If we wanted to at least try to be "framework" agnostic, we need some kind of "config" framework for this. This is not impossible (and it's easier, the earlier we start doing this). We could for example do something like
and then use this as
This way you might be able to use Material cards instead of Bootstrap cards, if you wanted to.
If we say, bootstrap is a strict requirement because we hard-code bootstrap classes everywhere, how do we deal with bootstrap versioning? Do we fix everything to a specific bootstrap version, which the custom front-end then also has to be based on?
We need to document our own classes well.
If we don't allow for some more fine-grained modularity, the decisions that are made in the core package (e.g.
shadow-sm
for block cards) are set in stone (the only option one would have then is to re-implement everything, starting fromgenerate_ui.block()
. The config-style approach from above would alleviate this.The stack UI is provided by
generate_ui.stack()
:https://github.com/blockr-org/blockr/blob/cec323cb8a290084fac13dd3b29f544e640ebf1c/R/ui.R#L95-L158
htmltools::htmlDependency()
, we addhighlight.js
as something to be fetched from externally and we add a piece of JS usingtags$script()
. Can this be harmonized a bit? Should we maybe bundlehighlight.js
?sortable::sortable_js()
: data transformations as are currently considered are mostly not associative. I don't think being able to rearrange blocks adds any value. If we really want to do this in the BMS UI we should come up with and use some mechanism for extensibility to get there.Footnotes
The discussion here is not on evaluating and deciding between the two. This is tracked in How do we allow for a block implementer to control the UI? #106. ↩
Beta Was this translation helpful? Give feedback.
All reactions