-
Notifications
You must be signed in to change notification settings - Fork 313
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
WIP: 初回起動時にトークとソングのどちらかを選択できるダイアログを表示する #2409
Draft
jdkfx
wants to merge
21
commits into
VOICEVOX:main
Choose a base branch
from
jdkfx:feature/#2011
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+113
−5
Draft
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
28e5882
初期設定ダイアログデバッグ用のボタンを設置
jdkfx 728da61
簡易的な初期設定ダイアログを表示
jdkfx a86855a
ボタンによるエディタ切り替え
jdkfx 8a9a8e5
Merge branch 'main' into feature/#2011
jdkfx b653097
エディタ選択後にダイアログを非表示にする
jdkfx 1d60c07
デザインを少し考えてみる
jdkfx 7ce0017
Merge branch 'main' into feature/#2011
jdkfx 8b09574
過去に開いていたエディタがundefinedの時ダイアログを開く
jdkfx 5f799d0
Merge branch 'main' into feature/#2011
jdkfx 253e843
Merge branch 'main' into feature/#2011
jdkfx 47c42c7
Merge branch 'main' into feature/#2011
Hiroshiba 101bd4c
feat: 初期設定ダイアログの状態管理を追加し、openedEditorをオプショナルに変更
Hiroshiba cdbc3d7
Merge branch 'VOICEVOX:main' into feature/#2011
jdkfx 6f7c945
Merge pull request #5 from Hiroshiba/hiho-counter-pr-101bd4c3
jdkfx ea58503
Merge branch 'main' into feature/#2011
jdkfx 2eb2c57
Merge branch 'main' into feature/#2011
jdkfx 7fdd64d
デバッグ用ボタン削除
jdkfx 6184761
Merge branch 'main' into feature/#2011
jdkfx 94fd07c
スナップショットの更新
jdkfx d1489a8
Merge branch 'main' into feature/#2011
jdkfx 253a9c5
いらないvoidを消す
jdkfx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<template> | ||
<QDialog v-model="isInitialSettingsDialogOpenComputed"> | ||
<QCard class="q-pa-md"> | ||
<QCardSection class="dialog-text"> | ||
<div class="text-h5">どちらに興味がありますか?</div> | ||
<div class="text-body2 text-grey-8"> | ||
選択したエディタを開きます。アプリケーション右上からトークとソングを切り替えることができます。 | ||
</div> | ||
</QCardSection> | ||
<QCardActions class="q-px-md q-py-sm"> | ||
<div class="button-group col q-px-md"> | ||
<QBtn | ||
outline | ||
textColor="display" | ||
class="text-no-wrap text-h4 text-bold q-mr-sm" | ||
@click="selectEditor('talk')" | ||
@update:modelValue="selectEditor" | ||
> | ||
<label>トーク</label> | ||
<QIcon | ||
name="mic" | ||
class="q-icon material-icons" | ||
aria-hidden="true" | ||
size="5rem" | ||
/> | ||
</QBtn> | ||
<QBtn | ||
outline | ||
textColor="display" | ||
class="text-no-wrap text-h4 text-bold q-mr-sm" | ||
@click="selectEditor('song')" | ||
@update:modelValue="selectEditor" | ||
> | ||
<label>ソング</label> | ||
<QIcon | ||
name="music_note" | ||
class="q-icon material-icons" | ||
aria-hidden="true" | ||
size="5rem" | ||
/> | ||
</QBtn> | ||
</div> | ||
</QCardActions> | ||
</QCard> | ||
</QDialog> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
import { QIcon } from "quasar"; | ||
import { useStore } from "@/store"; | ||
import { EditorType } from "@/type/preload"; | ||
|
||
const props = defineProps<{ | ||
modelValue: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(e: "update:modelValue", value: boolean): void; | ||
}>(); | ||
|
||
const isInitialSettingsDialogOpenComputed = computed({ | ||
get: () => props.modelValue, | ||
set: (val) => emit("update:modelValue", val), | ||
}); | ||
|
||
const store = useStore(); | ||
|
||
const selectEditor = async (editorType: EditorType) => { | ||
await store.actions.SET_ROOT_MISC_SETTING({ | ||
key: "openedEditor", | ||
value: editorType, | ||
}); | ||
|
||
isInitialSettingsDialogOpenComputed.value = false; | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use "@/styles/colors" as colors; | ||
|
||
.dialog-text { | ||
text-align: center; | ||
} | ||
|
||
.button-group { | ||
display: grid; | ||
grid-auto-columns: 1fr; | ||
grid-auto-flow: column; | ||
gap: 1rem; | ||
width: fit-content; | ||
} | ||
</style> |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
store.state.openedEditor
から開いていたエディタを取得し、undefinedの時にSET_DIALOG_OPEN
でエディタを選択できるダイアログを表示するような処理にしている。https://github.com/VOICEVOX/voicevox/blob/main/src/store/type.ts#L1857
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hiroshiba
初回起動の動作確認は
npm run electron:serve
を実行した際、store.state.openedEditor
はundefined
となり、このダイアログが開かれるのでそこで確認できます。すでにどちらかのエディタを開き、再起動した際にこのダイアログが表示されないという挙動をどう確認しようかなと悩んでいます。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちょっと問題を把握できないのですがコメントまで!!
openedEditor
は前回どっちのエディターが開かれていたかが入っています!デフォルト値は今
talk
に設定されているので、これをデフォルトundefiend
にする必要がありそうです。こうすれば、
config.json
がない状態で起動すればこのダイアログが開かれて、1回エディタが開かれた後にもう一度起動すればダイアログが表示されないはず。ちなみに開発環境の設定ファイル
config.json
はC:\Users\[ユーザー名]\AppData\Roaming\voicevox-dev
にあります。なんですが、ちょっとこの辺のダイアログを開くかどうか周りとかが入り組んでいるので、こちらでちょこっと変更してプルリクエスト送ろうと思います!!