Skip to content

feat: add Ruby script preview panel to Ruby tab More menu#294

Merged
takaokouji merged 6 commits intodevelopfrom
feature/ruby-script-preview
Mar 13, 2026
Merged

feat: add Ruby script preview panel to Ruby tab More menu#294
takaokouji merged 6 commits intodevelopfrom
feature/ruby-script-preview

Conversation

@takaokouji
Copy link

@takaokouji takaokouji commented Mar 13, 2026

Summary

Ruby tab のスリードットメニューから「ルビースクリプトを確認」を選択すると、現在のスプライト/ステージの最終的な Ruby コード(require 文や class 定義を含む)をカードスタイルのパネルで表示する機能を追加する。

  • パネルは Cards コンポーネントと同様に右側配置、ドラッグ移動・最小化・クローズ可能
  • 背景透過で Ruby tab エディタを操作可能
  • 読み取り専用だがコピー可能(ボタン + Cmd+C)
  • highlight.js による Ruby シンタックスハイライト(GitHub-light 風テーマ)

Closes #293

Implementation Steps

  • Phase 1: コード生成ロジック (generatePreviewCode) — TDD
  • Phase 2: プレビューパネルコンポーネント (Cards パターン: ドラッグ、最小化、クローズ、コピー) — TDD
  • Phase 3: メニュー統合 + ロケール + ruby-tab.jsx ハンドラ
  • Phase 4: 統合テスト
  • Phase 5: シンタックスハイライト (highlight.js + Ruby)

Test Coverage

  • Unit tests for generatePreviewCode (null target, sprite v2, stage v2, sprite v1)
  • Integration tests: panel open, clipboard copy, shrink/expand, close

🤖 Generated with Claude Code

takaokouji and others added 2 commits March 13, 2026 15:52
Add a utility function that generates the final Ruby code (with require
statements and class wrapping) for a single target using RubyGenerator.

Refs #293

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cards-style draggable panel with shrink/expand, close, and clipboard
copy button. Uses pointer-events:none overlay for transparent background.

Refs #293

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

takaokouji and others added 4 commits March 13, 2026 16:00
Add menu item to Ruby toolbar More menu, handler in ruby-tab.jsx with
validate-then-generate flow, and Japanese locale translations.

Refs #293

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests cover opening the panel, clipboard copy, shrink/expand toggle,
and closing the panel.

Refs #293

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use highlight.js with Ruby language support for lightweight syntax
highlighting. Add GitHub-light-like color theme for hljs tokens.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@takaokouji takaokouji merged commit 9c3bb5f into develop Mar 13, 2026
9 checks passed
@takaokouji takaokouji deleted the feature/ruby-script-preview branch March 13, 2026 09:03
github-actions bot pushed a commit that referenced this pull request Mar 13, 2026
…script-preview

feat: add Ruby script preview panel to Ruby tab More menu
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.

feat: add Ruby script preview panel to Ruby tab More menu

1 participant