# TODO

## save on exit
- [ ] if a file has been modified, ask for confirmation before exiting the application to avoid losing local edits.

## git operations
- [ ] the push to master button doesn't work on its own, it needs to know what to commit, write a commit message and then it can push to master. 
- [ ] with local modifications present, it's not possible to pull from remote. Add a way to stash or revert local modifications, especially for modified articles.

## filter and order by
- [ ] in the main articles view, add the option to order by date, category, type
- [ ] add a quick filter button 🔎 (Ctrl+f) that shows a search bar, and removes articles not matching the search term as we type.

## article editor
- [ ] in the article editor window, add a flag to the top of the sidebar to easily recognize what language the content is in. Useful for empty drafts where no content has been written yet.

## 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.

## 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`.

- [✅] **MissingTranslationView: Traduci button** — `translate_requested(str)` signal declared but no button wired to it. Add a per-row "Traduci" button that emits the signal with the article slug, then handle it in `main_window.py` to open the translation view for that article.

## Autocomplete
- [✅] **FrontmatterEditor: multi-token tag autocomplete** — `QCompleter` only completes the first token in the tags field. Need a custom completer that splits on commas, completes the current token, and re-joins. Consider subclassing `QCompleter` or intercepting `textEdited` to extract the active token. File: `ui/frontmatter_editor.py`.

## Drafts
- [✅] Add visible hints to quickly identify articles with `draft = true` in frontmatter. The hints can be added to the list view as well as the single view as a badge, color difference, etc.

## Interface
- [✅] The main articles list should display the type, tags, categories and date fields for each article in both languages.
- [✅] When modifying tags in the taxonomy view, they should be updated in the relevant articles. EG modified the english "regionale" tag to "regional", after saving it, the program should find all english articles with the old "regionale" tag and modify them to the new "regional".

## keyboard shortcuts
- [✅] The app should follow some standard keyboard shortcuts like Ctrl+q should quit the app.

## hugo server
- [✅] we should add a way to run `npm run build` before launching the hugo server. We also need to be able to run it using a button in the interface when the server is already running.

## frontmatter
### taxonomies
- [✅] when modifying the frontmatter, the square brackets around the tags or categories lists are not maintained. 
### article types
- [✅] the program should respect the article type already set in the frontmatter and don't default to "Life" if the article is set to something else.
- [✅] the theme expects the article type to be lowercase. The program currently writes them as uppercase
### categories dropdown
- [✅] when adding a category to the article, offer a dropdown of the categories or autocomplete like we do for tags.

