Feature #334

new attribute; note:< fileref | string >

Added by David Patrick 282 days ago. Updated 281 days ago.

Status:New Start:12/01/2009
Priority:Normal Due date:
To:Paul Beckingham % Done:

0%

Category:core Spent time: -
Target version:2.0.x - Katana

Description

Sometimes, you will have more information than you want to cram into a task description.
With note: you will be able to add any amount of additional information, from a single word to the largest text file imaginable, by assigning a file reference OR a text string. The resulting note will reside either in an external file, or in the task record data file (where the external file reference isn't)

It may sound complicated, at first blush, to have an attribute that could be one of two data types,
but in use it should be intuitive and the duality solves an otherwise thorny question;
task note data IN or OUT of task data file?
Either.

How is the task user to know which is which ?
how is the program to know ?
is it an embedded text string or an external fileref ?

Easy; any (non-escaped) whitespace denotes an in-file attribute text string, not a fileref.

If the entry has NO effective whitespace (un-escaped <spaces> or <tabs>) then it can be tested as a file reference.

If it can be parsed to a valid file reference, then it IS a file reference, and if not, it's a text string, again!

(much easier than it sounds)
here are a few examples

task add foo note:we keep foo in the bottom drawer

this note is now a text string part of the foo task record, in pending.data (or wherever you decide to keep it)

task ID note:~/reference.txt

will create a file reference (and a link) to a file in your home directory

task ID note:reference.txt

refers to a file in the default directory defined in .taskrc (suggested default; ~/.task/notes/)

task ID note:reference

(with no trailing spaces) could parse as a valid path/file, so it IS an external file reference

task ID note: reference

(see the leading space ?) is an in-line, one-word note

task ID note:/home/djp\mytasks\reference.txt

(even though it has no spaces) is in-line text, as it will fail the test as a valid file (or path) reference.

Users will just have to remember that if they want to add a one-word note, that at least one space will also have to be added, to keep the note from parsing as an external file name.

Any number of tasks can link to the same text file

The file doesn't have to exist, but any action that would read or write it (like a report or an info or edit command) should trigger an error and a dialog to create or locate the missing file. Using the default directory most of the time, or adding symlinks to it, would be recommended.

Whether internal or external till be transparent in use. Notes will be seen in any report that uses the field, and at the end of the info report, and when using the task edit function, the note will be made available for editing in the same virtual edit session.

Notes of either type can be displayed a number of different ways in reports and exports;
  • from the smallest visual indicator (an "N" in a flag column),
  • or using the available space on a line, truncated...
  • or showing the raw file-reference
  • or full width on a single line (truncated) following a task
  • or full width following a task and taking as much space, and wrapping new lines as needed to display the whole note.

Truncation can be semi-automatic, with some notes truncating and some notes wrapping, by setting the report options to allow word-wrapping, and then forcing truncation for any note whose last three (non-white-space) characters are "..."
Want the note to be truncated ?
edit it to end with ...
Want it to wrap ?
remove the ... or follow it with something else.


Related issues

related to Feature #11 truncation New 05/16/2009
duplicates Feature #61 File attachments New 05/25/2009

Also available in: Atom PDF