Discussion: pluggable ScrollBar renderer #1497
Replies: 2 comments
-
(EDITED: I changed this into something even simpler) Updating: in #1496 @willmcgugan writes:
Okay I'll go with that. I appreciate you have bigger fish to fry, and indeed am striving to make this the least intrusive possible. My thinking then is the simplest I can come up with: Class Is that reasonable? |
Beta Was this translation helpful? Give feedback.
-
Updated #1496. It is now a 3 line change in one file, and I hope that's what you meant. I also included a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
(for poc impl see #1496 )
In #1461 I proposed a "thin" horiz scrollbar and @willmcgugan made several points around the modeling (was it another property? what did it override? the typing itself of the css I proposed; and similar). Will suggested a pluggable "scrollbar renderer", which would decouple the code I wanted to merge from the rest of the codebase, also allowing for an eventuality where this code is massaged and eventually does make it in but not until all are happy with it.
I like the idea and am happy with the direction, and would like to discuss what such "pluggable renderer" might look like.
I'll start by saying the discussion could be endless. Is this a framework for scrollbar renderers? For ANY renderable? For any PLUGIN? And, in each of those options, what is the "discovery" mechanism? What is the exact interface and the modeling of roles & responsibilities?
My thinking is that these are things learned slowly, so best is not to over-design/over-commit, still making sure no too-specific code makes it into "main". Given that, I propose the following:
class_registry.py
andscrollbar_renderer_registry
inscrollbar_render.py
)styles
property calledscrollbar-renderer
, which must be one of the available renderer classes.To show how this actually works, I've also included:
scrollbar_renderer.py
but in the future will sit in user/dev code, outside of this repo. It shows how I think about this.demo.css
to make use of it (one line, in theDataTable
selector).The PR is (imho) a nice starting point, but I'm not married to anything in particular there; rather, it is intended to explain what I think in better terms than my prose above. It does work for me, and passes tests.
I'm very happy to hear thoughts.
Beta Was this translation helpful? Give feedback.
All reactions