Show tasks that have notes but no title - #7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8778ccf66
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| impl Task { | ||
| /// Neither a title nor notes: a blank row, not a notes-only capture. | ||
| pub fn is_blank(&self) -> bool { | ||
| self.title.trim().is_empty() && self.notes.as_deref().unwrap_or("").trim().is_empty() |
There was a problem hiding this comment.
Show a placeholder for whitespace-only titles
When a task has a whitespace-only title and nonempty notes, is_blank() now admits it into Inbox, Today, Anytime, and Someday, but TaskLine::title_element uses task.title.is_empty() rather than the same trimmed check. The rendered task therefore displays only whitespace instead of (untitled), making the newly visible row appear to have no label unless detailed notes are enabled; normalize the title or make the placeholder check use trim().is_empty().
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 283c1b4. title_element now trims before the placeholder check, and the fixture covers a whitespace-only title with notes.
`inbox`, `today`, `anytime` and `someday` filter on `!title.trim().is_empty()`, so a capture saved without a title, such as a link dropped into the Inbox, never appears in them. `upcoming`, `find`, `project` and `area` carry no such filter and already show these tasks, and the renderer has an `(untitled)` placeholder in `ui/components/task_line.rs` that the four filters made unreachable. Filter on `Task::is_blank()` instead, title *and* notes empty, so the blank rows Things leaves behind stay hidden. `title_element` now trims before choosing the placeholder: admitting a whitespace-only title with notes would otherwise render a row of spaces instead of `(untitled)`. `tags()`, `resolve_tag_title` and `resolve_project_title` keep the plain title check: they ask whether there is a title to display, and a `Tag` has no notes to fall back on.
d8778cc to
283c1b4
Compare
|
Thanks for fixing this! |
|
@evanpurkhiser 👋 any plans to cut a new release? |
|
Happy to cut one sure |
Sometimes sharing a link into Things leaves the title empty and the URL lands in the
note (the iOS share sheet does this).
inbox,today,anytimeandsomedayfilter those out, so the CLI never shows them.upcoming,findandprojectalready do.Those four filter on
!title.trim().is_empty(). Now they useTask::is_blank(),both title and notes empty, so blank rows still get dropped.
title_elementtrims as well, otherwise a whitespace title renders as spaces rather than the
(untitled)placeholder that was already there.Left
tags()and theresolve_*_titlehelpers on the title check:Taghas nonotes, and those ask whether there's a title to show.
Fixture covers all four cases, fails on main.