summaryrefslogtreecommitdiffstats
path: root/HANDOFF.md
diff options
context:
space:
mode:
Diffstat (limited to 'HANDOFF.md')
-rw-r--r--HANDOFF.md13
1 files changed, 5 insertions, 8 deletions
diff --git a/HANDOFF.md b/HANDOFF.md
index 1009af9..4cc7339 100644
--- a/HANDOFF.md
+++ b/HANDOFF.md
@@ -1,17 +1,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 currently extending it post-v1.0 launch.
+ 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:
- Two features were implemented this session. First, draft article visual hints: added a draft property to the Article dataclass, amber [DRAFT] prefix in article list items, and a DRAFT badge in the article detail header. Second, article list metadata display: added four properties to Article (meta_type, meta_tags, meta_categories, meta_date), then updated the article list to show a two-line row per article with slug+badge on line 1 and type/date/tags/categories on line 2. The two-line rendering required three iterations to fix: setWordWrap failed, setTextElideMode failed, and the final working solution was a custom QStyledItemDelegate that draws both lines directly onto the canvas bypassing Qt elision entirely. The app was tagged v1.1 and pushed to origin.
+ 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 30 tests pass. The delegate approach (ArticleItemDelegate in ui/articles_view.py) is the correct solution for multi-line QListWidget items in PyQt6. Line 2 metadata is stored in Qt.ItemDataRole.UserRole+1 and drawn in dimmed #888 color. Draft items show amber #f59e0b.
- Missing-translation items show red #ff6b6b. The blog's TOML frontmatter uses lowercase keys: type, date, tags, categories. Tag v1.1 is pushed to danix_git:publisher.
+ 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. The remaining TODO items from TODO.md are: TaxonomyView Categories tab, MissingTranslationView Traduci button, font size spinner in SetupDialog, multi-token tag autocomplete in FrontmatterEditor, transart backend availability validation,
- taxonomy tag rename propagation to articles, and Ctrl+Q keyboard shortcut.
+ 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:
- Pick the next TODO item to implement. Suggested order by impact: (1) Ctrl+Q keyboard shortcut — trivial, one line in main_window.py; (2) font size spinner in SetupDialog (ui/setup_dialog.py) — moderate, saves via Config.save() and re-applies with app.setFont(); (3) transart backend
- availability check using OLLAMA_HOST; (4) MissingTranslationView Traduci button — wire translate_requested signal per row; (5) TaxonomyView Categories tab; (6) taxonomy tag rename propagation; (7) multi-token tag autocomplete in ui/frontmatter_editor.py. \ No newline at end of file
+ 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.