✨ feat(vscode): 重写注释排成一队,整个扩展一次只跑一段
OpenPencil 同一时间只能开一个画板,两段同时画会互相掐断。所有预览、所有文件的重写(第一轮和接着说)排成一队,前一段写成、出错、被叫停后按先后自动开始下一段;问 AI 照旧最多同时 3 个。 排着的那一轮记在扩展端(rewriteCurrent 的 queued),块下面写「排队中」、能取消排队,切标签页、页面重新加载后照样显示。
This commit is contained in:
1 parent
b7c29c60e1
commit
aecc4d1ab5
15 files changed
+329
-114
No files matched your search
@@ -130,6 +130,25 @@ describe('重写注释的状态:和问 AI 同一套', () => {
|
||||
state = chatReducer(state, { type: 'answer', askId: 'r1', question: SKILL, text: '' })
|
||||
expect(asksOf(state, IF)[0]).toMatchObject({ question: SKILL, status: 'running' })
|
||||
})
|
||||
|
||||
it('扩展端说排着队就显示排队中,轮到了变成在写;收起这块时排着的和在写的一样留着;取消了照停下记', () => {
|
||||
let state = chatReducer(EMPTY_CHAT, { type: 'ask', askId: 'r1', anchor: IF, question: '', images: [] })
|
||||
state = chatReducer(state, { type: 'answer', askId: 'r1', question: SKILL, text: '', queued: true })
|
||||
expect(asksOf(state, IF)).toEqual([{ askId: 'r1', anchor: IF, question: SKILL, images: [], text: '', status: 'queued' }])
|
||||
state = chatReducer(state, { type: 'close', anchor: IF })
|
||||
expect(asksOf(state, IF).map(ask => ask.status)).toEqual(['queued'])
|
||||
state = chatReducer(state, { type: 'answer', askId: 'r1', question: SKILL, text: '' })
|
||||
expect(asksOf(state, IF)[0].status).toBe('running')
|
||||
state = chatReducer(state, { type: 'answerEnd', end: { askId: 'r1', status: 'stopped' } })
|
||||
expect(asksOf(state, IF)[0].status).toBe('stopped')
|
||||
expect(chatReducer(state, { type: 'answer', askId: 'r1', text: '晚到的', queued: true })).toEqual(state)
|
||||
})
|
||||
|
||||
it('页面重新加载后:扩展端排着队的那一轮照样显示排队中、展开它那块', () => {
|
||||
const state = chatReducer(EMPTY_CHAT, { type: 'sync', available: true, threads: [], current: [{ askId: 'r2', anchor: IF, question: SKILL, text: '', status: 'queued' }] })
|
||||
expect(state.open).toEqual([IF])
|
||||
expect(asksOf(state, IF)).toEqual([{ askId: 'r2', anchor: IF, question: SKILL, text: '', status: 'queued' }])
|
||||
})
|
||||
})
|
||||
|
||||
describe('问的时间', () => {
|
||||
|
||||
Reference in new issue
Block a user