fix(tui): persist global details mode sections
Pin all detail sections when /details sets a global mode so config sync does not restore built-in section defaults.
This commit is contained in:
@@ -141,6 +141,12 @@ describe('createSlashHandler', () => {
|
||||
expect(createSlashHandler(ctx)('/details toggle')).toBe(true)
|
||||
expect(getUiState().detailsMode).toBe('expanded')
|
||||
expect(getUiState().detailsModeCommandOverride).toBe(true)
|
||||
expect(getUiState().sections).toEqual({
|
||||
thinking: 'expanded',
|
||||
tools: 'expanded',
|
||||
subagents: 'expanded',
|
||||
activity: 'expanded'
|
||||
})
|
||||
expect(ctx.gateway.rpc).toHaveBeenCalledWith('config.set', {
|
||||
key: 'details_mode',
|
||||
value: 'expanded'
|
||||
|
||||
@@ -266,7 +266,9 @@ export const coreCommands: SlashCommand[] = [
|
||||
return transcript.sys(DETAILS_USAGE)
|
||||
}
|
||||
|
||||
patchUiState({ detailsMode: next, detailsModeCommandOverride: true })
|
||||
const sections = Object.fromEntries(SECTION_NAMES.map(section => [section, next]))
|
||||
|
||||
patchUiState({ detailsMode: next, detailsModeCommandOverride: true, sections })
|
||||
gateway.rpc<ConfigSetResponse>('config.set', { key: 'details_mode', value: next }).catch(() => {})
|
||||
transcript.sys(`details: ${next}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user