Open UI in a single native app window by default

Use NiceGUI native mode (pywebview) instead of the default browser so
Desktop launchers get one dedicated window without existing tabs.
Add --browser / --no-browser overrides.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-07-22 09:08:29 +00:00
parent 71c269b9f0
commit 5c6451c32a
8 changed files with 65 additions and 25 deletions

View File

@@ -4,7 +4,7 @@
configured directory, clearing/resetting specific cells. Interfaces:
- CLI: `src/xlsx_clean/clean_cells.py` (`beaupy`)
- Web UI: `src/xlsx_clean/web_app.py` (NiceGUI at `http://127.0.0.1:8080`)
- Web UI: `src/xlsx_clean/web_app.py` (NiceGUI; default **native** single window via pywebview)
## Backends
@@ -25,7 +25,8 @@ Select with `--backend com|ooxml` (CLI) or the Backend dropdown (web UI).
- On Linux, the **ooxml** backend can clear/set cells and write a new workbook when
sample files and `XLSX_CLEAN_ROOT` point at a real tree. Without those data files,
interactive selection still works for config loading, but globbing finds no templates.
- NiceGUI web UI runs on Linux; `show=True` may try to open a browser (harmless if headless).
- NiceGUI defaults to a native window (`pywebview`). On this headless VM use
`--no-browser` or `--browser` as needed; native mode needs a display.
### Environment
- Prefer **uv** for all installs. `uv` lives in `~/.local/bin` (on PATH via `~/.bashrc`).
@@ -52,8 +53,8 @@ Select with `--backend com|ooxml` (CLI) or the Backend dropdown (web UI).
### Running / verifying
- CLI: `.venv/bin/python -m xlsx_clean.clean_cells` (defaults to `ooxml` on Linux).
- Web UI: `.venv/bin/python -m xlsx_clean.web_app --port 8080` then open
`http://127.0.0.1:8080`.
- Web UI: `.venv/bin/python -m xlsx_clean.web_app` (native window) or
`--no-browser` / `--browser` on headless / for default browser.
- Desktop shortcut (Linux): `.venv/bin/python desktop/install_desktop_shortcut.py`
- Windows shop-floor: double-click `desktop/Setup.bat` (uv install + shortcut), or build
an exe with `desktop/build_windows_exe.bat` **on a Windows PC** (cannot build Windows