Skip to content

refac: コマンドタブの表示をセクション枠と行揃えで整理 - #49

Merged
void2610 merged 1 commit into
mainfrom
refac/tidy-command-tab-layout
Sep 4, 2026
Merged

void2610 merged 1 commit into
mainfrom
refac/tidy-command-tab-layout

Conversation

@void2610

@void2610 void2610 commented Sep 4, 2026

Copy link
Copy Markdown
Owner

概要

Project Reference の「コマンド」タブが miniLabel の平坦な羅列で、種別の切れ目や行の対応関係が読み取れなかった。

変更点

  • 糖衣 / コマンド (モジュール別) / world_effect の各セクションを枠 (helpBox) で囲み、太字見出しに統一
  • 各エントリを「1 行目: コピー + 名前 + 説明 / 2 行目: 引数一覧 (チップの文字位置にインデント)」に整理し、縞背景で区切る
  • 引数の説明はスペースインデントの別行をやめ、name: type — 説明 として引数行に統合
  • C# コマンド型名の表示を削除 (名前から自明で、レイアウトを崩すノイズだったため)

動作確認

  • コマンドタブでセクションが枠と見出しで区切られ、引数行が名前の下に揃って表示される
  • コピーボタンが従来どおり呼び出し形 (cmd :name, key: 空値 等) をコピーする
  • EditMode テスト 202 件通過 (手元で確認済み)

@void2610
void2610 requested a lite review from Copilot September 4, 2026 17:54
@void2610
void2610 merged commit 6b0e22f into main Sep 4, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

  • BeginZebraRowVerticalScope を返す実装に変更する場合、ここも 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

  • BeginZebraRowVerticalScope 返しにする修正に合わせて、この箇所も 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.

Comment thread Assets/Novel/Editor/ProjectReferenceWindow.cs
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.

2 participants