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

Add: シーケンサにおいてツール選択可能にする #2367

Open
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

romot-co
Copy link
Contributor

内容

以下の機能を追加します

  • ノート編集において、編集優先ツールと選択優先ツールを切り替えられるようにする
  • ピッチ編集において、ドローツールと削除ツールを切り替えられるようにする

関連 Issue

ref #2039
close #2039

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

スクリーンショット 2024-11-17 12 17 15
test-tools-scr.mp4

その他

ツールパレットの位置やUI構成については考慮必要かもしれないですが、
まずは機能追加を行いボリューム編集を取り込み後に適宜修正できればと考えています

Material Iconsに適切なものがなかったため
Material Symbolsを取り入れています(別Issueの方がよさそうでしたらおしらせください)

※ 再作成します

@romot-co romot-co requested a review from a team as a code owner November 19, 2024 15:19
@romot-co romot-co requested review from Hiroshiba and removed request for a team November 19, 2024 15:19
@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Nov 19, 2024

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:c7ecd63

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 11 changed files in this pull request and generated no suggestions.

Files not reviewed (5)
  • src/styles/_index.scss: Language not supported
  • src/styles/fonts.scss: Language not supported
  • src/components/Sing/ScoreSequencer.vue: Evaluated as low risk
  • src/components/Sing/SequencerNote.vue: Evaluated as low risk
  • src/components/Sing/SequencerToolPalette.vue: Evaluated as low risk
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.

大まかに見させていただきました!
一旦認識合わせたいところと、ちょっと気づいた点をコメントしています 🙏

src/components/Sing/SequencerToolPalette.vue Outdated Show resolved Hide resolved
src/composables/useEditMode.ts Outdated Show resolved Hide resolved
src/store/type.ts Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/styles/_index.scss Show resolved Hide resolved

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 11 changed files in this pull request and generated no suggestions.

Files not reviewed (4)
  • src/styles/_index.scss: Language not supported
  • src/styles/fonts.scss: Language not supported
  • src/components/Sing/SequencerNote.vue: Evaluated as low risk
  • src/components/Sing/SequencerToolPalette.vue: Evaluated as low risk
Comments skipped due to low confidence (1)

src/components/Sing/ToolBar/EditTargetSwicher.vue:35

  • Attribute name 'transitionSide' should be 'transitionHide'.
transitionHide=""
Copy link
Contributor

@sigprogramming sigprogramming left a comment

Choose a reason for hiding this comment

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

LGTM!!

右クリックでツールの切り替えが行えるように、右クリックメニューにツールの項目を追加しても良いかもです!

src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/store/type.ts Outdated Show resolved Hide resolved

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 11 changed files in this pull request and generated no suggestions.

Files not reviewed (4)
  • src/styles/_index.scss: Language not supported
  • src/styles/fonts.scss: Language not supported
  • src/components/Sing/SequencerNote.vue: Evaluated as low risk
  • src/components/Sing/SequencerToolPalette.vue: Evaluated as low risk
Comments skipped due to low confidence (1)

src/components/Sing/ToolBar/EditTargetSwicher.vue:35

  • There is a misspelling in the comment. 'transitionSide' should be 'transitionHide'.
transitionSide=""
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です!!
色々コメント書いていますが、とんちんかんなことも言ってるかもなので遠慮なくご指摘いただければと思います 🙇

挙動の細かい制御のとこ、コメント書きまくるの良いですね!!
コメントでロジックのチェックをした後、コメントと共同が揃ってるかどうか確かめる手が使えそう。


z.enumで定義してそれをzodSchemaとして使わないのはちょっとYAGNI感があるので、普通のtypeのが良いかもです! 🙇
これに編集状態を保存する場合はSchemaが必要になると思うので、その時に実装する感じが良いかなと!
(たぶんtype/preload.ts辺りに移動も必要)

こう書き換えられるはず。

// const hogeSchema = z.enum(["A", "B"])
// type hoge = typeof()
// ↓
type hoge = "A" | "B"

まあでも全く問題ではないので、もしよかったらくらいで・・・!

src/store/type.ts Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/SequencerNote.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
@romot-co romot-co requested a review from Copilot December 2, 2024 13:05

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 11 changed files in this pull request and generated no suggestions.

Files not reviewed (4)
  • src/styles/_index.scss: Language not supported
  • src/styles/fonts.scss: Language not supported
  • src/components/Sing/SequencerNote.vue: Evaluated as low risk
  • src/components/Sing/SequencerToolPalette.vue: Evaluated as low risk
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です!!!

とても便利になりそう、ありがとうございます!!!!

Comment on lines +515 to +518
// ピッチ削除ツールが選択されているかコントロールキーが押されている場合はピッチ削除
if (sequencerPitchTool.value === "ERASE" || ctrlKey.value) {
return "ERASE_PITCH";
}
Copy link
Member

Choose a reason for hiding this comment

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

確か別のwatchはctrlKeyを押しているときにsequencerPitchToolERASEにしてるはず?
なのでここの処理は条件がダブってるかも・・・?

(将来例えばctrl+shiftで別のモードになるようにしたときに、ctrlが押されてる判定になってこっちが動作するとかありそうかも、くらい!)

Comment on lines +555 to +559
// Ctrlキーが押されたときにピッチツールを変更したかどうか
const toolChangedByCtrl = ref(false);

// ピッチ編集モードにおいてCtrlキーが押されたときにピッチツールを消しゴムツールにする
watch([ctrlKey], () => {
Copy link
Member

Choose a reason for hiding this comment

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

(細かいですが)

watchはビフォーアフターの値をどちらも受け取れるので、false→trueになったときの処理と、true→falseになった時のifにすればtoolChangedByCtrl状態変数を消せるかも?

あとすごい細かいですが、ctrlを押しながらeditTargetを変更した場合にERASEにならないかもですね!
まあこっちもdetermineかcomputedにしたほうが良いかも。
(でもかなり細かいので今はどちらでも良さそう)

Comment on lines +631 to +634
// Ctrlキーが押されていたもしくは削除ツールが選択されていたら消しゴムカーソル
if (ctrlKey.value || sequencerPitchTool.value === "ERASE") {
return "ERASE";
}
Copy link
Member

Choose a reason for hiding this comment

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

ここもsequencerPitchToolを信頼するかctrlキーを信頼するかが混じってるかも・・・?
難しいですね!!!!

Comment on lines +1320 to +1321
// ダブルクリックで追加
const onDoubleClick = (event: MouseEvent) => {
Copy link
Member

Choose a reason for hiding this comment

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

将来的には追加だけじゃないかも?
(多分歌詞編集とかもここに来た方がいいのかも)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants