Repository navigation
Troubleshooting
Install from lcars-ui/:
cd LCARS-WebUI/lcars-ui
pip install -e ".[dev]"Or run source examples with:
PYTHONPATH=src python examples/bridge_ops/app.pylcars.run(ui, port=8010)For examples:
lcars.run(ui, port=8010)LCARS_PORT affects an application only if that application reads it and passes the
value to lcars.run().
Use a stable explicit id:
if lcars.button("Refresh", id="refresh"):
lcars.notify("Refresh clicked.")Check that custom clients send the same action id.
Likely cause: the widget id changed between runs.
gain = lcars.number_input("Sensor Gain", value=5.0, id="sensor-gain")Every widget id must be unique in one ui() call.
lcars.metric("Core", "OK", id="core-status")
lcars.progress("Core Load", 72, id="core-load")Check that:
- The target widget exists in the current manifest.
- The target has an explicit id.
- The update is inside a button branch or live callback.
- The field name matches the widget model.
lcars.metric("Core Output", "87%", id="core-output")
if lcars.button("Refresh", id="refresh"):
lcars.update("core-output", value="91%")Move effects under the relevant action branch:
if lcars.button("Acknowledge", id="ack"):
lcars.notify("Acknowledged.")Forms can contain input widgets only. Move display widgets outside.
lcars.text("Configure warp parameters")
with lcars.form("Warp", action_id="warp-submit", id="warp-form"):
lcars.number_input("Warp Factor", id="warp-factor")lcars.form() does not currently return a submit flag. Use inputs and a button.
warp = lcars.number_input("Warp Factor", value=5.0, id="warp-factor")
if lcars.button("Commit Warp", id="commit-warp"):
lcars.append_log("ops-log", f"warp={warp:.2f}")Valid:
lcars.chart([1, 2, 3], title="Valid")
lcars.chart({"A": [1, 2], "B": [2, 3]}, title="Also Valid")Chart lists must be numeric.
For list[dict], table headers come from the first row. Put every desired column in the
first row.
rows = [
{"System": "Warp Core", "State": "Nominal", "Load": "87%"},
{"System": "Computer", "State": "Synced", "Load": "42%"},
]Only one live callback is supported. Combine periodic work.
@lcars.live(interval=5.0)
def poll() -> None:
update_core()
update_log()Catch unreliable sources yourself:
@lcars.live(interval=5.0)
def poll() -> None:
try:
value = read_sensor()
except Exception as exc:
lcars.append_log("ops-log", f"sensor read failed: {exc}")
return
lcars.update("sensor", value=str(value))Microphone access requires HTTPS except on localhost. Make sure /lcars/upload/audio is
allowed by your proxy.
file_upload() returns files only during the action rerun triggered after a successful
upload. Iterate the return value in ui() and consume bytes immediately:
files = lcars.file_upload("Data", id="data-upload")
for uploaded in files:
save_upload(uploaded.name, uploaded.read())Check the widget's max_bytes/max_files, the server's
LCARS_MAX_FILE_UPLOAD_BYTES, proxy body limits, and access to /lcars/upload/files.
Pass the module directory to run() and use the mounted URL:
lcars.three_scene("scenes/scene.js")
lcars.run(ui, assets_dir="./assets")Verify the module exists under that directory and inspect the inline scene error. The mount is read-only and will not serve paths outside its root.
Attach a hint after its target. With no explicit target, hint() uses the most recently
declared widget:
lcars.button("Inspect", id="inspect")
with lcars.hint("inspect", trigger="click"):
lcars.text("Detail")show_hint() and hide_hint() are intended for hints declared with
trigger="manual".
The Web widgets validate enum values and required nested fields. Check the payload against
The Web, or construct the exported typed model (SupportData, FrontierData,
and so on) close to the data source to surface validation errors earlier.
Remember the intentional empty states: no support is environments=[],
support-independent is one empty environment, and contenders=[] is valid.
Verify the reverse proxy forwards upgrades for /lcars/ws. SSE and HTTP fallbacks can
keep the app usable, but WebSocket should be available.
GitHub Wikis are separate git repositories. Updating a checked-in wiki/ directory in
the main repo does not update the live Wiki tab. Push to:
https://github.com/darsrc/LCARS-WebUI.wiki.gitSee Also: Getting Started · Deployment · Reference