Skip to content

fix(composer): keep trigger menus within their width and rows intact while filtering - #1953

Merged
edenreich merged 1 commit into
mainfrom
fix/composer-review-followups
Nov 23, 2026
Merged

edenreich merged 1 commit into
mainfrom
fix/composer-review-followups

Conversation

@edenreich

Copy link
Copy Markdown
Contributor

Follow-up to #1948 from a review of the merged composer change.

Summary

Two display bugs in the composer trigger menus, plus cleanups the review found.

  • A menu that lists files pads the path column to the full width. The agent rows feat(composer): add composer.yaml with per-context triggers and the moved status bar settings #1948 added to the default chat @ menu then appended their description past it, so a row was 103 columns wide in an 80-column menu. Every user hits this, since built-in agents always exist. Menus that list files now render no description column.
  • The fuzzy filter rebuilt rows from the shortcut alone, so issue titles and agent descriptions disappeared after the first keystroke in a composed menu. It now keeps the original row and only adds the match offsets.

Changes

  • autocomplete.go: the render and filter fixes above. The chat trigger defaults are set once in NewAutocomplete, replacing the triggerTable/composerSources fallback that built a whole DefaultComposerConfig() per keystroke when unset.
  • config/composer.go: ValidateComposerTriggers checks a trigger table on its own, and Validate calls it before the linger check. The known contexts and sources live in one list each. The test-only ComposerConfig.TriggerSources is removed.
  • cmd/runtime/config.go: the pre-merge hook decodes the table with mapstructure. A malformed table now names its key ('[chat][^]' source data must be an array or slice, got string) instead of a line number from a re-marshaled document that pointed at the wrong line.
  • cmd/config/getset.go: the three YAML-to-map round-trips share one yamlMap helper.
  • Smaller cleanups:
    • variables named context renamed to scope
    • the duplicate writeTestHomeFile replaced by the existing writeHomeFile
    • a reflection test of ChatConfig's shape removed, since the compiler covers it
    • stale doc comments fixed
  • Docs: configuration-reference.md says the home and project composer.yaml merge per trigger, so a project file cannot remove a trigger the home file sets.

Tests

  • TestTriggerMenuFitsItsWidth: every row of the default @ menu fits an 80-column width. It failed before the fix with a 103-column row.
  • TestComposedMenuKeepsDescriptionsWhileFiltering: a filtered ^ menu of agents and issues still shows the agent description. It failed before the fix.
  • Checked by hand in the chat TUI with INFER_GATEWAY_MOCK=true in an 80-column tmux pane: @ lists the files, and @explore shows the agent row among them, all within the width.

…while filtering

A menu that lists files pads the path column to the full width, so agent rows
appended after the files overflowed it with their description (103 columns in
an 80-column menu). Such menus now render no description column. The fuzzy
filter rebuilt rows from the shortcut alone, so issue titles and agent
descriptions vanished after the first keystroke. It now keeps the original row.

Cleanups from the review of the composer change:

- ValidateComposerTriggers checks a trigger table on its own, so the
  pre-merge hook no longer builds a fake ComposerConfig to reach it
- the known contexts and sources live in one list each, used by the checks
  and the error messages
- the pre-merge hook decodes with mapstructure, so a malformed table names
  its key instead of a line number of a re-marshaled document
- ComposerConfig.TriggerSources (test-only) and the autocomplete's
  triggerTable/composerSources fallback are gone, the defaults are set once
  in NewAutocomplete
- config get builds its maps through one yamlMap helper
- variables no longer shadow the context package, a duplicate test helper and
  a struct-shape reflection test are removed, and stale doc comments are fixed
- the docs say the home and project composer.yaml merge per trigger
@edenreich
edenreich requested a review from a team as a code owner November 23, 2026 18:03
@github-project-automation github-project-automation Bot moved this to Todo in 2026 Nov 23, 2026
@edenreich
edenreich merged commit 55bbdb6 into main Nov 23, 2026
14 checks passed
@edenreich
edenreich deleted the fix/composer-review-followups branch November 23, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant