Repository navigation
fix(composer): keep trigger menus within their width and rows intact while filtering - #1953
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
@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.Changes
autocomplete.go: the render and filter fixes above. The chat trigger defaults are set once inNewAutocomplete, replacing thetriggerTable/composerSourcesfallback that built a wholeDefaultComposerConfig()per keystroke when unset.config/composer.go:ValidateComposerTriggerschecks a trigger table on its own, andValidatecalls it before the linger check. The known contexts and sources live in one list each. The test-onlyComposerConfig.TriggerSourcesis 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 oneyamlMaphelper.contextrenamed toscopewriteTestHomeFilereplaced by the existingwriteHomeFileChatConfig's shape removed, since the compiler covers itconfiguration-reference.mdsays the home and projectcomposer.yamlmerge 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.INFER_GATEWAY_MOCK=truein an 80-column tmux pane:@lists the files, and@exploreshows the agent row among them, all within the width.