(detail: DetailState, commits: StreamCommit[])
| 398 | } |
| 399 | |
| 400 | function appendCommits(detail: DetailState, commits: StreamCommit[]) { |
| 401 | let changed = false |
| 402 | |
| 403 | for (const commit of commits.map(compactCommit)) { |
| 404 | const key = frameKey(commit) |
| 405 | const index = detail.frames.findIndex((item) => item.key === key) |
| 406 | if (index === -1) { |
| 407 | detail.frames.push({ |
| 408 | key, |
| 409 | commit, |
| 410 | }) |
| 411 | changed = true |
| 412 | continue |
| 413 | } |
| 414 | |
| 415 | const next = mergeLiveCommit(detail.frames[index].commit, commit) |
| 416 | if (sameCommit(detail.frames[index].commit, next)) { |
| 417 | continue |
| 418 | } |
| 419 | |
| 420 | detail.frames[index] = { |
| 421 | key, |
| 422 | commit: next, |
| 423 | } |
| 424 | changed = true |
| 425 | } |
| 426 | |
| 427 | if (changed) { |
| 428 | limitFrames(detail) |
| 429 | } |
| 430 | |
| 431 | return changed |
| 432 | } |
| 433 | |
| 434 | function ensureBlockerTab( |
| 435 | data: SubagentData, |
no test coverage detected