mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-29 07:21:37 +08:00
feat(tui): per-section visibility for the details accordion
Adds optional per-section overrides on top of the existing global
details_mode (hidden | collapsed | expanded). Lets users keep the
accordion collapsed by default while auto-expanding tools, or hide the
activity panel entirely without touching thinking/tools/subagents.
Config (~/.hermes/config.yaml):
display:
details_mode: collapsed
sections:
thinking: expanded
tools: expanded
activity: hidden
Slash command:
/details show current global + overrides
/details [hidden|collapsed|expanded] set global mode (existing)
/details <section> <mode|reset> per-section override (new)
/details <section> reset clear override
Sections: thinking, tools, subagents, activity.
Implementation:
- ui-tui/src/types.ts SectionName + SectionVisibility
- ui-tui/src/domain/details.ts parseSectionMode / resolveSections /
sectionMode + SECTION_NAMES
- ui-tui/src/app/uiStore.ts +
app/interfaces.ts +
app/useConfigSync.ts sections threaded into UiState
- ui-tui/src/components/
thinking.tsx ToolTrail consults per-section mode for
hidden/expanded behaviour; expandAll
skips hidden sections; floating-alert
fallback respects activity:hidden
- ui-tui/src/components/
messageLine.tsx + appLayout.tsx pass sections through render tree
- ui-tui/src/app/slash/
commands/core.ts /details <section> <mode|reset> syntax
- tui_gateway/server.py config.set details_mode.<section>
writes to display.sections.<section>
(empty value clears the override)
- website/docs/user-guide/tui.md documented
Tests: 14 new (4 domain, 4 useConfigSync, 3 slash, 3 gateway).
Total: 269/269 vitest, all gateway tests pass.
This commit is contained in:
@@ -88,6 +88,41 @@ describe('createSlashHandler', () => {
|
||||
expect(ctx.transcript.sys).toHaveBeenCalledWith('details: expanded')
|
||||
})
|
||||
|
||||
it('sets a per-section override and persists it under details_mode.<section>', () => {
|
||||
const ctx = buildCtx()
|
||||
|
||||
expect(createSlashHandler(ctx)('/details activity hidden')).toBe(true)
|
||||
expect(getUiState().sections.activity).toBe('hidden')
|
||||
expect(ctx.gateway.rpc).toHaveBeenCalledWith('config.set', {
|
||||
key: 'details_mode.activity',
|
||||
value: 'hidden'
|
||||
})
|
||||
expect(ctx.transcript.sys).toHaveBeenCalledWith('details activity: hidden')
|
||||
})
|
||||
|
||||
it('clears a per-section override on /details <section> reset', () => {
|
||||
const ctx = buildCtx()
|
||||
createSlashHandler(ctx)('/details tools expanded')
|
||||
expect(getUiState().sections.tools).toBe('expanded')
|
||||
|
||||
createSlashHandler(ctx)('/details tools reset')
|
||||
expect(getUiState().sections.tools).toBeUndefined()
|
||||
expect(ctx.gateway.rpc).toHaveBeenLastCalledWith('config.set', {
|
||||
key: 'details_mode.tools',
|
||||
value: ''
|
||||
})
|
||||
expect(ctx.transcript.sys).toHaveBeenCalledWith('details tools: reset')
|
||||
})
|
||||
|
||||
it('rejects unknown section modes with a usage hint', () => {
|
||||
const ctx = buildCtx()
|
||||
createSlashHandler(ctx)('/details tools blink')
|
||||
expect(getUiState().sections.tools).toBeUndefined()
|
||||
expect(ctx.transcript.sys).toHaveBeenCalledWith(
|
||||
'usage: /details <section> [hidden|collapsed|expanded|reset]'
|
||||
)
|
||||
})
|
||||
|
||||
it('shows tool enable usage when names are missing', () => {
|
||||
const ctx = buildCtx()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user