Order project list by sortOrder, as Linear's app does - #292
Merged
Merged
Conversation
#290 ordered `project list` by status-type flow rank, then status position, then sortOrder. That rule was reconstructed from the schema docs and never checked against the app, and it is wrong: with probe projects in five statuses, Linear's projects list shows every project strictly by sortOrder ascending, so a backlog project with a higher sortOrder sits after a canceled one rather than with the other backlog projects. Order by sortOrder, then name, then id. Drop the status-type ranking and the status.position key, and stop fetching status.position, which nothing else read. Keep the non-finite check on sortOrder so a null key errors instead of scrambling the list. The status-type ranking was also the only exhaustive check on ProjectStatusType here, so make the date column's switch exhaustive instead of letting an unknown type fall through to the backlog date. Two things the observation cannot settle: whether the app view had a customised grouping/ordering setting, and sortOrder vs prioritySortOrder, which were identical for every project observed.
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.
#290 (merged, unreleased) ordered
project listby status-type flow rank, thenstatus.position, thensortOrder. That rule was reconstructed from schema docs and never checked against the Linear app. It is wrong.Evidence
The workspace has ten projects, five of them probes created for this check, one per status. Linear's projects list shows them in exactly this order:
That is
sortOrderascending, with status ignored. If the app grouped by status, "E probe backlog" would sit with the other backlog projects instead of ahead of D. Onmainthe CLI prints E, Triage, QA, PR…, PR…, Linear CLI, D, C, B, A. With this change,project listagainst the live workspace prints the table's order exactly.What changed
compareProjectsForDisplayorders bysortOrderascending, then name, then id. The status-type ranking and thestatus.positionkey are gone. The non-finite check onsortOrderstays, so a null key errors instead of scrambling the list.ProjectDisplayOrderKeyis narrowed to{ id, name, sortOrder }.GetProjectsno longer fetchesstatus.position, because nothing else read it.project list --jsonloses that field. Make project view show the whole project, add a picker, and order project list like Linear #290 added it and it was never released.ProjectStatusTypein this command. The date column'sswitchis now exhaustive instead, so an unknown status type errors rather than silently getting the backlog date. A cross-provider review (Codex) found this gap.sortOrdertests are kept. A new test covers an unknown status type. The JSON pagination snapshot now lists Alpha (sortOrder 900, started) before Beta (1000, planned) and has noposition.Still uncertain
grouping=/ordering=params.sortOrdervsprioritySortOrder: the two were identical for every project here, so this data can't tell them apart. This usessortOrder, which the schema documents as "the sort order for the project within the workspace. Used for manual ordering in list views."