fix(ui): stabilize workplace chat scrolling
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import type { Session } from '../types/kanban'
|
||||
import { composerExecModeForSession } from './ContextPanel'
|
||||
import {
|
||||
composerExecModeForSession,
|
||||
conversationHasOlderHistory,
|
||||
sessionHasMoreForDetail,
|
||||
} from './ContextPanel'
|
||||
|
||||
function makeSession(overrides: Partial<Session> = {}): Session {
|
||||
return {
|
||||
@@ -49,4 +53,44 @@ assert.equal(
|
||||
'org',
|
||||
)
|
||||
|
||||
const independentlyPaged = makeSession({
|
||||
hasMore: false,
|
||||
summaryHasMore: false,
|
||||
fullHasMore: true,
|
||||
messageCount: 400,
|
||||
})
|
||||
assert.equal(sessionHasMoreForDetail(independentlyPaged, 'summary'), false)
|
||||
assert.equal(sessionHasMoreForDetail(independentlyPaged, 'full'), true)
|
||||
assert.equal(
|
||||
conversationHasOlderHistory([independentlyPaged], 200, 'summary'),
|
||||
false,
|
||||
'a full-detail ACK must not reopen summary history',
|
||||
)
|
||||
assert.equal(
|
||||
conversationHasOlderHistory([independentlyPaged], 200, 'full'),
|
||||
true,
|
||||
'full history must retain its own cursor state',
|
||||
)
|
||||
assert.equal(
|
||||
conversationHasOlderHistory([independentlyPaged], 200, 'full', false),
|
||||
true,
|
||||
'a known scoped cursor remains loadable while a company turn is running',
|
||||
)
|
||||
|
||||
const summaryOnlyState = makeSession({
|
||||
hasMore: false,
|
||||
summaryHasMore: true,
|
||||
messageCount: 400,
|
||||
})
|
||||
assert.equal(
|
||||
sessionHasMoreForDetail(summaryOnlyState, 'full'),
|
||||
undefined,
|
||||
'generic hasMore is no longer authoritative after a scoped policy is known',
|
||||
)
|
||||
assert.equal(
|
||||
conversationHasOlderHistory([makeSession({ messageCount: 400 })], 200, 'summary', false),
|
||||
false,
|
||||
'only the racy message-count fallback is suppressed during active generation',
|
||||
)
|
||||
|
||||
console.log('ContextPanel composer identity checks passed')
|
||||
|
||||
Reference in New Issue
Block a user