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.3.
What we covered:
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 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.
Next steps:
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.
|