GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(sidebar): misleading thread timestamp by jeheskielsunloy · Pull Request #1030 · pingdotgg/t3code

Conversation

@jeheskielsunloy

@jeheskielsunloy jeheskielsunloy commented Mar 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

What Changed

Updated sidebar thread recency to use the first message timestamp instead of the thread creation timestamp, with a fallback to thread.createdAt for empty threads. Applied the same derived timestamp to sidebar sorting and “most recent thread” selection so the displayed time and ordering stay consistent.

Why

thread.createdAt reflects when the thread container was created, not when the conversation actually began. In this app that can happen before any real message is sent, especially with draft or pre-created threads, which makes the sidebar timestamp misleading. Using the first message createdAt better matches user expectations of thread recency, while falling back to thread creation keeps empty threads stable and predictable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Fix sidebar thread recency to use first message time instead of thread creation time

Adds a getThreadSidebarTimestamp helper in Sidebar.tsx that returns the earliest message createdAt for a thread, falling back to thread.createdAt when no messages exist. Both thread sort order and the displayed relative timestamp now use this value instead of thread.createdAt directly.

Behavioral Change: threads will reorder in the sidebar based on their first message time, which may differ from thread creation time and will change the visible ordering for existing threads.

📊 Macroscope summarized 0b0dae3. 1 file reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jeheskielsunloy
fix(sidebar): use first message time for thread recency
0b0dae3
Sidebar thread timestamps were based on thread.createdAt, which measures when the thread shell was created rather than when the conversation actually started. In practice that made draft or pre-created threads look older or newer than the underlying conversation, and it caused the visible timestamp to communicate a different concept than users infer from the sidebar.

Use the first message createdAt as the sidebar timestamp source, with a fallback to thread.createdAt when a thread has no messages yet. Apply the same derived timestamp to thread ordering and recent-thread focus so the label and sort order stay aligned.

This keeps empty threads stable while making active threads reflect real conversation start time instead of internal object creation time.
Copilot AI review requested due to automatic review settings March 13, 2026 15:41
@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 05fb2ca7-216e-4e7f-90d3-387751b5ba90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list. labels Mar 13, 2026
Copilot started reviewing on behalf of jeheskielsunloy March 13, 2026 15:42
View session
Copilot AI reviewed Mar 13, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates sidebar thread ordering and display timestamps to use the first message's createdAt instead of the thread container's createdAt, better reflecting when the conversation actually started.

Changes:

  • Added getThreadSidebarTimestamp helper that finds the earliest message timestamp (falling back to thread.createdAt for empty threads)
  • Applied the new timestamp to both sorting locations and the displayed relative time in the sidebar

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/web/src/components/Sidebar.tsx
Comment on lines +107 to +124
function getThreadSidebarTimestamp(thread: Thread): string {
if (thread.messages.length === 0) {
return thread.createdAt;
}

let earliestTimestamp = thread.messages[0]?.createdAt ?? thread.createdAt;
let earliestTime = new Date(earliestTimestamp).getTime();

for (const message of thread.messages) {
const messageTime = new Date(message.createdAt).getTime();
if (messageTime < earliestTime) {
earliestTimestamp = message.createdAt;
earliestTime = messageTime;
}
}

return earliestTimestamp;
}
Comment thread apps/web/src/components/Sidebar.tsx
Comment on lines +108 to +123
if (thread.messages.length === 0) {
return thread.createdAt;
}

let earliestTimestamp = thread.messages[0]?.createdAt ?? thread.createdAt;
let earliestTime = new Date(earliestTimestamp).getTime();

for (const message of thread.messages) {
const messageTime = new Date(message.createdAt).getTime();
if (messageTime < earliestTime) {
earliestTimestamp = message.createdAt;
earliestTime = messageTime;
}
}

return earliestTimestamp;
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Mar 13, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b0dae3ade

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/web/src/components/Sidebar.tsx
Comment on lines +1321 to +1322
new Date(getThreadSidebarTimestamp(b)).getTime() -
new Date(getThreadSidebarTimestamp(a)).getTime();

@chatgpt-codex-connector chatgpt-codex-connector Bot Mar 13, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Precompute sidebar timestamps before sorting threads

The new comparator recomputes getThreadSidebarTimestamp for both operands on every comparison, and getThreadSidebarTimestamp scans the full thread.messages array each time. In projectThreads sorting this turns one render into roughly O(threadCount * log(threadCount) * messagesPerThread), which is a significant regression for projects with long histories and can make sidebar interactions noticeably sluggish under load; deriving each thread timestamp once before sorting avoids this repeated full scan.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
macroscopeapp[bot]
macroscopeapp Bot reviewed Mar 13, 2026
View reviewed changes
Comment thread apps/web/src/components/Sidebar.tsx

@macroscopeapp macroscopeapp Bot Mar 13, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low

Issue on line in apps/web/src/components/Sidebar.tsx:107:

getThreadSidebarTimestamp returns the earliest message timestamp, but the sidebar sorting logic expects the latest timestamp so that more recent activity appears first. This causes threads to sort incorrectly — for example, a thread with messages at [10:01, 10:05] returns 10:01 and appears older than a thread with a single message at 10:03. Change the comparison to find the maximum timestamp instead.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/components/Sidebar.tsx around line 107:

`getThreadSidebarTimestamp` returns the **earliest** message timestamp, but the sidebar sorting logic expects the **latest** timestamp so that more recent activity appears first. This causes threads to sort incorrectly — for example, a thread with messages at [10:01, 10:05] returns 10:01 and appears older than a thread with a single message at 10:03. Change the comparison to find the maximum timestamp instead.

Evidence trail:
apps/web/src/components/Sidebar.tsx lines 107-122: `getThreadSidebarTimestamp` function uses `messageTime < earliestTime` comparison to find minimum timestamp. apps/web/src/components/Sidebar.tsx lines 405-413: sorting uses `getThreadSidebarTimestamp(b) - getThreadSidebarTimestamp(a)` (descending order) and variable is named `latestThread`. apps/web/src/components/Sidebar.tsx lines 1317-1325: same sorting pattern. apps/web/src/components/Sidebar.tsx line 1576: timestamp displayed as relative time ('Xm ago') implying most recent activity.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jeheskielsunloy jeheskielsunloy changed the title fix(sidebar): use first message time for thread recency timestamp fix(sidebar): misleading thread timestamp Mar 14, 2026
@jamesx0416 jamesx0416 mentioned this pull request Mar 18, 2026
fix: don't just show the creation time for threads in sidebar #1136
Closed
4 tasks done
@maria-rcks maria-rcks closed this Apr 25, 2026
@Tevin2119 Tevin2119 mentioned this pull request Oct 4, 2026
#1030 Locate Kanban Icon Component Tevin2119/t3code#4
Merged
Tevin2119 added a commit to Tevin2119/t3code that referenced this pull request Oct 5, 2026
@Tevin2119
Merge pull request #4 from Tevin2119/delivery/1030-locate-kanban-icon…
f9d83e0
…-component-15ebfccf0b

pingdotgg#1030 Locate Kanban Icon Component
@Tevin2119 Tevin2119 mentioned this pull request Oct 7, 2026
merge: bring the board's deliveries into master Tevin2119/t3code#16
Merged
@shivamhwp shivamhwp mentioned this pull request Nov 10, 2026
fix(source-control): date Azure PRs by recent activity #31209
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jeheskielsunloy @maria-rcks
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.