fix(web): allow clearing the full name in profile settings (#40186)

Clearing "Full Name" in the profile settings shows success but keeps the
old value: since #31959 it is only updated when non-empty, because the
input is disabled (not submitted) when `change_full_name` is disabled.

Use `*string` for the field, so a missing field keeps the value and an
empty one clears it. With `change_full_name` disabled, any submitted
value (including empty) is now rejected. Not `optional.Option[string]`,
because `MaxSize` would count slice elements instead of characters.

Fixes #40185

---
AI disclosure: written with Claude Code (claude-opus-5-5) and tested
locally.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
authored and GitHub committed 2026-11-04 01:42:41 +00:00
1 parent 4d00ed2a1e
commit 666e6e2d17
10 files changed
+206 -193

No files matched your search

+2
View File
@@ -11,6 +11,8 @@ import "strconv"
// * non-existing value are represented as an empty slice (None)
// * existing value is represented as a slice with one element (Some)
// * multiple values are represented as a slice with multiple elements (Some), the Value is the first element (not well-defined in this case)
//
// Attention: Option[T] doesn't work with some web middleware binding rules like "MaxSize" at the moment.
type Option[T any] []T
func None[T any]() Option[T] {