Give tasks a title separate from their description
`description` was the only text a task had, so it did three jobs: the row
label, the detail heading, and the markdown body under that heading -- the
drawer rendered the same string twice, and the row truncated it mid-sentence
in CSS. Callers worked around the missing field by packing a synthetic title
and a body into the one column split by a blank line, which is the shape the
dellm import left behind.
A task now has a short `title` and a `description` that holds only the
detail. Nothing concatenates them. `split_description` derives the pair from
one blob of text for callers that have only that -- quick add, email import,
problem promotion, a paste -- taking the first line as the title, or a
word-boundary truncation of it when it is too long to be a label, in which
case the body keeps the whole original so the truncation loses nothing.
Migration 062 backfills existing rows by the same rule and rebuilds the FTS
index around both columns, since the title now carries the text a search is
most likely to match.
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
41 files changed,
+602 insertions,
-144 deletions
| 62 |
62 |
|
059 32140c4ee5bb75b9d6530a0b7c60cef872acc5fa50bb969eb9368036131d4f84931cddbcf6f8b41038fb0d5fc175af7b
|
| 63 |
63 |
|
060 e5b833cff6c768710b0daf88fc9cf087938278ec158c99c0789242878832e802ae00e82bef2cc45efe21644de8d9fa57
|
| 64 |
64 |
|
061 8a37aa99045c49df8e54d36227702e68f570abb870114da14b31760cd0a1433cdd8f0d234808ec0d0da22672bc7fcb11
|
|
65 |
+ |
062 6a5d413c09ee5c3a115952dbeb1836e140d8170c24f4bab17a751b2d9e67cf583c1fff3639409230c1b7f56c851abaeb
|
| 132 |
132 |
|
fn task_carries_subject_priority_and_source() {
|
| 133 |
133 |
|
let src = email(" Ship the thing ", "a@b.com", "body");
|
| 134 |
134 |
|
let task = task_from_email(&src, None, Utc::now());
|
| 135 |
|
- |
assert_eq!(task.description, "Ship the thing");
|
|
135 |
+ |
assert_eq!(task.title, "Ship the thing");
|
|
136 |
+ |
assert_eq!(task.description, "", "the subject is a label, not a body");
|
| 136 |
137 |
|
assert_eq!(task.priority, Priority::Medium);
|
| 137 |
138 |
|
assert_eq!(task.source_email_id, Some(src.id));
|
| 138 |
139 |
|
assert_eq!(task.contact_id, None);
|