Repository navigation
feat: make Field.RunAccessible public, deprecate Field.WithAccessible - #667
Merged
Merged
Conversation
This way we can remove make the public interface Field implementable by 3rd parties again. closes #663
caarlos0
requested review from
Copilot,
meowgorithm and
raphamorim
and removed request for
a team and
raphamorim
July 9, 2025 15:22
There was a problem hiding this comment.
Pull Request Overview
This PR makes the RunAccessible method part of the public Field interface, deprecates the old WithAccessible flag, and updates all field implementations and tests to use the new method.
- Exported
runAccessibleasRunAccessibleinFieldand all concrete types, and markedWithAccessibleas deprecated. - Updated internal calls and tests to invoke
RunAccessible. - Simplified manual width calculation in
Confirm.View()to use amaxhelper.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| huh_test.go | Updated tests to call RunAccessible instead of runAccessible. |
| form.go | Exported RunAccessible in Field interface; deprecated WithAccessible. |
| field_text.go | Renamed runAccessible to RunAccessible; added deprecation notes. |
| field_select.go | Same renaming and deprecation updates for select fields. |
| field_note.go | Same renaming and deprecation updates for note fields. |
| field_multiselect.go | Same renaming and deprecation updates for multiselect fields. |
| field_input.go | Same renaming and deprecation updates for input fields. |
| field_filepicker.go | Same renaming and deprecation updates for file picker. |
| field_confirm.go | Same renaming and deprecation updates for confirm; replaced inline max logic. |
Comments suppressed due to low confidence (1)
field_confirm.go:288
- The helper function
maxis not part of Go's standard library and isn't defined in this file, leading to a compile error. Either restore the inline comparison or add amaxhelper implementation.
renderWidth := max(buttonsWidth, promptWidth)
|
@caarlos0 ask me to look at his changes. They look good to me but I'm not sure about the process (should I do the review and approve it? is this done by someone else?) |
Contributor
Author
if you feel like it, go for it :) |
andreynering
approved these changes
Jul 10, 2025
jonas-grgt
pushed a commit
to jonas-grgt/huh
that referenced
this pull request
Nov 12, 2025
…harmbracelet#667) * feat: make Field.RunAccessible public, deprecate Field.WithAccessible This way we can remove make the public interface Field implementable by 3rd parties again. closes charmbracelet#663 * fix: lint issue
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.
This way we can remove make the public interface Field implementable by 3rd parties again.
closes #663