Skip to content

fix: save the values typed into the add/edit project form - #61

Merged
Skeyelab merged 1 commit into
mainfrom
fix/manage-form-saves-blank
Sep 25, 2026
Merged

Skeyelab merged 1 commit into
mainfrom
fix/manage-form-saves-blank

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

Adding a project from the manage screen (a) saved a blank [[projects]] entry, and editing one (e) kept the old values.

Cause: buildForm has a value receiver, so Value(&m.fName) bound the huh inputs to a copy of Manage. updateForm read its own copy, which was still empty.

Fix: the three form fields live in a manageFields struct held by pointer, shared by every copy of Manage.

Tests: internal/ui/manage_test.go drives the screen through Update (typing into the form, pressing enter):

  • adding a project saves the entered name, account and pipeline, including after reloading the file
  • editing a project saves the change and keeps its stacks

Both fail on the old code and pass with the fix. go test ./... and golangci-lint pass.

🤖 Generated with Claude Code

buildForm has a value receiver, so the huh inputs bound to fields on a
throwaway copy of Manage. updateForm then read its own copy, which was still
empty: adding a project saved a blank [[projects]] entry, and editing one
silently kept the old values. The form fields now live behind a pointer that
every copy of Manage shares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Skeyelab
Skeyelab enabled auto-merge (squash) September 25, 2026 16:24
@Skeyelab
Skeyelab merged commit 011dff8 into main Sep 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant