blob: 4cc7339df875a51b3895a438aad789ddae9dbe89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
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.2.
What we covered:
Three changes were implemented this session. First, multi-token tag autocomplete was added to FrontmatterEditor: a MultiTokenCompleter subclass of QCompleter intercepts textEdited, extracts the last comma-separated token as the completion prefix, and on activation inserts the completed tag followed by ", " so the user can immediately type the next tag. Does not call setCompleter() — wires via setWidget() + signals to bypass Qt's built-in prefix detection. Second, tag rename propagation was added to TaxonomyView: _save() now snapshots the old it_to_en dict before modifying, calls _detect_renames() (static method, compares old vs new dicts to find IT and EN renames), then _propagate_renames() scans all articles via scan_articles() and rewrites frontmatter for any article whose tags include a renamed value. Status bar shows count of updated articles. Propagation only runs after save_taxonomy() succeeds. Third, a pre-existing bug was fixed in FrontmatterEditor._save(): it was passing empty string as body to write_frontmatter(), erasing all article content below the +++ delimiter. Fixed by reading body via parse_frontmatter() first.
What was confirmed:
All 34 tests pass. pytest-qt added to requirements.txt for the _detect_renames unit tests. The body-erasure bug was pre-existing since v1.0 — any article saved through FrontmatterEditor before this fix lost its content. MultiTokenCompleter does not call widget.setCompleter() because that re-enables Qt's built-in single-token prefix logic. Tag rename propagation is transactional: taxonomy save failure aborts propagation entirely. v1.3 tagged and pushed.
Still in progress:
Nothing was left open in this session. Remaining TODO items are: font size spinner in SetupDialog, and transart backend availability validation using OLLAMA_HOST.
Next steps:
Two TODO items remain. Suggested order: (1) font size spinner in SetupDialog (ui/setup_dialog.py) — add QSpinBox, save via Config.save(), re-apply with app.setFont(); (2) transart backend availability check using OLLAMA_HOST — validate before translation starts or disable the translate button with a popup reminder to activate RunPod.
|