diff options
| -rw-r--r-- | HANDOFF.md | 11 | ||||
| -rw-r--r-- | TODO.md | 6 |
2 files changed, 10 insertions, 7 deletions
@@ -1,14 +1,17 @@ Who this is for: - Danilo is a developer and blogger running a bilingual (IT/EN) Hugo site at danix.xyz. He maintains a PyQt6 desktop app called my-publisher that centralizes his blog publishing workflow, and is continuing to extend it post-v1.4. + Danilo is a developer and blogger running a bilingual (IT/EN) Hugo site at danix.xyz. He maintains a PyQt6 desktop app called my-publisher that centralizes his blog publishing workflow, and is continuing to extend it post-v1.5. What we covered: - npm build integration was planned and implemented this session. The blog repo uses Tailwind CSS and npm run build compiles main.css to main.min.css. A new NpmWorker (workers/npm_worker.py) was created following the existing HugoWorker pattern: QObject + QProcess, emits log_line(str) and finished(bool). HugoPanel (ui/hugo_panel.py) was updated to sequence npm run build before starting hugo server when Avvia is clicked, and a new "Build CSS" button was added to allow manual Tailwind rebuilds while the server is already running. Button states are managed across four states: idle, building, running, rebuilding. All 34 tests pass. Changes were committed, pushed to master, and tagged v1.5. + Transart backend availability check was planned and implemented this session. Before starting a translation, the app now checks if the OLLAMA_HOST ollama backend is reachable. A new OllamaCheckWorker (workers/ollama_check_worker.py) was created as a QThread subclass that does a + blocking urllib.request.urlopen call to {host}/api/tags with a 4-second timeout. TranslationView.start_translation() was refactored to run this check first, storing the pending article, then either showing a QMessageBox.warning() popup (if unreachable) or calling the new + _start_worker() method (if reachable). A double-click guard prevents starting a second check while one is already running. The ollama_host field was added to the Config dataclass with a resolved_ollama_host() helper that falls back to the OLLAMA_HOST env var and then to http://localhost:11434. MainWindow passes ollama_host=self.config.ollama_host to TranslationView. Seven new tests were added. All 41 tests pass. Changes were committed, pushed to master, and tagged v1.6. What was confirmed: - NpmWorker follows the exact same QObject+QProcess pattern as HugoWorker. Sequential order was chosen: build completes before hugo starts. If build fails before hugo was ever started, the UI returns to idle state and Avvia is re-enabled. The blog repo package.json lives at the same path as config.blog_repo, so no new config fields were needed. Closing the app while hugo is running triggers stop_server() via closeEvent in main_window.py, which calls terminate() + waitForFinished(3000) on the QProcess. v1.5 is live on origin/master. + OllamaCheckWorker uses QThread (not QObject+QProcess) because it does a single blocking HTTP call, matching the GitWorker pattern. The /api/tags endpoint is the standard ollama health check. ollama_host defaults to empty string in Config, which resolves to the OLLAMA_HOST env var at call time (not at app start), so late-set env vars are picked up. Old config files without ollama_host load cleanly. The _retry() button re-runs start_translation() which re-checks the backend. All 41 tests pass. v1.6 is live on origin/master. Still in progress: Nothing was left open in this session. Next steps: - Remaining TODO items include: (1) transart backend availability check using OLLAMA_HOST — validate before translation starts or disable the translate button with a popup; (2) font size spinner in SetupDialog — add QSpinBox, save via Config.save(), re-apply with app.setFont(); (3) article editor language flag in the sidebar; (4) manage static pages in addition to articles.
\ No newline at end of file + Remaining TODO items include: (1) font size spinner in SetupDialog — add QSpinBox, save via Config.save(), re-apply with app.setFont(); (2) article editor language flag in the sidebar — add a visible flag/indicator so the user knows the language of the article being edited, useful + for empty drafts; (3) manage static pages in addition to articles.
\ No newline at end of file @@ -17,12 +17,12 @@ ## Settings - [ ] **Font size spinner in UI** — `font_size` is in config but only editable via `~/.config/my-publisher/config.toml`. Add a `QSpinBox` to `SetupDialog` (or a dedicated Settings dialog) so it's changeable without editing the file. Save via `Config.save()`, re-apply with `app.setFont()`. File: `ui/setup_dialog.py`. -## Transart backend availability -- [ ] Using the `OLLAMA_HOST` variable in transart.py, validate if the backend is available or disable the "translate" button. Maybe add a popup message reminding to activate the runpod for the translation engine to be available. - ## manage pages as well - [ ] right now the program only manages articles. We should add a way to manage static pages as well. +## Transart backend availability +- [✅] Using the `OLLAMA_HOST` variable in transart.py, validate if the backend is available or disable the "translate" button. Maybe add a popup message reminding to activate the runpod for the translation engine to be available. + ## UI Gaps - [✅] **TaxonomyView: Categories tab** — Tags tab exists, Categories tab missing. Mirror the Tags tab structure (IT/EN pair table, orphan detection) for `categories` frontmatter key. Files: `ui/taxonomy_view.py`, `core/taxonomy.py`. |
