Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 疑問文自動調整設定機能追加 #610

Merged
merged 7 commits into from
Dec 28, 2021

Conversation

qwerty2501
Copy link
Contributor

@qwerty2501 qwerty2501 commented Dec 19, 2021

内容

Engineに疑問文自動調整機能が追加されたので、front側でその有効無効を調整できるようにする

関連 Issue

refs #608

スクリーンショット・動画など

interrogative-evidence

その他

@qwerty2501 qwerty2501 force-pushed the feature/interrogative branch from 169939f to f9d57f3 Compare December 19, 2021 18:10
@qwerty2501 qwerty2501 marked this pull request as ready for review December 19, 2021 18:13
@qwerty2501 qwerty2501 marked this pull request as draft December 19, 2021 18:14
@qwerty2501
Copy link
Contributor Author

qwerty2501 commented Dec 19, 2021

openapiのコード生成について、以前生成したときから定義が変わっていないところについても生成されたコードが変わってるようなのでちょっと気になります

qwerty2501 added a commit to qwerty2501/voicevox that referenced this pull request Dec 20, 2021
openapiのコード生成を行った

refs VOICEVOX#608 VOICEVOX#610
@qwerty2501 qwerty2501 force-pushed the feature/interrogative branch from f28c3ab to a1c1160 Compare December 20, 2021 14:58
Hiroshiba pushed a commit that referenced this pull request Dec 22, 2021
* feat: generated openapi code

openapiのコード生成を行った

refs #608 #610

* コード生成した結果、ビルドが通らなくなったので修正した

* openapitools.jsonをgit管理下に置くようにした
@qwerty2501 qwerty2501 force-pushed the feature/interrogative branch from a1c1160 to 257f5c4 Compare December 22, 2021 10:34
@qwerty2501 qwerty2501 force-pushed the feature/interrogative branch from 257f5c4 to 084da03 Compare December 22, 2021 10:41
もしかしたらいらない配慮かもしれないが、
ExperimentalSettingオブジェクト型を作成し、その中にenableInterrogativeを持たせるようにした。
enableInterrogativeは現状実験的な機能だが、将来的に正式な機能として提供された場合デフォルト設定値をtrueにする可能性が高そうである。
これをSettingStoreStateに対してenableInterrogativeを直接持たせてそのままの状態でenableInterrogative機能が正式リリースされた場合、既存ユーザーはenableInterrogativeがfalseの状態のまま追加居続けるのではないか?
との疑念があったのでExperimentalSettingを作成してネストさせることにしてみた。もしかしたら違うかも。

こうすることによってenableInterrogative機能を正式リリースする際にstate.experimentalSetting.enableInterrogativeからstate.enableInterrogativeに構造を変えることによってデフォルト値trueを適用した状態で既存ユーザーにも機能を提供できるようになるはずである。
@qwerty2501 qwerty2501 force-pushed the feature/interrogative branch from 084da03 to 798878b Compare December 22, 2021 10:49
Copy link
Contributor Author

@qwerty2501 qwerty2501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

設定フィールド一つ増やすのにここまで変更が必要なのかやや疑問なのですが、こういうものなのでしょうか。

ExperimentalSettingという型を作りネストさせてenableInterrogativeフィールドをもたせましたが余計だったかもしれません。
ただ将来的に疑問文が正式対応されたときにデフォルト値をtrueにしたかった場合、アップデート後既存ユーザーに疑問文が有効な状態で提供したほうが良いかなとおもってこうしました。
違ったら直します。

tests/unit/store/Vuex.spec.ts Show resolved Hide resolved
@qwerty2501 qwerty2501 marked this pull request as ready for review December 22, 2021 11:21
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

レビュワーは @Hiroshiba@y-chan でいってみますか!

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントの有無など、コードの意図を汲み取って書いて頂けていてすごく読みやすかったです!!

設定フィールド一つ増やすのにここまで変更が必要なのかやや疑問なのですが、こういうものなのでしょうか。

typescriptを極めるとおそらく半分くらい省けそうなのですが、間に合わずこうなっている感じです。

src/background.ts Outdated Show resolved Hide resolved
src/store/audio.ts Outdated Show resolved Hide resolved
src/store/audio.ts Outdated Show resolved Hide resolved
src/components/SettingDialog.vue Outdated Show resolved Hide resolved
@qwerty2501 qwerty2501 requested a review from Hiroshiba December 27, 2021 16:56
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@y-chan さんもお時間あるときに見て頂けると!

@@ -274,9 +274,11 @@ const store = new Store<{
properties: {
enableInterrogative: {
type: "boolean",
default: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょっと良く覚えてないのですが、たしかこっちのdefault値も必要だった記憶がぼんやりあります。
下のdefaultはdictがなかったときに追加されて、こっちのdefaultはdictの要素がなかったときに使われる感じです。

ということで次のコメントのsuggestを適用して頂けると!

src/background.ts Show resolved Hide resolved
必要っぽい?ので

Co-authored-by: Hiroshiba <[email protected]>
Copy link
Member

@y-chan y-chan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

特に大きく問題はないと思いました!
次のバージョンで疑問文が使えるようになるのが楽しみです....!

@y-chan y-chan merged commit 775098e into VOICEVOX:main Dec 28, 2021
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.

3 participants