fix(app): use last user message time in sidebar#471
Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces the buildPawworkSidebarSessionRows utility function to centralize the logic for preparing session data for the sidebar. It refactors the Layout component to use this new function and includes corresponding unit tests. I have no feedback to provide.
|
Review follow-up handled:
Fresh checks after the follow-up: |
|
Latest review follow-up:
Latest CI status checked after |
Root cause: PawWork sidebar rows could display a latest user-message timestamp after PR #471, but the initial session window was still selected by session creation time. An old root session with recent real user input could stay outside the first sidebar page. What changed: - Added experimental.session.list sort=activity for global root sessions. - Defined activityAt as latest eligible real user message time, falling back to session creation time. - Added deterministic activity pagination with activityAt desc and session id asc. - Excluded assistant-only updates, session.time.updated, compaction messages, and synthetic-only user messages from activity promotion. - Preserved real user messages that also carry synthetic reminder parts. - Updated PawWork sidebar initial window and row timestamp/sort logic to use backend activity metadata, with local parts-aware freshness only when eligibility is known. - Regenerated v2 SDK types for sort=activity, activityAt, and lastUserMessageAt. - Split oversized sidebar source tests into focused files. Verification: - bun --cwd packages/sdk/js build - bun --cwd packages/opencode test --timeout 30000 ./test/server/global-session-activity-list.test.ts ./test/server/global-session-list.test.ts -> 21 pass - bun --cwd packages/app test --preload ./happydom.ts ./src/pages/layout/pawwork-sidebar-session-time.test.ts ./src/pages/layout/pawwork-sidebar-session-rows.test.ts ./src/pages/layout/pawwork-session-window.test.ts -> 927 pass - bun --cwd packages/opencode typecheck - bun --cwd packages/app typecheck - bun turbo typecheck -> 8 successful - git diff --check - desktop focused checks were also run and passed before merge. - GitHub checks were green at head 76740c9. Known follow-ups intentionally not included: - Pinned or active sessions outside the activity first page still need activity-aware by-id hydration to avoid cold-start fallback to creation time. - Large local histories may need EXPLAIN/query benchmarks and possibly a materialized activity field or index. - lastUserMessageAt is optional and may be omitted in the edge case where the real user message timestamp equals session creation time; activityAt remains correct. Closes #473
Summary
Why
The PawWork sidebar row builder in
layout.tsxwas still writingcreated: session.time.created, so a session could look stale after the user sent a new message. The existingpawworkSidebarSessionTimehelper already has the intended contract: use the latest valid loaded user message time, otherwise fall back to session creation time.Related Issue
Closes #470
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Please check that the
layout.tsxPawWork session window path now passes the per-session message cache into the shared helper without bootstrapping or pinning child stores, and that missing message caches still fall back to creation time.Risk Notes
Low. This changes the timestamp source for loaded sidebar rows only. No backend API, persistence schema, desktop packaging, updater, or generated-file changes are included. Sorting by time changes with the displayed timestamp, which is intended for this bug.
The global session window is still selected by the existing created-time API window; this PR intentionally fixes only timestamps for rows already in the PawWork sidebar window.
How To Verify
Screenshots or Recordings
Not captured. The Electron manual path was blocked by an existing local PawWork dev instance using the shared
ai.pawwork.desktop.devprofile. The code change is data wiring for existing sidebar UI, with no layout or copy changes.Checklist
dev, and my PR title and commit messages use Conventional Commits in English