Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .claude/rules/scratch-gui/smalruby-markers.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ upstream ファイルに追加した Smalruby 固有コードのマーカー一
| `src/containers/connection-modal.jsx` | mesh_v2/smalrubot_s1 disconnect analytics | 切断時に拡張別カテゴリで GA4 イベントを発火 (issue #645 Phase 1) |
| `src/lib/calculatePopupPosition.js` | viewport-aware popup flip | LEFT/RIGHT 配置で配置側にポップアップが収まらない場合、反対側にフリップする (issue #671: SP モードのスプライト削除確認ポップアップが画面外で押せない問題への対策) |
| `src/containers/menu.jsx` | iPad menu item click fix | メニュー項目クリック時の `setTimeout` 遅延を 0 → 100ms に拡大。iPadOS Safari は `pointerup` から `click` 発火まで ~16–32ms 程度のラグがあり、setTimeout(0) で close すると `<li>` が click 発火前に unmount され React onClick が skip される問題への対応 |
| `src/containers/blocks.jsx` | palette-toggle initial render | `componentDidMount` 末尾で `_applyPaletteVisibility` を呼び `forceUpdate()` を起動。`this.workspace` はインスタンス変数なので `inject()` 後に再レンダーが走らず、初回 `render()` で workspace=null のまま PaletteToggle がスキップされる問題への対応 (issue #695) |

## 関連ファイル

Expand Down
10 changes: 10 additions & 0 deletions packages/scratch-gui/src/containers/blocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@ class Blocks extends React.Component {
this.handleCategorySelected('faceSensing');
});
});

// === Smalruby: Start of palette-toggle initial render ===
// this.workspace is an instance variable, not React state, so inject()
// above does not trigger a re-render. The first render() ran before
// componentDidMount with workspace=null, skipping PaletteToggle.
// Call _applyPaletteVisibility here to forceUpdate() after workspace is
// ready, so PaletteToggle appears immediately on mount (e.g. after the
// ResponsiveGui swaps MobileGui ↔ GUI on viewport orientation change).
this._applyPaletteVisibility(this.props.paletteVisible);
// === Smalruby: End of palette-toggle initial render ===
}
shouldComponentUpdate (nextProps, nextState) {
return (
Expand Down
Loading