Repository navigation
Test fixes - #7
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR delivers a set of UX, correctness, and documentation fixes on top of the filesystem-completion work, primarily improving flag-value state detection, completion-list rendering robustness, and end-user docs.
Changes:
- Fixes flag-value mode detection by refining token “Closed” semantics and gating
isEnteringFlagValueon “trailing space + last token closed”. - Improves rendering correctness/UX: ANSI-aware truncation of long completion names, cell-based match highlighting for wide runes, and a render-only “truncation footer” when filesystem candidates are dropped.
- Documentation + comment cleanup: README overhaul and removal of restate-the-code commentary; small API cleanup (dead
kindOfcases,containsPowerShellFlagsimplification, accessor receiver consistency).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| validation.go | Minor comment clarity change in command validation flow. |
| styles.go | Removes palette narrative comments; no functional change. |
| render.go | Adds truncation footer rendering, ANSI-aware name truncation, and cell-based match-range highlighting (wide-rune safe). |
| render_test.go | Adds targeted tests for truncation, ANSI preservation, wide-rune highlighting, and footer wording. |
| README.md | Condenses and reorganizes documentation; adds clearer “defining commands”, filesystem completions, and configuration sections. |
| pathcomplete.go | Tracks dropped candidate counts (droppedSorted, unresolvedEntries) and returns them from candidate generation. |
| pathcomplete_test.go | Updates tests for new generateCandidates signature and adds drop-count assertions. |
| path_integration_test.go | Adds end-to-end render tests ensuring footer appears correctly and is not a selectable completion row. |
| parse.go | Refines token.Closed semantics to account for unclosed inner quotes at flush time. |
| parse_test.go | Adds regression test for “unclosed inner quote leaves token open”. |
| model.go | Improves exported-field godoc phrasing; removes redundant internal comments. |
| completions.go | Comment cleanup and clarifies some intent in helper logic (no functional changes). |
| completions_test.go | Adds regression coverage for trailing-space behavior after closed flag values and unclosed-quote variants. |
| bubblecomplete.go | Comment cleanup and changes ShowingCompletions to a value receiver for accessor consistency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Manual-testing fixes, a render-side QoL pass, and a documentation polish round on top of the filesystem-completion work that landed in beta.
Fixes
git commit -m 'my message'kept showing-m --messageinstead of cycling to remaining flags. Two-layer fix:parse.gonow reports a token asClosedwhen no inner quote is open at flush time, andisEnteringFlagValuegates on(trailing space) && (last token closed)so the same logic covers-m 'msg',-m "msg",--message=value, etc. (0658469)…, preserving any match-highlight prefix. (ee08cba)findMatchRangenow returns cell positions solipgloss.NewRangehighlights the right columns on wide-rune names (e.g.日本.txtwith prefix日). (ee08cba)Features
FilesystemCompletionLimit, a subtle+ N more — type to narrowline renders below the box. Verified drops (passed all filters, lost to sort+truncate) and unresolved drops (symlinks the stat budget skipped) are reported with separate wording so the strong "+ N more" claim only applies to verified results. Render-only — never added tom.completions, so Tab cycling cannot accept it. (1719eea)Documentation
…and morerow pointing to theModelgodoc. Stops re-documenting things that are already on pkg.go.dev. (fb572d6)Update,keyTab,getCompletions,splitPositionArgsAndFlags, etc. Trimmed bloated multi-line "why" blocks inkeyTabcycling. Upgraded thinModelfield godoc (// The maximum number of history items to store) into sentences that actually inform a pkg.go.dev reader. Genuine "why" comments retained throughout. (148bcf7)Cleanup
kindOfcases — value-formCommand/PositionalArgument/Flagand*pathCompletionare never inserted intom.completions. Switch now lists only the reachable types. (ad98f43)containsPowerShellFlag'slen == 2short-flag branch was unreachable (Flag.Validateenforces PsFlag bodies ≥ 2 runes). Reduced to a thin wrapper overcontainsLongFlag. (ad98f43)ShowingCompletionsflipped from pointer to value receiver to matchValue,Error,ValidationError,Styles,KeyMap. (ad98f43)