GeezerVison is showing github.com — fix: use thread updatedAt for sidebar activity ordering by DommyMM · Pull Request #741 · pingdotgg/t3code
Conversation
DommyMM
commented
Mar 9, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What Changed
Sidebar thread activity now uses the thread's latest activity timestamp instead of its creation timestamp.
- sorts project threads by most recent activity using
updatedAt, with createdAt as a fallback
- displays the sidebar relative time from that resolved activity timestamp instead of always using
createdAt
- preserves
updatedAt during web store read-model sync
- adds tests for the activity timestamp helper, sidebar sorting, and store sync coverage
Why
The sidebar was showing thread age based on creation time, which produced misleading timestamps and ordering.
In practice this meant:
- a thread could show an old relative time even if the first message or latest activity happened much later
- project thread lists were ordered by creation time instead of recent activity
- Example reference from my issue Thread creation time bug #466 where it shows 20h ago on the thread even though the first message was sent at 4pm which was 10 minutes ago
Using updatedAt with a createdAt fallback keeps the sidebar behavior aligned with actual thread activity while remaining safe for incomplete data.
UI Changes
Before: sidebar thread timestamps and ordering reflected thread creation time
After: sidebar thread timestamps and ordering reflect latest known thread activity
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 ordering to use updatedAt instead of createdAt
- Adds
updatedAt to the Thread interface and maps it from the orchestration read model in syncServerReadModel.
- Introduces
resolveThreadActivityAt to return updatedAt when valid, falling back to createdAt, and compareThreadsByRecentActivity for deterministic sorting (falls back to id when timestamps are equal or invalid).
- Replaces ad-hoc
createdAt-based sorting in Sidebar.tsx with the new comparator, and updates relative time display and "focus most recent thread" to use the resolved activity timestamp.
- Behavioral Change: threads now sort by last activity rather than creation time, so recently updated threads appear at the top of the sidebar.
Macroscope summarized dbb1f7e.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- sort project threads by most recent activity using `updatedAt` fallback logic
- display sidebar relative time from resolved activity timestamp instead of `createdAt`
- persist `updatedAt` in web store sync and add tests for sorting/activity helpers
coderabbitai
Bot
commented
Mar 9, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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: 036d53c5-8444-4f4a-956a-15238f767ca8
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:
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.
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
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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 the web app’s sidebar “recent activity” ordering and timestamps to reflect the most recent thread activity (using updatedAt when available, with a createdAt fallback), aligning sidebar behavior with actual thread usage.
Changes:
- Add
Thread.updatedAt to the web thread type and preserve it during orchestration read-model sync.
- Sort threads (both per-project list and “focus most recent thread”) by resolved recent activity time instead of
createdAt.
- Display the sidebar relative-time label from the resolved activity timestamp and add targeted unit tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File |
Description |
| apps/web/src/types.ts |
Adds optional updatedAt to the Thread type for activity-based UI behavior. |
| apps/web/src/store.ts |
Persists updatedAt into the client thread state during read-model sync. |
| apps/web/src/store.test.ts |
Adds coverage to ensure updatedAt is preserved from the read model. |
| apps/web/src/components/Sidebar.tsx |
Uses a shared comparator for activity-based sorting and shows relative time from resolved activity timestamp. |
| apps/web/src/components/Sidebar.logic.ts |
Introduces helpers to resolve activity timestamp and compare threads by recent activity (with invalid-date handling). |
| apps/web/src/components/Sidebar.logic.test.ts |
Adds tests for the new activity timestamp resolver and comparator behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|