docs: 既定の通知設定タブのスライダの丸めを設定リファレンスへ書く - #44
Merged
Merged
Conversation
opacity と volume は設定ウィンドウではスライダで編集する。刻みが 0.01 のため、 設定ファイルへ手で書いた細かい値はこの画面から保存すると丸まる。 設定ファイル側の記述しか読んでいない利用者は、値が変わる理由に辿り着けない。 丸めが編集として数えられ、開いて閉じるだけで未保存の警告が出る点も併記する。 警告だけを見ると誤動作に見えるが、丸めを知っていれば説明が付くためである。 rules 側は入力欄であり丸めを受けないので、その違いも書く。
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.
何をしたか
docs/configuration.mdのdefaults と rules節に、設定ウィンドウのスライダによる丸めの説明を足した。ドキュメントのみの変更である。なぜ
issue #36 で
defaultsのopacityとvolumeをスライダへ変えたが、設定リファレンスは値の範囲(0.0 から 1.0)しか書いていなかった。実装は
SLIDER_SCALE = 100で、保存時に(value * 100).round / 100を通す。つまり刻みは 0.01 である。設定ファイルへ手で0.755と書いてあっても、設定ウィンドウから保存すると0.76になる。さらに、開いた時点の丸めの差が未保存の変更として数えられるため、値を触っていなくても閉じるときに警告が出る。丸めを知らないと、この警告は誤動作にしか見えない。
設定ファイル側の記述しか読んでいない利用者が、この 2 つの挙動の理由に辿り着ける手掛かりが無かった。
書いた内容
rules側の上書きは入力欄(entry)であり、この丸めを受けないことrules側との違いは実装を読んで確かめた。丸めの対象はdefaultsのスライダ 2 項目だけである。確認
crystal tool format --check src spec:通過crystal spec:242 examples, 0 failuresGenerated by Claude Code