github posit-dev/py-shiny v0.8.0
Shiny 0.8.0

latest releases: v0.9.0, v0.8.1
2 months ago

Breaking Changes

  • Page-level sidebars used in ui.page_sidebar() and ui.page_navbar() will now default to being initially open but collapsible on desktop devices and always open on mobile devices. You can adjust this default choice by setting ui.sidebar(open=). (#1129)

  • ui.sidebar() is now a thin wrapper for the internal ui.Sidebar class. The ui.Sidebar class has been updated to store the sidebar's contents and settings and to delay rendering until the sidebar HTML is actually used. Because most users call ui.sidebar() instead of using the class directly, this change is not expected to affect many apps. (#1129)

New features

  • Added ui.input_dark_mode(), a toggle switch that allows users to switch between light and dark mode. By default, when ui.input_dark_mode() is added to an app, the app's color mode follows the users's system preferences, unless the app author sets the mode argument. When ui.input_dark_mode(id=) is set, the color mode is reported to the server, and server-side color mode updating is possible using ui.update_dark_mode(). (#1149)

  • ui.sidebar(open=) now accepts a dictionary with keys desktop and mobile, allowing you to independently control the initial state of the sidebar at desktop and mobile screen sizes. (#1129)

  • Closed #984: In Shiny Express apps, if there is a "www" subdirectory in the app's directory, Shiny will serve the files in that directory as static assets, mounted at /. (#1170)

  • For Shiny Express apps, added express.app_opts(), which allows setting application-level options, like static_assets and debug. (#1170)

  • Closed #1079: For Shiny Express apps, automatically run a globals.py file in the same directory as the app file, if it exists. The code in globals.py will be run with the session context set to None. (#1172)

Other changes

  • @render.data_frame now properly fills its container by default. (#1126)

  • We improved the accessibility of the full screen toggle button in cards created with ui.card(full_screen=True). Full-screen cards are now also supported on mobile devices. (#1129)

  • When entering and exiting full-screen card mode, Shiny now emits a client-side custom bslib.card event that JavaScript-oriented users can use to react to the full screen state change. (#1129)

  • The sidebar's collapse toggle now has a high z-index value to ensure it always appears above elements in the main content area of ui.layout_sidebar(). The sidebar overlay also now receives the same high z-index on mobile layouts. (#1129)

  • Updated example apps to use lower-case versions of reactive.Calc->reactive.calc, reactive.Effect->reactive.effect, and reactive.Value->reactive.value. (#1164)

  • Closed #1081: The @expressify() function now has an option has_docstring. This allows the decorator to be used with functions that contain a docstring. (#1163)

Bug fixes

  • Fixed input_task_button not working in a Shiny module. (#1108)

  • Fixed several issues with page_navbar() styling. (#1124)

  • Fixed Renderer.output_id to not contain the module namespace prefix, only the output id. (#1130)

  • Fixed gap-driven spacing between children in fillable nav_panel() containers. (#1152)

  • Fixed #1138: An empty value in a date or date range input would cause an error; now it is treated as None. (#1139)

Other changes

  • Replaced use of sys.stderr.write() with print(file=sys.stderr), because on some platforms sys.stderr can be None. (#1131)

  • Replaced soon-to-be deprecated datetime method calls when handling shiny.datetime inputs. (#1146)

Don't miss a new py-shiny release

NewReleases is sending notifications on new releases.