refac: コマンドタブの表示をセクション枠と行揃えで整理 - #49
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
EditorGUILayout.BeginVertical() の戻り値を Rect として扱っておりコンパイルエラーになるため、スコープ方式などへ修正が必要です。
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Project Reference ウィンドウの「コマンド」タブ表示を、セクション枠・行揃え・縞背景によって読みやすく整理するための UI リファクタです(糖衣 / コマンド(モジュール別) / world_effect を視認しやすくする)。
Changes:
- 「糖衣 / コマンド / world_effect」を helpBox 枠 + 太字見出しのセクション表示に統一
- 各エントリを「1行目: コピー+名前+説明 / 2行目: 引数(インデント)」に再構成し、縞背景で区切り
- 引数説明の出し方を
name: type — 説明形式へ統合し、C# コマンド型名の表示を削除
File summaries
| File | Description |
|---|---|
| Assets/Novel/Editor/ProjectReferenceWindow.cs | コマンドタブのセクション枠・縞背景・詳細行の共通描画を追加し、表示レイアウトを整理 |
| Assets/Novel/CHANGELOG.md | コマンドタブ表示変更の更新履歴を追加 |
Review details
Suppressed comments (3)
Assets/Novel/Editor/ProjectReferenceWindow.cs:703
EditorGUILayout.BeginVertical()はRectを返さないため、ここはコンパイルエラーになります。縞背景の描画が目的ならEditorGUILayout.VerticalScopeを使ってscope.rectに対してDrawRectすると、Repaint 時に rect が確定していて背景を先に描けます。
private static void BeginZebraRow(int index)
{
var rect = EditorGUILayout.BeginVertical();
if (Event.current.type == EventType.Repaint && (index & 1) == 1)
EditorGUI.DrawRect(rect, new Color(0.5f, 0.5f, 0.5f, 0.08f));
Assets/Novel/Editor/ProjectReferenceWindow.cs:658
BeginZebraRowをVerticalScopeを返す実装に変更する場合、ここもusing (BeginZebraRow(...)) { ... }にしてEndVertical()を削除しないとコンパイルが通りません。
BeginZebraRow(row++);
using (new EditorGUILayout.HorizontalScope())
{
DrawKeyChip(command.Name, CommandTemplate(command), 180f);
if (command.Description != null) EditorGUILayout.LabelField(command.Description, RowLabel);
Assets/Novel/Editor/ProjectReferenceWindow.cs:686
BeginZebraRowをVerticalScope返しにする修正に合わせて、この箇所もusingスコープで閉じる形に更新しないとEndVertical()が不整合になります。
BeginZebraRow(row++);
using (new EditorGUILayout.HorizontalScope())
{
DrawKeyChip($":{key.Key}", $"world_effect :{key.Key}", 180f);
if (key.Note != null) EditorGUILayout.LabelField(key.Note, RowLabel);
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
概要
Project Reference の「コマンド」タブが miniLabel の平坦な羅列で、種別の切れ目や行の対応関係が読み取れなかった。
変更点
name: type — 説明として引数行に統合動作確認
cmd :name, key: 空値等) をコピーする