| name | nicegui-quirks |
|---|---|
| description | Pitfalls and workarounds when writing NiceGUI / Quasar code — layout centering, input prop forwarding, dialog/upload/table/select gotchas, browser-side JS interop, and cookie/auth flows. Apply these when writing or reviewing NiceGUI page code so you don't rediscover the same bugs. TRIGGER when: editing or writing Python that imports `nicegui` or calls `ui.*` / `app.*` from NiceGUI; user asks about NiceGUI, Quasar, or any of `ui.dialog` / `ui.upload` / `ui.table` / `ui.select` / `ui.input` / `ui.html` / `ui.add_body_html` / `ui.run_javascript` / `ui.navigate`; user is debugging a NiceGUI page that "looks wrong" or behaves unexpectedly in the browser. SKIP: non-Python files; Python without NiceGUI imports; general web/frontend questions unrelated to NiceGUI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> | |
| </head> | |
| <body> | |
| <div class="container"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import json | |
| import time | |
| from fabric.api import local, run, cd, env, task | |
| from fabric.operations import get | |
| from fabric.context_managers import cd, prefix | |
| from settings import DATABASES, MEDIA_ROOT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from somewhere import get_mongo_db | |
| # assuming get_mongo_db returns db instance | |
| class MongoException(Exception): | |
| pass | |
| class MongoField(object): | |
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Source: http://firepear.net/docs/python3-futures-2.html | |
| from concurrent.futures import ThreadPoolExecutor | |
| import random | |
| import time | |
| def sleep_until_the_future(**kwargs): | |
| kwargs['launchtime'] = time.time() | |
| time.sleep(kwargs['sleeptime']) | |
| return kwargs |