You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow localized color picker validation messages - #60
Add ColorPickerLabels.InvalidColor so applications can pass a localized message through PanelLabels. The picker continues to show Invalid color when the caller leaves the field empty.
Why
The color picker already accepts translated labels and button text. Its invalid HEX message came from a fixed English string in the UI painter.
How it was verified
All tracked Go files pass gofmt -l.
go vet ./... on Windows amd64.
go test ./ui ./base ./components -count=1 -timeout=60s -run 'ColorPicker|OpenAlphaColorPicker'.
go test ./... -count=1 -timeout=120s on Windows amd64. The UI and component packages passed. The full run reported a packaging test timeout and failures in the packaging and documentation tools.
Visual evidence
Open a picker with PanelLabels(ColorPickerLabels{InvalidColor: "无效的十六进制颜色"}) and type an invalid HEX value. The panel displays the supplied message and leaves the staged color unapplied.
The downstream Windows amd64 headless regression TestEditorRainbowPaletteShowsLocalizedInvalidHex covers the Chinese message and verifies that Enter leaves the color unchanged.
Where the boundary sits
Viva owns the validation and renders the message through its existing error field. Applications supply the text for their locale.
Cost
The existing invalid-input branch reads the optional label and uses the default when it is empty. The focused suite includes the warm picker allocation checks.
Review follow-up
Added TestColorPickerInvalidHexUsesPanelLabel: invalid HEX paints the supplied Chinese label; an empty label retains Invalid color. Both cases keep the panel open, preserve the color and never mark it applied.
The custom-label case fails with the original painter and passes with this implementation.
go test -tags vivahead ./ui -run '^TestColorPicker' -count=1 -timeout=90s and the same focused suite with -race passed on Windows amd64.
Current fork CI status: the two workflows for d8c0a63 require maintainer approval (action_required). The API approval attempt returned HTTP 403 (Must have admin rights to Repository); no workflow restriction was bypassed. Local ColorPicker tests and race results above remain valid.
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
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.
What this changes
Add
ColorPickerLabels.InvalidColorso applications can pass a localized message throughPanelLabels. The picker continues to showInvalid colorwhen the caller leaves the field empty.Why
The color picker already accepts translated labels and button text. Its invalid HEX message came from a fixed English string in the UI painter.
How it was verified
gofmt -l.go vet ./...on Windows amd64.go test ./ui ./base ./components -count=1 -timeout=60s -run 'ColorPicker|OpenAlphaColorPicker'.go test ./... -count=1 -timeout=120son Windows amd64. The UI and component packages passed. The full run reported a packaging test timeout and failures in the packaging and documentation tools.Visual evidence
PanelLabels(ColorPickerLabels{InvalidColor: "无效的十六进制颜色"})and type an invalid HEX value. The panel displays the supplied message and leaves the staged color unapplied.TestEditorRainbowPaletteShowsLocalizedInvalidHexcovers the Chinese message and verifies that Enter leaves the color unchanged.Where the boundary sits
Viva owns the validation and renders the message through its existing error field. Applications supply the text for their locale.
Cost
The existing invalid-input branch reads the optional label and uses the default when it is empty. The focused suite includes the warm picker allocation checks.
Review follow-up
TestColorPickerInvalidHexUsesPanelLabel: invalid HEX paints the supplied Chinese label; an empty label retainsInvalid color. Both cases keep the panel open, preserve the color and never mark it applied.go test -tags vivahead ./ui -run '^TestColorPicker' -count=1 -timeout=90sand the same focused suite with-racepassed on Windows amd64.Current fork CI status: the two workflows for
d8c0a63require maintainer approval (action_required). The API approval attempt returned HTTP 403 (Must have admin rights to Repository); no workflow restriction was bypassed. Local ColorPicker tests and race results above remain valid.上游范围更正:原 vivaui#457 错误包含 fork 历史,已关闭。替代 PR vivaui#458 从上游 main 创建,仅 1 个提交、3 个文件(+41/-1),只含 InvalidColor 文案修复和回归测试。fork #60 的分支与内容保留。