mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-30 19:09:28 +00:00
Merge pull request #72965 from NousResearch/bb/resume-freetext-search
fix(desktop): keep /resume's free-text search typeable
This commit is contained in:
commit
9f02bb207d
2 changed files with 21 additions and 1 deletions
|
|
@ -172,6 +172,20 @@ describe('useComposerTrigger — free-text slash arguments', () => {
|
|||
expect(hook.result.current.triggerActiveExplicit).toBe(false)
|
||||
})
|
||||
|
||||
it('keeps a multi-word /resume search typeable instead of firing the picker action', () => {
|
||||
// The session list always ends in a "Browse all sessions…" action row, so
|
||||
// an accept here doesn't insert a chip — it empties the composer and opens
|
||||
// the overlay, taking the half-typed query with it.
|
||||
const editor = mountEditor('/resume my new')
|
||||
const { hook } = mountTrigger(editor, [item('/resume', 'Sessions')])
|
||||
|
||||
act(() => hook.result.current.refreshTrigger())
|
||||
|
||||
expect(hook.result.current.slashFreeTextArgStage).toBe(true)
|
||||
expect(hook.result.current.commitTypedSlashDirective()).toBe(false)
|
||||
expect(composerPlainText(editor)).toBe('/resume my new')
|
||||
})
|
||||
|
||||
it('still commits a fully typed finite option as one directive chip', () => {
|
||||
const editor = mountEditor('/personality creative')
|
||||
const { hook } = mountTrigger(editor, [])
|
||||
|
|
|
|||
|
|
@ -188,7 +188,13 @@ const DESKTOP_COMMAND_SPECS: readonly DesktopCommandSpec[] = [
|
|||
description: 'Resume a saved session',
|
||||
aliases: ['/sessions', '/switch'],
|
||||
surface: picker('session'),
|
||||
argumentMode: 'options'
|
||||
// `mixed`, not `options`: the argument is a free-text search the picker
|
||||
// fuzzy-matches against titles and previews, so multi-word queries have to
|
||||
// stay typeable. Its completion list also always carries a trailing
|
||||
// "Browse all sessions…" action row, which meant Space-to-accept could
|
||||
// never fall through — the first space wiped the composer and threw the
|
||||
// user into the overlay.
|
||||
argumentMode: 'mixed'
|
||||
},
|
||||
|
||||
// Backend-executed commands that render useful inline output.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue