-
-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sidebar width issues and make it customizable #2301
Conversation
I have added a The functionality can be tested via from panel import param
import panel as pn
def template_with_sidebar(Template=pn.template.FastListTemplate, sidebar=True):
button = pn.widgets.Button(name="Click Me")
select = pn.widgets.Select(name="Select", value=1, options=[1,2,3,4,5])
if sidebar:
title = Template.name + " Sidebar Width Test"
else:
title = Template.name + " No Sidebar Width Test"
template = Template(
site="Home",
title=title,
main=["Hello"]
)
if sidebar:
template.sidebar[:]=[button, select, pn.Param(select)]
return template
def template_without_sidebar(Template=pn.template.FastListTemplate):
return Template(
title="No Sidebar Width Test",
main=["Hello"]
)
apps = {
"vanilla-template": template_with_sidebar(Template=pn.template.VanillaTemplate),
"vanilla-template-no-sidebar": template_with_sidebar(Template=pn.template.VanillaTemplate, sidebar=False),
"material-template": template_with_sidebar(Template=pn.template.MaterialTemplate),
"material-template-no-sidebar": template_with_sidebar(Template=pn.template.MaterialTemplate, sidebar=False),
"bootstrap-template": template_with_sidebar(Template=pn.template.BootstrapTemplate),
"bootstrap-template-no-sidebar": template_with_sidebar(Template=pn.template.BootstrapTemplate, sidebar=False),
"react-template": template_with_sidebar(Template=pn.template.ReactTemplate),
"react-template-no-sidebar": template_with_sidebar(Template=pn.template.ReactTemplate, sidebar=False),
"fast-list-template": template_with_sidebar(Template=pn.template.FastListTemplate),
"fast-list-template-no-sidebar": template_with_sidebar(Template=pn.template.FastListTemplate, sidebar=False),
"fast-grid-template": template_with_sidebar(Template=pn.template.FastGridTemplate),
"fast-grid-template-no-sidebar": template_with_sidebar(Template=pn.template.FastGridTemplate, sidebar=False),
}
if __name__.startswith("bokeh"):
template = "react"
apps[template + "-template"].servable()
if __name__=="__main__":
pn.serve(apps) sidebar_width_test.mp4 |
Only outstanding thing to do is to document it across notebooks. |
Codecov Report
@@ Coverage Diff @@
## master #2301 +/- ##
=======================================
Coverage 84.02% 84.03%
=======================================
Files 181 181
Lines 21940 21946 +6
=======================================
+ Hits 18436 18442 +6
Misses 3504 3504
Continue to review full report at Codecov.
|
Thanks! Very useful! |
I have now documented and also implemented the When you have time @philippjfr . Please review and let me know if there is more to do. Thanks. |
Happy with this, thanks! |
Fixes #2223
The problem is that the sidebar width does not match the default fixed width of buttons and dropdowns. Furthermore users are also requesting the ability to configure the sidebar width. The problem is shown below.