Task sorting

- Time: Wait tasks sort by when the wait ends, earliest first. Limit reset tasks sort by when their wait ended, so the one that has been ready longest comes first. The time is kept when a wait expires, which is what makes the second sort possible.
- Order: I put time before account for these two statuses, so the full order is status, then time, then account, then name. Other statuses still go status, account, name. If you'd rather have account before time, swap the two checks in taskLess in Display.cpp.
- Manual limit reset: a task you set to limit-reset by hand has no wait time, so it sorts first among limit resets.

Account status: an account takes the most taken level among its tasks.
- Busy: it has a Testing, Limit reset or Wait task. The TASKS column lists those tasks.
- Taken: it has a Prompt task and nothing Busy. The TASKS column lists the Prompt tasks.
- Free: it only has Done, Frozen or Uploading tasks, or no tasks. The TASKS column shows

 Changes to be committed:
	modified:   README.md
	modified:   include/Display.h
	modified:   include/Status.h
	modified:   src/Completer.cpp
	modified:   src/Display.cpp
	modified:   src/Repl.cpp
	modified:   src/Status.cpp
This commit is contained in:
alejo committed 2026-10-18 21:50:24 -03:00
1 parent 04fa2b1b20
commit 6cb5a8611f
7 files changed
+107 -36

No files matched your search

+6 -4
View File
@@ -85,7 +85,7 @@ void Repl::registerCommands() {
{ArgKind::Visibility, ArgKind::TaskLevel}, &Repl::cmdDispTskLevel);
add("disp acc", "disp acc (hide|show)", "auto-print the account table after changes", 1, 1,
{ArgKind::Visibility}, &Repl::cmdDispAcc);
add("disp acc level", "disp acc level (hide|show) (busy|free|all)",
add("disp acc level", "disp acc level (hide|show) (busy|taken|free|all)",
"hide or show account rows by status", 2, 2,
{ArgKind::Visibility, ArgKind::AccountLevel}, &Repl::cmdDispAccLevel);
@@ -421,7 +421,7 @@ bool Repl::cmdDisp(const Args&) {
std::cout << " none";
}
for (AccountLevel level : settings.hiddenAccountLevels) {
std::cout << (level == AccountLevel::Busy ? " busy" : " free");
std::cout << " " << accountLevelName(level);
}
std::cout << "\n";
return false;
@@ -471,13 +471,15 @@ bool Repl::cmdDispAccLevel(const Args& args) {
std::set<AccountLevel>& hidden = display_.settings().hiddenAccountLevels;
std::vector<AccountLevel> targets;
if (level == "all") {
targets = {AccountLevel::Busy, AccountLevel::Free};
targets = {AccountLevel::Busy, AccountLevel::Taken, AccountLevel::Free};
} else if (level == "busy") {
targets = {AccountLevel::Busy};
} else if (level == "taken") {
targets = {AccountLevel::Taken};
} else if (level == "free") {
targets = {AccountLevel::Free};
} else {
throw std::runtime_error("Unknown level '" + args[1] + "'. Use: busy, free, all");
throw std::runtime_error("Unknown level '" + args[1] + "'. Use: busy, taken, free, all");
}
for (AccountLevel target : targets) {