Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
898f6af
feat(scratch-vm): return meaningful fixed values from koshien blocks
takaokouji Jun 13, 2026
672d2d1
feat(scratch-gui): support Ruby v2 array syntax for koshien list blocks
takaokouji Jun 13, 2026
1141157
test(scratch-vm): add koshien golden fixtures + contract test from re…
takaokouji Jun 13, 2026
5f543af
Merge branch 'feature/issue-740-koshien-golden-contract' into feature…
takaokouji Jun 13, 2026
c3e790f
feat(scratch-vm): add koshien RemoteClient (real game server HTTP) wi…
takaokouji Jun 13, 2026
3de0aa7
feat(scratch-gui): represent koshien game connection as a v2 event hat
takaokouji Jun 13, 2026
f533789
feat(scratch-vm): koshien connects to the real server with offline fa…
takaokouji Jun 13, 2026
f060af8
feat(scratch-gui): koshien connection settings storage + runtime wiring
takaokouji Jun 13, 2026
ec92d3c
feat(scratch-gui): koshien connection settings modal + menu item
takaokouji Jun 13, 2026
6e898e5
fix(scratch-vm): run koshien vm tests in CI + add mock server for Rem…
takaokouji Jun 13, 2026
e57e343
Merge branch 'feature/issue-743-koshien-ruby-v2' into check/koshien-a…
takaokouji Jun 13, 2026
2d9c7ff
fix(scratch-gui): allow switching to Ruby v2 with the koshien extensi…
takaokouji Jun 14, 2026
99514ca
Merge branch 'feature/issue-743-koshien-ruby-v2' into check/koshien-a…
takaokouji Jun 14, 2026
2da6cb2
feat(scratch-vm): believable, resettable mock state for offline koshi…
takaokouji Jun 14, 2026
227e0b6
Merge branch 'feature/issue-739-koshien-mock-client' into check/koshi…
takaokouji Jun 14, 2026
a6ecc94
fix(scratch-vm): use the real 17x17 koshien map for the offline mock
takaokouji Jun 14, 2026
6b82ffe
fix(scratch-vm): use the real 17x17 koshien map for the offline mock
takaokouji Jun 14, 2026
b7ca429
fix(scratch-gui): allow enabling the koshien extension in Ruby v2
takaokouji Jun 14, 2026
f0f0246
feat(scratch-vm): fog-of-war for the offline koshien mock
takaokouji Jun 14, 2026
797f42e
Merge branch 'feature/issue-739-koshien-mock-client' into check/koshi…
takaokouji Jun 14, 2026
cef4d15
fix(scratch-vm): render extension HAT/EVENT blocks as hats in modern …
takaokouji Jun 15, 2026
fd6161f
Merge branch 'fix/extension-hat-shape-modern-blockly' into check/kosh…
takaokouji Jun 15, 2026
e804b10
test(scratch-gui): update mobile-drawer test for koshien-in-v2 (combi…
takaokouji Jun 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .claude/rules/scratch-gui/smalruby-markers.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ upstream ファイルに追加した Smalruby 固有コードのマーカー一
| `src/containers/blocks.jsx` | stale block delete event guard | scratch-blocks v2 の非同期イベント配送で、ワークスペースリロードを跨いで届いた stale な delete イベントが VM のスクリプトを消す問題のガード。`attachVM` で `vm.blockListener` を `createStaleBlockDeleteGuard` でラップ (issue #710)。import も含む |
| `src/containers/blocks.jsx` | Ruby-converted toolbox update deferral | `onWorkspaceUpdate` の fromRuby 分岐の `updateToolbox()` を `Events.disable()` 窓の外 (finally 後) へ移動。窓内では flyout 再構築の create イベントが破棄され、新規変数が `runtime.monitorBlocks` / `flyoutBlocks` に登録されずモニタチェックボックスが無反応になる問題の修正 (issue #719)。フラグ宣言部と実行部の 2 箇所 |

| `src/lib/vm-manager-hoc.jsx` | koshien remote options wiring | VM 初期化時に `wireKoshienRemoteOptions(vm)` を呼び、甲子園拡張機能が接続設定を読めるよう runtime に getter を差し込む (import + componentDidMount) |

## 関連ファイル

マーカーで囲まれたコードが参照するファイル:
Expand Down
4 changes: 4 additions & 0 deletions .claude/rules/scratch-gui/smalruby-prettier-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ upstream (Scratch) ファイルは対象外。
- `src/components/blocks-screenshot-button/`
- `src/components/google-drive-save-dialog/`
- `src/components/koshien-test-modal/`
- `src/components/koshien-settings-modal/`
- `src/components/mesh-self-sensor-notice/`
- `src/components/mobile-bottom-tabs/`
- `src/components/mobile-drawer/`
Expand Down Expand Up @@ -124,6 +125,7 @@ upstream (Scratch) ファイルは対象外。
- `src/lib/google-script-loader.js`
- `src/lib/insert-class.js`
- `src/lib/join-code-history.js`
- `src/lib/koshien-connection.js`
- `src/lib/log-suppression.js`
- `src/lib/mesh-v2-classroom-binding.jsx`
- `src/lib/mesh-v2-sensor-collision.js`
Expand Down Expand Up @@ -219,6 +221,7 @@ upstream (Scratch) ファイルは対象外。
- `test/integration/workspace-glow-regression.test.js`
- `test/unit/components/action-menu.test.jsx`
- `test/unit/components/bug-report-consent.test.jsx`
- `test/unit/components/koshien-settings-modal.test.jsx`
- `test/unit/components/dncl-mode-notice.test.jsx`
- `test/unit/components/extension-button-dncl.test.jsx`
- `test/unit/components/connected-step.test.jsx`
Expand Down Expand Up @@ -273,6 +276,7 @@ upstream (Scratch) ファイルは対象外。
- `test/unit/lib/use-is-narrow-screen.test.js`
- `test/unit/lib/insert-class.test.js`
- `test/unit/lib/join-code-history.test.js`
- `test/unit/lib/koshien-connection.test.js`
- `test/unit/lib/layout-constants.test.js`
- `test/unit/lib/legacy-storage.test.js`
- `test/unit/lib/mesh-v2-classroom-binding.test.js`
Expand Down
1 change: 1 addition & 0 deletions .claude/rules/scratch-vm/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ The mesh v2 extension uses AWS AppSync for real-time collaboration:
| `src/blocks/scratch3_operators.js` | regex support | operator_contains で正規表現マッチングをサポート |
| `src/engine/comment.js` | toXML modernization | Blockly v12 対応: `pinned="${!minimized}"` (cherry-pick from upstream spork@29bdbd1fe) + (0,0) 時の x/y 属性省略 (Smalruby 独自) |
| `src/engine/runtime.js` | toolboxitemid for extension categories | Blockly v12 対応: 拡張機能のカテゴリ XML に `toolboxitemid` 属性を追加。Blockly v12 の ContinuousToolbox は `toolboxitemid` から id を読むため、未指定だと `blockly-XXX` の auto-id が StatusIndicatorLabel.extensionId に伝搬し、`!` 接続モーダルが拡張機能を見つけられず scanning で固まる |
| `src/engine/runtime.js` | extension hat shape (modern Blockly) | Blockly v12 対応: 拡張機能の HAT/EVENT ブロックの blockJSON に `shape_hat` extension を付与。modern Blockly は `block.hat === 'cap'`(= `shape_hat` extension)でのみ帽子型を描画し、`ADD_START_HATS` は既定 false。未付与だと甲子園 `connect_game` や micro:bit/顔認識の `when ...` ブロックが帽子型にならず平らな上端で描画される |

### 関連ファイル

Expand Down
5 changes: 5 additions & 0 deletions .claude/rules/scratch-vm/smalruby-prettier-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ upstream (Scratch) ファイルは対象外。
- `test/unit/blocks_move_top_level_shadow.js`
- `test/unit/blocks_operators_regex.js`
- `test/unit/extension_koshien.js`
- `test/unit/koshien_map_utils.js`
- `test/unit/koshien_golden_contract.js`
- `test/unit/koshien_remote_client.js`
- `test/unit/koshien_remote_client_http.js`
- `test/fixtures/koshien/mock-server.js`
- `test/unit/extension_mesh_v2_delta_repro.js`
- `test/unit/extension_mesh_v2_delta.js`
- `test/unit/extension_mesh_v2_domain.js`
Expand Down
4 changes: 4 additions & 0 deletions packages/scratch-gui/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ src/components/*
!src/components/google-drive-save-dialog/
!src/components/dncl-mode-notice/
!src/components/koshien-test-modal/
!src/components/koshien-settings-modal/
!src/components/mesh-self-sensor-notice/
!src/components/mobile-bottom-tabs/
!src/components/mobile-drawer/
Expand Down Expand Up @@ -130,6 +131,7 @@ src/lib/*
!src/lib/auto-correct.js
!src/lib/backpack-mesh-v1-migration.js
!src/lib/bug-report-api.js
!src/lib/koshien-connection.js
!src/lib/deck-setup.js
!src/lib/classroom-api.js
!src/lib/classroom-kick-request-storage.js
Expand Down Expand Up @@ -282,6 +284,7 @@ test/unit/*
test/unit/components/*
!test/unit/components/action-menu.test.jsx
!test/unit/components/bug-report-consent.test.jsx
!test/unit/components/koshien-settings-modal.test.jsx
!test/unit/components/dncl-mode-notice.test.jsx
!test/unit/components/extension-button-dncl.test.jsx
!test/unit/components/connected-step.test.jsx
Expand Down Expand Up @@ -332,6 +335,7 @@ test/unit/lib/*
!test/unit/lib/backpack-mesh-v1-migration.test.js
!test/unit/lib/block-display-initialization.test.js
!test/unit/lib/bug-report-api.test.js
!test/unit/lib/koshien-connection.test.js
!test/unit/lib/blockly-private-api.test.js
!test/unit/lib/blocks-gesture-recovery.test.js
!test/unit/lib/classroom-api.test.js
Expand Down
17 changes: 17 additions & 0 deletions packages/scratch-gui/src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import WelcomeModalHOC from '../../containers/welcome-modal-hoc.jsx';
// === Smalruby: End of welcome modal ===
import URLLoaderModal from '../url-loader-modal/url-loader-modal.jsx';
import KoshienTestModal from '../koshien-test-modal/koshien-test-modal.jsx';
import KoshienSettingsModal from '../koshien-settings-modal/koshien-settings-modal.jsx';
import RubyTab from '../../containers/ruby-tab.jsx';

import layout, {STAGE_DISPLAY_SIZES, STAGE_SIZE_MODES} from '../../lib/layout-constants';
Expand Down Expand Up @@ -211,6 +212,7 @@ const GUIComponent = props => {
isTelemetryEnabled,
isTotallyNormal,
koshienTestModalVisible,
koshienSettingsModalVisible,
loading,
logo,
manuallySaveThumbnails,
Expand Down Expand Up @@ -242,6 +244,7 @@ const GUIComponent = props => {
onRequestCloseCostumeLibrary,
onRequestCloseDebugModal,
onRequestCloseKoshienTestModal,
onRequestCloseKoshienSettingsModal,
onRequestCloseTelemetryModal,
onRequestCloseTipsLibrary,
onRequestCloseUrlLoaderModal,
Expand Down Expand Up @@ -384,6 +387,12 @@ const GUIComponent = props => {
onRequestClose={onRequestCloseKoshienTestModal}
/>
) : null}
{koshienSettingsModalVisible ? (
<KoshienSettingsModal
vm={vm}
onRequestClose={onRequestCloseKoshienSettingsModal}
/>
) : null}
</StageWrapper>
) : (
<ModalFocusProvider>
Expand Down Expand Up @@ -414,6 +423,12 @@ const GUIComponent = props => {
onRequestClose={onRequestCloseKoshienTestModal}
/>
) : null}
{koshienSettingsModalVisible ? (
<KoshienSettingsModal
vm={vm}
onRequestClose={onRequestCloseKoshienSettingsModal}
/>
) : null}
{loading ? (
<Loader />
) : null}
Expand Down Expand Up @@ -876,6 +891,7 @@ GUIComponent.propTypes = {
isShared: PropTypes.bool,
isTotallyNormal: PropTypes.bool,
koshienTestModalVisible: PropTypes.bool,
koshienSettingsModalVisible: PropTypes.bool,
loading: PropTypes.bool,
logo: PropTypes.string,
manuallySaveThumbnails: PropTypes.bool,
Expand All @@ -900,6 +916,7 @@ GUIComponent.propTypes = {
onRequestCloseCostumeLibrary: PropTypes.func,
onRequestCloseDebugModal: PropTypes.func,
onRequestCloseKoshienTestModal: PropTypes.func,
onRequestCloseKoshienSettingsModal: PropTypes.func,
onRequestCloseTelemetryModal: PropTypes.func,
onRequestCloseTipsLibrary: PropTypes.func,
onRequestCloseUrlLoaderModal: PropTypes.func,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
@import "../../css/colors.css";

.modal-content {
width: 400px;
max-width: 90vw;
}

.header {
background-color: $looks-secondary;
}

/* 本文には不透明な背景色を設定する(modals ルール: 設定しないと青いオーバーレイが透ける) */
.body {
background-color: $ui-white;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1rem;
}

.field {
display: flex;
flex-direction: column;
gap: 0.25rem;
}

.label {
font-size: 0.875rem;
font-weight: bold;
color: $text-primary;
}

.input {
width: 100%;
box-sizing: border-box;
padding: 0.5rem;
border: 1px solid $ui-black-transparent;
border-radius: 0.25rem;
font-size: 0.875rem;
}

.button-row {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
margin-top: 0.5rem;
}

.test-button,
.save-button {
padding: 0.5rem 1rem;
border: none;
border-radius: 0.25rem;
font-weight: bold;
cursor: pointer;
}

.test-button {
background-color: $ui-secondary;
color: $text-primary;
}

.test-button:disabled {
opacity: 0.5;
cursor: default;
}

.save-button {
background-color: $motion-primary;
color: $ui-white;
}

.result-ok {
color: $data-primary;
font-size: 0.875rem;
}

.result-ng {
color: $error-primary;
font-size: 0.875rem;
word-break: break-all;
}
Loading
Loading