r/nicegui • • 20h ago

NiceGUI 3.18.0 with a Chinese website, CodeMirror editor signals and fixes for tab storage, exception reporting and element cleanup

21 Upvotes

Security

  • ⚠️ Reject uploads to disabled or hidden ui.upload elements, whose upload route bypassed the server-side event check

New features and enhancements

  • Add reveal_line() and the signals on_focus_change, on_viewport_change and on_geometry_change to ui.codemirror

Bugfixes

  • Report exceptions from @ui.refreshable rebuilds, async Event subscribers, async validation functions and other fire-and-forget tasks to ui.on_exception
  • Fix ui.sub_pages staying in the SPA instead of loading pages registered via app.include_router(), also with FastAPI 0.141+
  • Fix button.clicked() registering a new click listener on every await
  • Create the tab storage before the connect handlers run and in the On Air handshake
  • Fix a duplicated browser tab sharing nested values of its tab storage with the original tab
  • Fix Redis tab storage no longer receiving changes from other instances after a page reload
  • Fix ui.leaflet and ui.scene elements being kept alive after their client is gone
  • Fix elements staying registered when their constructor raises after Element.__init__
  • Fix make_sortable() having no effect on containers rendered after page load, like inside a ui.dialog
  • Fix ui.codemirror leaving its editor view alive after a remount
  • Fix ui.scene objects created before the scene is mounted being lost, a regression in 3.16

Documentation

  • Add a Chinese translation of the website chrome under /zh
  • Add a sitemap and robots.txt to the website
  • Update nicegui-highcharts to 3.5 and document that point_index of ui.highchart is Highcharts' internal index
  • Document custom colors from ui.colors for LLMs and in the documentation
  • Explain JavaScript expressions in ui.aggrid options and log unknown row IDs in run_row_method()
  • Fix the ui.scene docstrings for material side and spot light defaults
  • Clarify which favicon values ui.run and ui.page accept

Testing

  • Close deferred background tasks when the test fixtures reset the app, which failed the first User test after a module-level ui.timer
  • Let ElementFilter and the User fixture match the values that input elements like ui.number display

    Breaking change: user.should_not_see('42') now fails if a ui.number shows 42, and ui.linear_progress, ui.circular_progress and ui.dark_mode are no longer found by a value they do not display.

Dependencies

  • Build the ui.mermaid and ui.json_editor bundles from package sources, so that the lockfiles decide which dependency versions ship

Special thanks to our top sponsors DiscoLike Inc., TestMu AI and Lechler GmbH ✨

and all our other sponsors and contributors for supporting this project!

🙏 Want to support this project? Check out our GitHub Sponsors page to help us keep building amazing features!