Editing a task as YAML
The task editor has two tabs, Form and YAML. Both show the same task: the form as fields, the YAML tab as the text of the task's file, which you can edit there. Whichever tab you save from, HarmFlow checks the task the same way.
One task, two tabs
- From the form to YAML. A change you make in the form appears in the YAML tab when you switch to it. While the form still holds the task as it was opened or last saved, the YAML tab shows the file's text as it is, its comments included. Once you change the form, the YAML tab shows the task as HarmFlow writes it, without the comments or the order of the keys the file had.
- From YAML to the form. A change you type in the YAML tab appears in the form when you switch back to it.
- Checked as you type. The Validation panel beside the editor checks what the open tab holds as you work, and the editor's header says whether the task is valid or how many errors it has.
For the keys a task file takes, see The task file in the reference.
YAML that cannot be read
If the text in the YAML tab cannot be read as a task, for example because a quotation mark is left open, switching to the form does not happen. The YAML tab stays open with your text as you typed it, a message says "The YAML could not be converted to the form; fix the errors first.", and the Validation panel says what is wrong. Fix the text, and the switch works.
When a save is refused
Saving from the YAML tab, with Save or ⌘S, applies the same checks as saving from the form: the same change gives the same error from either tab. When a change is invalid, for example a cron expression whose minute is 61:
- The save is refused. Nothing is written: the saved task stays as it was, and so does the task's file.
- The error is shown at its place. The Validation panel lists each error with the line and column where it is, such as "line 9, column 5", and the editor marks that line.
- Your text is kept. The YAML tab still holds what you typed, and the header still reads "Unsaved changes". Fix the line and save again.