mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
fix(electron): default Windows close to background
Remove the one-time close prompt and remembered-choice path so Windows close behavior is always explicit and predictable. New installations now minimize to the system tray by default, while users can still choose to quit from settings.
This commit is contained in:
1 parent
35880228b7
commit
3db40375b6
15 files changed
+44
-215
No files matched your search
@@ -18,19 +18,20 @@ test('rejects unknown session landing tabs', () => {
|
||||
assert.throws(() => configSchema.parse({ ui: { default_session_tab: 'unknown' } }))
|
||||
})
|
||||
|
||||
test('defaults Windows close behavior to asking the user', () => {
|
||||
test('defaults Windows close behavior to running in the background', () => {
|
||||
const config = configSchema.parse({})
|
||||
|
||||
assert.equal(config.desktop.close_behavior, 'ask')
|
||||
assert.equal(config.desktop.close_behavior, 'background')
|
||||
})
|
||||
|
||||
test('accepts supported Windows close behaviors and rejects invalid values', () => {
|
||||
for (const closeBehavior of ['ask', 'background', 'quit']) {
|
||||
for (const closeBehavior of ['background', 'quit']) {
|
||||
assert.equal(
|
||||
configSchema.parse({ desktop: { close_behavior: closeBehavior } }).desktop.close_behavior,
|
||||
closeBehavior
|
||||
)
|
||||
}
|
||||
|
||||
assert.throws(() => configSchema.parse({ desktop: { close_behavior: 'ask' } }))
|
||||
assert.throws(() => configSchema.parse({ desktop: { close_behavior: 'hide-forever' } }))
|
||||
})
|
||||
@@ -47,7 +47,7 @@ export const cliConfigSchema = z.object({
|
||||
})
|
||||
|
||||
export const desktopConfigSchema = z.object({
|
||||
close_behavior: z.enum(['ask', 'background', 'quit']).default('ask'),
|
||||
close_behavior: z.enum(['background', 'quit']).default('background'),
|
||||
})
|
||||
|
||||
export const configSchema = z.object({
|
||||
|
||||
@@ -666,7 +666,7 @@ export interface UiConfig {
|
||||
summary_strategy?: 'brief' | 'standard'
|
||||
}
|
||||
|
||||
export type DesktopCloseBehavior = 'ask' | 'background' | 'quit'
|
||||
export type DesktopCloseBehavior = 'background' | 'quit'
|
||||
|
||||
// ==================== 匿名使用统计 ====================
|
||||
|
||||
|
||||
Reference in new issue
Block a user