Skip to content

C-Tagging: Tag tasks and find them by tag - #3

Merged
trigg770 merged 7 commits into
masterfrom
branch-C-Tagging
Sep 10, 2026
Merged

trigg770 merged 7 commits into
masterfrom
branch-C-Tagging

Conversation

@trigg770

@trigg770 trigg770 commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Extension: C-Tagging (tag: BCD-Extension)

  • tag INDEX #TAG... and untag INDEX #TAG... add and remove tags. Tags are letters and digits, case-insensitive, and shown after the description.
  • find #TAG lists the tasks with exactly that tag. Other keywords search descriptions as before.
  • Tags are saved as one extra field after the done flag. Untagged tasks are saved exactly as before, so existing save files load unchanged.

🤖 Generated with Claude Code

trigg770 and others added 7 commits September 10, 2026 20:01
A task holds only a description, a done flag and, for deadlines and
events, their dates. A user cannot label related tasks, e.g. all the
tasks for one module, except by repeating the label in every
description, where nothing treats it as a label.

Let's give every task a set of tags such as #fun, shown after the
description and saved as one extra field after the done flag. A task
without tags keeps exactly the line it had before, and a field only
counts as tags when every word in it is a valid tag, so existing save
files load unchanged.

A Tag record holds the rule for what a tag may be, letters and digits
compared in lower case, so the tasks, the save file and later the
parser share one definition. Allowing only letters and digits also
keeps a tag from ever containing the spaces or pipes the save format
relies on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tasks can hold tags, but no command attaches or removes them, so every
task's tags stay empty.

Let's add the commands tag and untag, which take a task number and one
or more tags, e.g. tag 2 #fun #school. One TagCommand handles both,
the way MarkCommand covers mark and unmark, since the two differ only
in the direction of the change and the wording.

An untag naming a tag the task does not have is rejected before
anything changes, because it usually means a typo, and removing the
other tags anyway would leave the task half changed. Tagging a task
with a tag it already has is accepted, since the result is what the
user asked for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tags now label tasks, but find searches descriptions only, so a tag
cannot be used to pick out the tasks it labels.

Let's treat a find keyword that starts with # as a tag, and show only
the tasks that have exactly that tag, so #fun does not match #funny.
Any other keyword searches descriptions as before.

The tag search is its own FindByTagCommand rather than a branch inside
FindCommand, because matching a whole tag is a different rule from
finding text inside a description.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
master now has A-CI and A-CodeQuality. A-CodeQuality edits the same
places as this branch in three files, so the merge conflicts there:
* Task.java and Parser.java: both branches add imports at the same
  spot
* Parser.java: both add a private helper before requireNotBlank,
  findOption on master and parseTag here
* Ui.java: master rewords the Javadoc right after the place where
  this branch adds showTagged

Let's keep both sides in each place: all the imports, in the order
Checkstyle expects, both helpers, and showTagged followed by master's
rewording.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
master now has A-Assertions, which adds an assert at the top of
Storage.parseLine that the line is not blank. This branch changes the
first lines of the same method, turning the first split into rawFields
so that it can also look for a tags field, so the two changes conflict.

Let's keep the assert, then this branch's rawFields split, which the
tag handling further down relies on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@trigg770
trigg770 merged commit f3602b6 into master Sep 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant