fix(list): arrange today and someday the way the app does - #239
Merged
Merged
Conversation
The app arranges Today, Anytime and Someday identically: unfiled items first, then areas in area order, and inside an area its own loose to-dos before those of its projects. #236 gave anytime those keys. This gives them to the other two, from the same shared constant, renamed from anytimeGrouping now that three views take it. Someday listed in bare t."index" order and matched the app in none of its six positions. It now matches in all six. Today had the area key but not the loose-before-project one, so it put a project's to-dos ahead of its area's, backwards from the app. Adding that key alone took it from 4 of 27 positions to 9. Measuring the app's own Today showed two of today's within-day keys were wrong as well: - t.status put the closed items --include-completed keeps at the end of their group. The app leaves a closed item where it was, struck through: six closed rows were interleaved through three groups. - t.todayIndexReferenceDate DESC reordered whole groups by the day a todayIndex was last rewritten. That column stamps which day a todayIndex belongs to; the app does not sort on it. With both gone and todayIndex alone as the within-group key, today reproduces the app in all 27 positions, and the open-only listing is that same order with the closed rows removed. One case stays unverified and is recorded in the comment: a Someday project row and a loose Someday to-do in the same area both fall through to t."index", comparing a project's index with a to-do's. It is no worse than the ordering it replaces, and there is no Someday project in the data to measure against. Closes #237
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #237
Before and after, by uuid against the app
This changes numbered rows in two views, so here is the position-match count each way:
today --include-completedsomedayanytime(unchanged, as a control)things todaywith no flag is that same order with the closed rows removed, 18 of 18.What changed
The app arranges Today, Anytime and Someday identically: unfiled items first, then areas in area order, and inside an area its own loose to-dos before those of its projects. #236 gave
anytimethose keys; this gives them to the other two from the same constant, renamed fromanytimeGroupingtolistGroupingnow that three views take it.today needed more than the missing grouping key
The issue said to keep today's existing within-day key and add only what is missing. Adding only the loose-before-project key took today from 4 of 27 to 9 of 27, so I measured the app's own Today to find the rest. Two of today's within-day keys turned out to be wrong:
t.status ASCput the closed items--include-completedkeeps at the end of their group. The app leaves a closed item where it was, struck through — six closed rows were interleaved through three groups in the measured list.t.todayIndexReferenceDate DESCreordered whole groups by the day atodayIndexwas last rewritten. That column stamps which day atodayIndexbelongs to; the app does not sort on it.With both removed and
todayIndexalone as the within-group key, today reproduces the app in every position. I confirmed the proposed keys directly against the app's list before touching the code, so the removal is measured rather than inferred.Flagging it because it is more than the issue asked for. The alternative was leaving today at 9 of 27, which would not close the issue.
Tests
Three added: today grouping loose to-dos before project to-dos across two areas; today keeping a closed row in place among open ones under
--include-completed; and someday leading with unfiled items then areas in area order. Each seeds indexes running against the expected order so the key under test is the one doing the work. No existing test covered the two removed keys.Unverified, recorded in the comment
A Someday project row and a loose Someday to-do in the same area both fall through to
t."index", comparing a project's index with a to-do's — different spaces, the same concern therepeatingview's ordering calls out. It is no worse than the bare index ordering it replaces, and there is no Someday project in the data to measure the app's answer against.Docs
docs/content/commands.mdnow describes the arrangement once for the three views that share it, notes that today orders within a group by the position Things keeps for the day, and says thatsomedayreaches only the unfiled-then-areas half, since its filter excludes every to-do with a parent project.make testandmake lintare clean.