r/nicegui • u/falko-s • 2d ago
NiceGUI 4.1.0 with selection events for ui.codemirror, async validation and faster page responses
New features and enhancements
- Add
on_selection_changetoui.codemirror - Support async functions in a
validationdictionary - Speed up building the response of large pages by escaping the embedded element JSON faster
- Accept the
X-Forwarded-Prefixheader only as a relative path, so that it cannot make a page load its scripts from another origin - Upgrade the Docker image from Python 3.14 to 3.15
- Use tuples instead of mutable lists as default arguments
Bugfixes
- Fix unquoted lists and dicts on
:props arriving in the browser as their last item - Fix
.props()dropping unquoted values with special characters like parentheses,!or an IPv6 host - Keep the tab storage of connected clients when pruning old tab storages, also in Redis
- Stop rewriting storage files whenever they are loaded
- Stop the Redis storage from publishing data it has just loaded or received, which could restore outdated values
- Give every task awaiting the same
ui.dialogthe submitted result - Fix
previous_valueof change events for elements with dict-backed options - Keep the order of JavaScript calls without
awaitrelative to later messages like an awaitedrun_method - Let in-flight awaits of
ui.run_javascriptreturn as soon as the client is deleted - Convert union-typed sub-page parameters like
int | Nonethe same way as on plain pages again - Fix polled bindings re-sending an element on every cycle if the target's setter normalizes the value
- Let
ui.scene_viewwait for a scene that is not mounted yet instead of never resolvinginitialized() - Add the missing
Torustonicegui.elements.scene.objects - Keep DataFrame columns with duplicate names in
ui.tableandui.aggrid - Convert non-serializable Polars columns like
BinaryandDurationinui.tableandui.aggrid - Reload the page instead of showing "Connection lost" forever when an expired login session redirects the reconnection
- Support nameless callables like
functools.partialin refreshables and exception handlers - Fix the
ETagheader and suffix byte ranges of media files - Fix
ui.fullscreenignoringexit()while entering fullscreen is still pending - Fix
ui.anywidgetnot running the cleanup functions of its widget
Documentation
- Add a dynamic resampling recipe to the
ui.plotlydocumentation - Host the demo images on nicegui.io instead of picsum.photos
- Redirect www and renamed documentation pages and declare canonical URLs on the website
- Fix typos and inaccuracies in docstrings and documentation
- Update the README, contributor docs and issue template
Testing
- Let
background_tasks.creatework in async tests that don't start the app - Fix an exception inside the
usersimulation making all following tests fail during setup - Add guidance for Snap-based Chromium to the test setup documentation
Dependencies
- Update Quasar from 2.35.2 to 2.35.3 to fix the focus getting stuck after a tooltip is hidden twice
- Remove the
certifidependency and document when to raise minimum versions of Python dependencies - Clean up dev dependencies
- Update outdated Docker images in examples and let Dependabot watch compose files
Infrastructure
- Harden CI and release workflows
- Tighten Ruff and mypy configuration
Security
- ⚠️ Stop evaluating
:-prefixed keys inui.echartseries data and other chart data outsidedataset.sourceas JavaScript
Special thanks to our top sponsors DiscoLike Inc., TestMu AI, Lechler GmbH and egs-hub ✨
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!









