feat(start): replace start page with Silo web app webview #117

Closed
opened 2026-02-09 15:50:48 +00:00 by forbes · 0 comments
Owner

Summary

Replace the native Qt Widgets start page with a Python-based dual-mode view:

  • Online: QWebEngineView loading the Silo web app for immediate access to projects, items, and part management
  • Offline: Native Qt fallback showing recent local files and Silo connectivity status

Architecture

Python module using a QStackedWidget with two pages:

Page 1: Silo Web View (online)

  • QWebEngineView pointed at the Silo base URL (http://localhost:8080 by default)
  • Override acceptNavigationRequest to keep navigation within Silo
  • Shown when the Silo server is reachable

Page 2: Offline Fallback (native Qt)

  • Silo connectivity panel: status indicator (connected/disconnected), server URL, retry button, error details
  • Recent files list: locally saved .FCStd files from FreeCAD preferences (reuse existing RecentFilesModel pattern)
  • File cards: thumbnail, filename, path, last modified — click to open
  • Styled with Catppuccin Mocha to match the rest of Create

Connectivity Logic

  • QTimer-based polling (e.g. every 5s) hitting the Silo API URL
  • On connection success → switch stack to web view, load/refresh if needed
  • On connection failure → switch stack to offline fallback, update status display
  • Immediate check on startup before showing either view

Implementation Details

  • Module location: src/Mod/Start/StartGui.py or similar, following the Help module pattern (src/Mod/Help/Help.py)
  • MDI integration: register as Gui::MDIView subclass, added via mw.addWindow()
  • Command: replace or wrap Start_Start command to instantiate the new view
  • URL configuration: read from FreeCAD.ParamGet('User parameter:BaseApp/Preferences/Mod/Silo').GetString('ApiUrl'), strip /api suffix for web UI root, fall back to SILO_API_URL env var then http://localhost:8080
  • Auto-launch: preserve existing StartLauncher behavior that shows the page on startup
  • Re-adds QtWebEngine dependency: intentional — the online mode requires it, but the offline fallback works without it

Fallback Behavior

If QtWebEngine is not available at all (import fails):

  • Permanently show the offline fallback page
  • Log a warning, don't crash
  • Silo status shows 'WebEngine not available' instead of polling
  • Silo web app: mods/silo/ (Go backend, server-rendered HTML templates at /, API at /api)
  • Help module webview pattern: src/Mod/Help/Help.py
  • Current start page: src/Mod/Start/Gui/StartView.cpp
  • Silo URL config: mods/silo/pkg/freecad/silo_commands.py_get_api_url()
## Summary Replace the native Qt Widgets start page with a Python-based dual-mode view: - **Online**: QWebEngineView loading the Silo web app for immediate access to projects, items, and part management - **Offline**: Native Qt fallback showing recent local files and Silo connectivity status ## Architecture Python module using a `QStackedWidget` with two pages: ### Page 1: Silo Web View (online) - `QWebEngineView` pointed at the Silo base URL (`http://localhost:8080` by default) - Override `acceptNavigationRequest` to keep navigation within Silo - Shown when the Silo server is reachable ### Page 2: Offline Fallback (native Qt) - **Silo connectivity panel**: status indicator (connected/disconnected), server URL, retry button, error details - **Recent files list**: locally saved `.FCStd` files from FreeCAD preferences (reuse existing `RecentFilesModel` pattern) - **File cards**: thumbnail, filename, path, last modified — click to open - Styled with Catppuccin Mocha to match the rest of Create ### Connectivity Logic - `QTimer`-based polling (e.g. every 5s) hitting the Silo API URL - On connection success → switch stack to web view, load/refresh if needed - On connection failure → switch stack to offline fallback, update status display - Immediate check on startup before showing either view ## Implementation Details - **Module location**: `src/Mod/Start/StartGui.py` or similar, following the Help module pattern (`src/Mod/Help/Help.py`) - **MDI integration**: register as `Gui::MDIView` subclass, added via `mw.addWindow()` - **Command**: replace or wrap `Start_Start` command to instantiate the new view - **URL configuration**: read from `FreeCAD.ParamGet('User parameter:BaseApp/Preferences/Mod/Silo').GetString('ApiUrl')`, strip `/api` suffix for web UI root, fall back to `SILO_API_URL` env var then `http://localhost:8080` - **Auto-launch**: preserve existing `StartLauncher` behavior that shows the page on startup - **Re-adds QtWebEngine dependency**: intentional — the online mode requires it, but the offline fallback works without it ## Fallback Behavior If QtWebEngine is not available at all (import fails): - Permanently show the offline fallback page - Log a warning, don't crash - Silo status shows 'WebEngine not available' instead of polling ## Related - Silo web app: `mods/silo/` (Go backend, server-rendered HTML templates at `/`, API at `/api`) - Help module webview pattern: `src/Mod/Help/Help.py` - Current start page: `src/Mod/Start/Gui/StartView.cpp` - Silo URL config: `mods/silo/pkg/freecad/silo_commands.py` → `_get_api_url()`
forbes added the enhancement label 2026-02-09 15:50:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#117