Repository navigation
v2 - #9
Merged
Merged
v2#9
Conversation
position completion would incorrectly show while entering flag value after typing a space
splitting position args and flags function would add the same invalid flag mulitple times to the slice
…and reduce duplication in validation logic
…vertical scrollbar, type icons, description dimming
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR is a major “v2” refactor of the bubblecomplete component, updating the module/dependencies to the Charm v2 ecosystem, expanding filesystem/path completion support, and formalizing validation and configuration surfaces for host applications.
Changes:
- Introduces structured validation errors (
ValidationErrorKind/ValidationError) while preserving legacy error strings, and improves flag/path validation behavior. - Adds/expands filesystem completion infrastructure (path parsing/resolution + directory caching) plus richer rendering (match highlighting, scrollbar rendering, path-validity overlay).
- Modernizes public configuration and integration: new
Optionconstructors, structuredStyles/KeyMap, and Bubble Tea v2tea.Viewintegration.
Reviewed changes
Copilot reviewed 38 out of 42 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| validation.go | Refactors validation flow, flag parsing, path validation, and error construction. |
| validation_errors.go | Adds typed validation errors with kind/token/argument metadata. |
| validation_test.go | Replaces the old quote test with extensive validation coverage and kind inspection. |
| test_data_test.go | Adds shared TestCommands fixture for tests/fuzzers. |
| parse.go | Adds tokenizer producing tokens with byte offsets and quote metadata. |
| parse_test.go | Adds tokenize behavior tests, including invalid UTF-8 offset invariants. |
| fuzz_test.go | Adds fuzz targets for tokenize/validate/completions/render and path helpers. |
| pathresolve.go | Adds quote stripping + pure path resolution (tilde, separators, parent/base/prefix). |
| pathresolve_test.go | Adds unit tests and invariants for resolvePath/stripQuotes. |
| pathcache.go | Adds LRU+TTL cache for os.ReadDir results to amortize filesystem completion costs. |
| pathcache_test.go | Adds cache tests (TTL, LRU, concurrency). |
| render.go | Overhauls rendering: View() tea.View, Render() string, completion row model, truncation, match highlight ranges, scrollbar rendering, and path overlay. |
| styles.go | Moves to lipgloss v2 + introduces structured Styles with DefaultStyles(). |
| options.go | Adds functional options (With*) for construction-time configuration. |
| keys.go | Adds structured key bindings (KeyMap) using bubbles v2 key.Binding. |
| history.go | Reworks persistent history (atomic save, size cap, clear/reset behavior, better error surfacing). |
| history_test.go | Adds comprehensive tests for history persistence, limits, atomic writes, and error behavior. |
| model_test.go | Adds validation tests for Command, Flag, and PositionalArgument shapes. |
| README.md | Rewrites documentation: features, v2 usage, filesystem completion semantics, config. |
| doc.go | Adds package-level documentation and usage overview. |
| CLAUDE.md | Adds contributor notes on repo layout + Bubble Tea gotchas. |
| bubblecomplete.go | Updates update loop, key handling, completion state management, and history/validation integration for v2 APIs. |
| example/main.go | Updates example to Bubble Tea v2, new options, new rendering API, improved profiling flow. |
| example/commands.go | Moves example command definitions into a dedicated file. |
| example.tape | Updates VHS tape script to match new example flow and features. |
| .github/workflows/ci.yml | Adds CI (fmt/vet/build/test/race), lint, and govulncheck jobs. |
| .golangci.yml | Adds golangci-lint v2 config with targeted linter set and exclusions. |
| .gitignore | Ignores docs/ and common agent scratch dirs. |
| go.mod | Renames module path, updates to Charm v2 dependencies, updates Go version directive. |
| go.sum | Updates dependency checksums accordingly. |
| example/go.mod | Removes nested example module (example becomes a subpackage). |
| example/go.sum | Removes nested example sums. |
| testdata/fuzz/FuzzTokenize/c744251721e30157 | Adds fuzz seed corpus entry. |
Comments suppressed due to low confidence (1)
validation_test.go:68
- Typo in test case name: "valind" → "valid". Accurate test names make failures easier to triage.
💡 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.
No description provided.