feat(tui): add config key support to provider create/update forms#2224
feat(tui): add config key support to provider create/update forms#2224letv1nnn wants to merge 12 commits into
Conversation
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
|
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
|
I had gpt-5.6-sol medium review this, and here's what it found: I found two blocking functional issues and two additional edge cases. Required changes
Ctrl+D removes the entry from the local IndexMap, but the update request simply omits that entry. The server treats config as a merge patch: omitted keys remain unchanged, and deletion requires sending the key with an empty value. Please track deleted entries and send them as key: "". This should also allow deleting the final config entry, which the current submit validation prevents.
When there are more than six config entries, the renderer shows the first five plus an overflow summary. However, the cursor can traverse the entire map. Once it moves beyond the visible entries, Ctrl+D can delete an entry the user cannot see. Please render a cursor-relative window so the selected entry always remains visible. Additional concerns
Validation requestedPlease add state-machine or request-construction tests covering:
|
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
… window Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
|
Hey @krishicks, all four issues fixed, all five tests added. Thanks for the thorough review! |
|
/ok to test 86ab2eb |
@krishicks, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test 69aa1a8 |
|
I built this locally and tried using it. I found two issues, confirmed by
Additionally,
I could not test this because I could not delete an entry through the TUI.
I confirmed this behavior exists on create, not on update.
I confirmed this by adding 7 entries and seeing no indication of the 7th entry in the list. It should say "and 1 more" or similar. |
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
|
thanks, fixed described bugs. |
|
/ok to test 41f6b2d |
|
When editing a provider after adding keys, you can now delete entries, but the cursor appears active in two places: an existing key=value pair, but also in the Key: portion of the form below, which has an underscore instead of the 'key' placeholder. Instead, only the existing key=value pair should be highlighted. This was confirmed by Existing config selection and new-key input share the same focus state. When UpdateProviderField::ConfigKey is active, the renderer both:
That same state handles Up/Down and Ctrl+D for existing entries, but also accepts text for a new key (crates/openshell-tui/src/ app.rs:2675). Consequently, the UI communicates two simultaneous focus targets. The clean fix is to add a distinct ConfigEntry or ConfigList focus state:
The Create form uses the same combined interaction pattern, so it should receive the equivalent focus state as well.
Partially entered config is still silently discarded. Both submit handlers call flush_config_input but ignore failure |
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
|
fixed both issues. |
|
/ok to test 91894db |
|
On create, after submitting a key=value pair I can immediately shift-tab and delete it, but the same flow does not work on update. I add a key=value pair, save the provider, then go back to update the provider and enter a new key=value pair. The second pair cannot be deleted, only the previously-saved one. |
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
|
done, shift+tab now lands on the newly added entry |
Summary
Add config key (
configmap) support to the TUI's Create Provider and Update Provider forms.Previously, both forms only handled credentials and hardcoded
config: HashMap::default(), making it impossible to set provider config keys likeANTHROPIC_BASE_URLorOPENAI_BASE_URLviaopenshell term. The CLI's--config KEY=VALUEflag worked correctly, only the TUI surface was affected.Related Issue
#1798
Changes
value fields, auto-commit on Tab, and Ctrl+D to delete entries
on form open, preserving config that the user doesn't modify
spawn_create_providerandspawn_update_providernow plumb the form's config mapinto the gRPC request instead of sending empty maps
Testing
mise run pre-commitpassesChecklist
Screenshots
You can run
cargo run -p openshell-cli -- termto try it out yourself.Provider Details now lists config keys:
Updating Provider Details