summaryrefslogtreecommitdiffstats
path: root/HANDOFF.md
diff options
context:
space:
mode:
Diffstat (limited to 'HANDOFF.md')
-rw-r--r--HANDOFF.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/HANDOFF.md b/HANDOFF.md
index 30cec4f..15cdf00 100644
--- a/HANDOFF.md
+++ b/HANDOFF.md
@@ -1,14 +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 continuing to extend it post-v1.2.
+ 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.3.
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.
+ Four bugs were fixed this session. First, the categories field in FrontmatterEditor was displaying Python list repr (e.g. "['cat1', 'cat2']") instead of a comma-separated string, and saving it back as a corrupted TOML string. Fixed by adding an isinstance(val, list) branch in _build_ui() and generalising the save logic to detect list-typed fields by checking the original frontmatter value type rather than hardcoding "tags". Second, the article type combo box was defaulting to "Life" instead of the article's actual type, because ARTICLE_TYPES used titlecase while files store lowercase values. Fixed by lowercasing ARTICLE_TYPES and doing a case-insensitive match on load. Third, on save the type was being written back in titlecase instead of lowercase. Fixed by the same ARTICLE_TYPES change. Fourth, categories autocomplete was added to FrontmatterEditor: a MultiTokenCompleter (already used for tags) is now also attached to the categories QLineEdit, loading suggestions from docs/categories.txt via load_categories(). All 34 tests pass. Three commits were made and pushed. v1.4 was tagged and pushed.
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.
+ All 34 tests pass after every change. No articles in the blog repo had corrupted categories fields — the corruption seen in earlier exploration was not present in the actual files. ARTICLE_TYPES is now ["life", "photo", "link", "quote", "tech"]. The save path for both tags and categories now uses isinstance(self._article.frontmatter.get(key), list) to detect list fields generically. MultiTokenCompleter loads categories from docs/categories.txt (a single non-lang-split file, unlike tags which have tags-it.txt and tags-en.txt). v1.4 is live on origin/master.
Still in progress:
- Nothing was left open in this session. Continue with items from the TODO.md list.
+ Nothing was left open in this session.
Next steps:
- Many TODO items remain. Suggested order: (1) fix the taxonomies bug when modifying from the frontmatter editor; (2) transart backend availability check using OLLAMA_HOST — validate before translation starts or disable the translate button with a popup reminder to activate RunPod. (3) font size spinner in SetupDialog (ui/setup_dialog.py) — add QSpinBox, save via Config.save(), re-apply with app.setFont();
+ Remaining TODO items include: (1) npm run build integration before launching hugo server, with a button to trigger it while the server is running; (2) transart backend availability check using OLLAMA_HOST — validate before translation starts or disable the translate button with a popup; (3) font size spinner in SetupDialog — add QSpinBox, save via Config.save(), re-apply with app.setFont(); (4) article editor language flag in the sidebar; (5) manage static pages in addition to articles. \ No newline at end of file