Commit Graph

28 Commits

Author SHA1 Message Date
e83769090b fix: use Qt enum for setWindowModality instead of raw integer
PySide6 requires the proper enum type QtCore.Qt.WindowModal, not the
raw integer 2. The integer form was accepted by PySide2/Qt5 but raises
TypeError in PySide6.
2026-02-11 07:40:05 -06:00
6c9789fdf3 fix: use FreeCADGui.Document.Modified instead of App.Document.IsModified()
App.Document has no IsModified() method, causing Silo_Pull to crash with
AttributeError. The correct API is to get the Gui document and check its
Modified property, consistent with the pattern used elsewhere in this file
(lines 891, 913).
2026-02-10 10:39:13 -06:00
85bfb17854 feat: native Qt start panel with Silo API + kindred:// URL scheme
Replace QWebEngineView-based start page with a rich native Qt panel that
fetches items directly from the Silo REST API. QWebEngineView is not
available on conda-forge for Qt6.

Start panel features:
- Database Items list with search (from SiloClient.list_items)
- Recent Files list from FreeCAD preferences
- Real-time Activity Feed via SSE (SiloEventListener)
- Context menu: Open in Create, Open in Browser, Copy Part Number
- Open in Browser button (QDesktopServices)
- Catppuccin Mocha dark theme styling

URL scheme support:
- handle_kindred_url() function for kindred://item/{part_number} URLs
- Startup hook in InitGui.py for cold-start URL arguments

Closes #167
2026-02-10 10:30:12 -06:00
8937cb5e8b Merge pull request 'feat(freecad): add Silo-aware start page with webview and offline fallback' (#12) from feat/silo-start-page into main 2026-02-09 17:28:34 +00:00
a53cd52c73 feat(freecad): add Silo-aware start page with webview and offline fallback
Replaces the default FreeCAD Start page with a dual-mode view:
- Online: QWebEngineView loading the Silo web app
- Offline: native Qt fallback with recent files and connectivity status

The command override is registered at InitGui.py load time, before
the C++ StartLauncher fires.
2026-02-09 11:28:16 -06:00
Zoe Forbes
c6e187a75c Merge fix/sse-url-and-origin-open 2026-02-08 22:54:37 -06:00
Zoe Forbes
2e9bf52082 fix: SSE URL double /api/ and SiloOrigin command invocation (#84)
- Fix SSE listener URL: _listen() used '/api/events' but _get_api_url()
  already returns a URL ending in '/api', producing '/api/api/events'.
  Changed to '/events' to match _test_sse().
- Replace all Command.get().Activated() calls in silo_origin.py with
  FreeCADGui.runCommand(). The C++ Gui::Command wrapper returned by
  Command.get() does not expose .Activated() to Python.
2026-02-08 22:54:28 -06:00
Zoe Forbes
383eefce9c fix(UX): offer registration when BOM opened on untracked document (#56)
Replace the dead-end warning in Silo_BOM with a question dialog that
offers to register the document via Silo_New. If the user accepts and
registration succeeds, the BOM dialog opens seamlessly.
2026-02-08 18:46:22 -06:00
Zoe Forbes
1676b3e1a0 art: add missing icons for TagProjects, Rollback, SetStatus (#60)
Create silo-tag.svg, silo-rollback.svg, and silo-status.svg in the
Catppuccin Mocha style matching existing silo icons. These were
referenced by _icon() but did not exist, causing the commands to
render without toolbar icons.
2026-02-08 18:36:22 -06:00
Zoe Forbes
06cd30e88d fix: update silo-client — consistent error handling in delete_bom_entry (#59) 2026-02-08 18:29:31 -06:00
f9924d35f7 Merge pull request 'feat: enhance Database Activity pane with comments, interaction, and badges' (#11) from feature/activity-pane-enhancements into main
Reviewed-on: #11
2026-02-08 22:23:50 +00:00
373f3aaa79 Merge branch 'main' into feature/activity-pane-enhancements 2026-02-08 22:23:40 +00:00
66b2baf510 Merge pull request 'fix: SSE reconnect with exponential backoff and terminal state' (#7) from fix/sse-reconnect into main
Reviewed-on: #7
2026-02-08 22:23:23 +00:00
35f33f2079 Merge branch 'main' into fix/sse-reconnect 2026-02-08 22:23:16 +00:00
Zoe Forbes
d26bb6da2d feat: enhance Database Activity pane with comments, interaction, and badges
Enhance the Database Activity panel in SiloAuthDockWidget:

- Show latest revision number and comment inline per activity entry
- Truncate long descriptions with ellipsis, full text in tooltip
- Mark locally checked-out items with green color and "local" badge
- Double-click opens local file or triggers checkout from server
- Right-click context menu: Open in Create, Open in Browser,
  Copy Part Number, View Revisions

Closes #9
2026-02-08 16:23:06 -06:00
Zoe Forbes
e5126c913d fix: SSE reconnect with exponential backoff and terminal state
Replace the infinite fixed-delay retry loop with exponential backoff
(1s, 2s, 4s, ... capped at 60s) and a max retry limit of 10.

Changes to SiloEventListener:
- Expand connection_status signal to (status, retry_count, error_message)
- Add exponential backoff: min(BASE_DELAY * 2^retries, MAX_DELAY)
- Add terminal "gave_up" state after MAX_RETRIES exhausted
- Capture and forward error messages from failed connection attempts

Changes to SiloAuthDockWidget._on_sse_status:
- Show retry count: "Reconnecting (3/10)..."
- Show "Disconnected" (red) on gave_up state
- Log each attempt to FreeCAD console (PrintWarning/PrintError)
- Set tooltip with last error message on the status label

Closes #2
2026-02-08 16:22:55 -06:00
76973aaae0 Merge pull request 'feat: add Silo_Diag connection diagnostics command' (#6) from feature/silo-diag into main
Reviewed-on: #6
2026-02-08 22:22:51 +00:00
Zoe Forbes
4ddbf26af7 feat: add Silo_Diag connection diagnostics command
Add a diagnostics command that sequentially tests:
- DNS resolution of the server hostname
- Health endpoint (/health)
- Readiness endpoint (/ready)
- Auth endpoint (/auth/me) with token
- SSE event stream (/events)

Results are printed to the FreeCAD console with PASS/FAIL status.

Closes #3
2026-02-08 16:22:25 -06:00
516116ae9d Merge pull request 'feat: add silo-aware start panel' (#10) from feature/start-panel into main
Reviewed-on: #10
2026-02-08 22:11:55 +00:00
Zoe Forbes
6fa60af5e0 feat: add silo-aware start panel
Add a SiloStartPanel dock widget that shows connection status, local
checkouts, recent silo activity, and local recent files. Automatically
shown when the Silo workbench is activated.

Sections:
- Connection status badge (green/gray dot with hostname)
- My Checkouts: scans local projects dir for .FCStd files, shows part
  number and description, double-click to open
- Recent Silo Activity: fetches from server, badges items present
  locally, double-click to open or checkout
- Local Recent Files: reads FreeCAD MRU list, double-click to open

Auto-refreshes every 60 seconds. Panel is reused if already open.

Closes #5
2026-02-08 16:11:33 -06:00
fd3c97ff97 Merge pull request 'feat: reflect server mode in client UI' (#8) from feature/server-mode-ui into main
Reviewed-on: #8
2026-02-08 22:10:22 +00:00
fb9e1d3188 Merge branch 'main' into feature/server-mode-ui 2026-02-08 22:10:14 +00:00
Zoe Forbes
026ed0cb8a feat: reflect server mode in client UI
Add server mode awareness to the FreeCAD client. The mode (normal,
read-only, degraded, offline) is fetched from the /ready endpoint on
each status refresh and updated in real-time via SSE server.state events.

Changes:
- Add _server_mode global and _fetch_server_mode() helper that queries
  /ready and maps response status to mode string
- Add server_mode_changed signal to SiloEventListener, handle
  server.state SSE events in _dispatch()
- Add mode banner to SiloAuthDockWidget: colored bar shown when server
  is not in normal mode (yellow=read-only, orange=degraded, red=offline)
- Update _refresh_status() to fetch mode and update banner
- Disable write commands (New, Save, Commit, Push) when server is not
  in normal mode via IsActive() checks

Closes #4
2026-02-08 16:06:48 -06:00
Zoe Forbes
45e803402d fix: use absolute import in silo_origin.py
The freecad/ directory is not a Python package (no __init__.py) — it is
added directly to sys.path by FreeCAD. The relative import
'from .silo_commands import ...' fails when silo_origin is imported as a
top-level module, causing Silo origin registration to silently fail.

Change to absolute import 'from silo_commands import ...' to match
the import style used everywhere else in the directory.
2026-02-08 10:35:54 -06:00
Zoe Forbes
fcb0a214e2 fix(gui): remove Silo toolbar and ToggleMode in favor of unified origin system
Remove the separate Silo workbench toolbar and Silo_ToggleMode command.
File operations (New/Open/Save) are now handled by the standard File
toolbar via the origin system. The Silo menu retains admin commands
(Settings, Auth, Info, BOM, TagProjects, SetStatus, Rollback).

Closes #65
2026-02-07 21:28:55 -06:00
3228ef5f79 Merge pull request 'fix(silo): fix auth crashes, menu redundancy, and origin connect' (#1) from fix/silo-workbench-bugs into main
Reviewed-on: #1
2026-02-07 20:33:25 +00:00
Zoe Forbes
02ad9a00db fix(silo): fix auth crashes, menu redundancy, and origin connect
- Add missing _get_auth_token() function that caused NameError in Settings
- Replace _client.auth_username/role/source() calls with _get_auth_*()
  helpers (methods don't exist on SiloClient, crashed auth dock widget)
- Fix connect() in silo_origin.py to show login dialog instead of just
  revealing the dock panel (was using non-existent Command.get() API)
- Separate toolbar (file ops) from menu (admin/management commands)
- Remove DEBUG logging from Silo_Save command
- Fix long line formatting in silo_origin.py
2026-02-07 14:30:37 -06:00
Zoe Forbes
bf0b84310b initial: FreeCAD Silo workbench (extracted from silo monorepo)
FreeCAD workbench for Silo PLM integration. Uses shared silo-client
package (submodule) for API communication.

Changes from monorepo version:
- SiloClient class removed, imported from silo_client package
- FreeCADSiloSettings adapter wraps FreeCAD.ParamGet() preferences
- Init.py adds silo-client to sys.path at startup
- All command classes and UI unchanged
2026-02-06 11:23:54 -06:00