Fix: new projects sort to top of sidebar#123
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/e1a535bb-d786-4eae-a26b-cf9dc5ace025 Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix new projects sorting to top of sidebar
Fix: new projects sort to top of sidebar
Mar 31, 2026
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.
New projects with no threads were sinking to the bottom of the sidebar because
getProjectSortTimestamp()had no fallback for the threadless case — returningNumber.NEGATIVE_INFINITYand losing to any project with thread activity.What Changed
Sidebar.logic.ts:getProjectSortTimestamp()usesproject.updatedAt ?? project.createdAtas the sort key when a project has no threads, so a freshly created project carries its creation timestamp into the sort comparison rather than-InfinitySidebar.logic.test.ts: Added the cross-scenario test that was missing — new project (no threads,createdAt = T+10min) vs. older project with a recent user message (T+5min); asserts new project sorts firstTODO.md: Marked "New projects should go on top" completeWhy
updated_atsort derives its key from child thread user-message timestamps. A project with zero threads had no such timestamp, so it always fell below every project that had any thread activity at all. Using the project's owncreatedAtas a fallback makes the sort semantically consistent: a just-created project is treated as recently active until it accumulates thread history.UI Changes
N/A
Checklist