feat: 添加全局人设与头像设置并优化对话及弹窗交互

This commit is contained in:
2026-09-05 22:26:12 +08:00
parent 7551716e13
commit a1ab1024f0
18 changed files with 450 additions and 22 deletions
@@ -33,6 +33,18 @@ beforeEach(() => {
afterEach(() => { wrappers.splice(0).forEach(wrapper => wrapper.unmount()) })
describe('ProviderForm', () => {
it('uses a top-layer dialog and restores the underlying scroll container', async () => {
const host = document.createElement('div')
host.style.overflow = 'auto'
document.body.appendChild(host)
const wrapper = mount(ProviderForm, {attachTo:host})
await flushPromises()
expect(wrapper.get('dialog').element.open).toBe(true)
expect(host.style.overflow).toBe('hidden')
wrapper.unmount()
expect(host.style.overflow).toBe('auto')
host.remove()
})
it('saves model-scoped context settings and restores them on edit', async () => {
const policy = {model:'old-model',context_window:65536,output_reserve:8192,threshold:0.8,mode:'detect' as const,prompt:'保留已确认事实'}
const wrapper = await render({...existing,context_policies:[policy]})