[Superseded] ⚡ Bolt: session timeline O(N+M) aggregation - #358
Conversation
* 세션 타임라인 차트의 툴 요약을 계산할 때 발생하는 중첩 루프(O(N*M)) 병목을 해결함 * usageTimeline 인덱스와 toolCalls 배열을 모두 시간순으로 정렬한 뒤, 포인터를 사용해 단일 패스(O(N+M))로 매칭하도록 리팩터링함 * 원본 배열의 순서를 유지하기 위해 `.findIndex()`를 사용하지 않고 인덱스 맵을 활용함 * 불필요한 배열 생성을 줄여 긴 세션에서의 리렌더링 속도를 크게 향상시킴
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughWalkthrough세션 타임라인 차트가 도구 호출과 사용량 구간을 시간순으로 정렬하고 단일 포인터로 순회하도록 변경되었습니다. 도구 요약은 각 구간별로 집계되며, 차트 데이터는 원래 타임라인 순서로 생성됩니다. Changes세션 타임라인 도구 요약 최적화
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/web/src/components/dashboard/session-timeline-chart.tsx (1)
103-170: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win정렬·구간 경계·요약 결과를 검증하는 회귀 테스트를 추가하세요.
현재 테스트는 단일 시간순 입력의 렌더링만 확인하므로, 원래 순서 복원,
prev < tool <= current경계, 반복 도구 집계 및 상위 3개 축약이 깨져도 통과합니다. 비정렬 타임라인과 경계 시각의 도구 호출을 포함해 차트 데이터/툴팁 요약을 검증하세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/web/src/components/dashboard/session-timeline-chart.tsx` around lines 103 - 170, 차트 데이터 생성 로직에 대한 회귀 테스트를 추가하세요. 비정렬 usageTimeline 입력이 원래 순서로 복원되는지, 도구 호출이 prevTimestamp보다 크고 currentTimestamp 이하인 경우에만 해당 구간에 포함되는지, 동일 도구의 반복 호출이 집계되는지 검증하세요. 또한 도구 종류가 3개를 초과할 때 상위 3개와 “+N more” 요약이 차트 데이터 또는 툴팁에 정확히 표시되는지 확인하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/web/src/components/dashboard/session-timeline-chart.tsx`:
- Around line 103-170: 차트 데이터 생성 로직에 대한 회귀 테스트를 추가하세요. 비정렬 usageTimeline 입력이 원래
순서로 복원되는지, 도구 호출이 prevTimestamp보다 크고 currentTimestamp 이하인 경우에만 해당 구간에 포함되는지, 동일
도구의 반복 호출이 집계되는지 검증하세요. 또한 도구 종류가 3개를 초과할 때 상위 3개와 “+N more” 요약이 차트 데이터 또는 툴팁에
정확히 표시되는지 확인하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: de38b3fa-0bdd-4539-ab7f-9a854469e3aa
📒 Files selected for processing (1)
packages/web/src/components/dashboard/session-timeline-chart.tsx
|
Closing as superseded by merged PR #271. #271 already replaced the same SessionTimelineChart repeated tool-event filtering with a sorted local snapshot plus single forward cursor, while preserving original input order and adding stronger cumulative-summary, ordering, bounded-display, and mutation regressions with APA 7 doctoring. This one-file stale-base branch has no distinct remaining capability, so it must not remain a competing merge path. Historical evidence is not reused. |
Understood. Acknowledging that this work is now obsolete as it has been superseded by merged PR #271, and stopping work on this task. |
Superseded
Closed without merge because the current
developmentalline already contains the durable version of this performance objective. At protected-base snapshot4f8796ec8c3a8d130136029650705714724cb0ac,SessionTimelineChartalready uses a dedicatedbuildChartData()path that sorts local usage/tool copies and advances a single forward tool cursor, eliminating the former per-usage fulltoolCalls.filter()scan. The current base also has beginner-readable contracts around the helper.This PR is based on stale
developmentalsnapshot9ef092b9979d46b96063701e706521d21407d6a9and head911dc1970ba3d9b30f539e670f72dabe1c31d980; GitHub reports it non-mergeable. Keeping it open would preserve a competing implementation path for behavior that is already present upstream. No checks, reviews, or approvals from this stale head are transferred to current development.Incremental work that remains useful beyond the already-integrated O(N+M) algorithm must be proposed against the live
developmentalhead as a focused diff and establish its own exact-head evidence.