Add initial alpha value to preferences#284
Merged
Merged
Conversation
smikitky
requested changes
Jun 15, 2022
| personalInfoView?: boolean; | ||
| theme?: string; | ||
| referenceLine?: boolean; | ||
| alpha?: number; |
Member
There was a problem hiding this comment.
CS/DB 通じてのあらゆるユーザ設定を置く場所に alpha だけの設定名だと意味が伝わりません。initailAlphaForNewLabels くらい長い名称にしてください。
| ); | ||
| }; | ||
|
|
||
| const InitialAlphaEditor: et.Editor<number | undefined> = props => { |
Member
There was a problem hiding this comment.
valueから毎回計算すればいいだけなので state は不要です。その場で計算できるものを state にしないというのは鉄則です。仮に state が必須だとしてもnewなんちゃらというネーミングはおかしいです。- コンポーネントの名前を
AlphaEditorかAlphaValueEditorにしましょう。役割を考えると "initial" と特化した名前を付ける必要はありません。 - 可能ならいっそ
LabelledSliderEditorみたいな設定可能なものにして汎用性を高めましょう。et.text(options)とかと同じパターンです。
{
key: 'alpha',
caption: 'Alpha for new labels',
editor: laballedSlider({
min: 0,
max: 1,
step: 0.1,
label: value => `${Math.round(value * 100)}%`
})
}
Member
|
smikitky
approved these changes
Jun 16, 2022
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.
No description provided.