Skip to content

revert(tutorials): bring the tutorials and their parts back to upstream v13.7.2 - #2065

Merged
smalruby3-editor-bot[bot] merged 200 commits into
topic/tutorials-upstreamfrom
topic/autopilot-2024
Nov 17, 2026
Merged

smalruby3-editor-bot[bot] merged 200 commits into
topic/tutorials-upstreamfrom
topic/autopilot-2024

Conversation

@smalruby3-editor-bot

Copy link
Copy Markdown

概要

チュートリアルの中身と部品を、上流(Scratch)の tag v13.7.2 の形に戻す(EPIC #1935 の 2 つめ)。

このブランチには PR #2028(#2023 レッスンの部品の切り離し)のコミットが入っている。 #2028 はまだ develop 宛てで開いているので、先に merge してある。#2028 が develop に入り、develop を topic/tutorials-upstream に取りこめば、この PR の差分からは消える。

変えたこと

上流に戻したもの(git diff v13.7.2 で差分なし)

  • src/lib/libraries/decks/(上流のチュートリアル 30 本・13 言語の画像と *-steps.js)と tutorial-tags.js
  • containers/cards.jsx・components/cards/(cards.jsx・card.css)・reducers/cards.js・containers/tips-library.jsx・components/library/library.css
  • 上流のテスト test/unit/components/cards.test.jsx(とスナップショット)・test/unit/util/tutorial-from-url.test.js・test/unit/util/translate-video.test.js

スモウルビーの変更を外したもの

  • components/library/library.jsx: チュートリアルのカテゴリ(ブロックのきほん・通信入門・Ruby のきほん)を外した。拡張機能のキー・headerActions のマーカーは残す。
  • lib/titled-hoc.jsx: 「チュートリアルをはじめる」の作品名(pendingProjectTitle)を外した(既定の作品名「Smalruby Project」はそのまま)。
  • 「コードを入れる」ボタン・その色の取りいそぎの修正・光る演出・「次へ」のロック・外のサイトのボタンは、上流の cards に戻したので無くなった。
  • ブロックの本の試食(book-promo.jsx)と開隆堂のリンクは、スモウルビーのチュートリアルと一緒に消した(2026-11-16 の人間の答え t2。レッスンで紹介しなおす)。
  • containers/blocks.jsx: パレットを絞るのはレッスンの allowedBlocks だけ(cards.tutorialAllowedBlocks が無くなった)。
  • locales/en.js・ja.js・ja-Hira.js: スモウルビーのチュートリアルの文字列と categories/*.locale.js の import を外した(どこからも使われないキーだけ。gui.cards.close などの上流のキーの訳は残す)。
  • スモウルビーのチュートリアルだけのテスト(smalruby-tutorials.test.js・decks/ の 5 ファイル・containers/cards.test.jsx)を外した。cards_reducer.test.js は上流の動きの分だけ残した。

足したもの

  • 見つからない ?tutorial= の GA 計測(人間の答え t1): ?tutorial=<urlId> に合うチュートリアルが無いと、category tutorial_url・action not_found を送る。label は、前にスモウルビーにあった urlId(chat1Basic1 など 18 個の決めた一覧)ならその値、ほかは unknown。lib/tutorial-url-analytics.js(純粋関数と送信)と、上流の lib/tutorial-from-url.js のマーカー unknown tutorial url analytics。項目は action と label だけ(新しい項目は無い)。
  • 上流の画像を開いたときだけ読む(人間の答え t3): webpack.config.js のマーカー lazy tutorial images。decks の png・gif・jpg を gui.js に埋めこまずに static/assets/decks/ にファイルで出し、PWA の precache から外して、開いたときだけ runtime caching(smalruby-tutorial-images)する。

画像の量と最初の読みこみ(t3 の確かめ)

本番と同じ BUILD_TYPE=dist-html でビルドして、この PR の前(2362ae4f79)と後を比べた。

前 後
gui.js 25,146,354 B 25,027,454 B(-119 KB)
出力される画像(static/assets/) 155 個・19.1 MB 1,532 個・68.4 MB(うち decks 1,481 個・64.7 MB)
PWA の precache に入る画像 155 個・19.1 MB 51 個・3.7 MB
最初の読みこみのリクエスト(headless・?no_beforeunload=1・ja) 45 45(decks の画像・*-steps のチャンクは 0)
?tutorial=getStarted で開いたとき — ja-steps のチャンクと、カードに出る画像だけを読む
  • 言語ごとの *-steps.js は上流のとおり動的 import なので、チュートリアルのカードを開くまで読まない。
  • いまの本番は service worker を登録していない(service-worker.js は出力されるが、どこからも register していない)。precache から外したのは、あとで登録したときに約 50 MB を先に落とさないための保険。
  • 最初の読みこみは増えなかった(gui.js はスモウルビーの画像の埋めこみが減ったぶん小さくなった)ので、上流の画像を戻した。

確かめたこと

  • npm run lint(scratch-gui。eslint --max-warnings 0 と prettier)・npm run lint:secrets
  • unit テストを 1 つずつ: tutorial-url-analytics・tutorial-from-url-analytics・util/tutorial-from-url・util/translate-video・components/cards(上流のスナップショット・--ci)・reducers/cards_reducer・reducers/lesson-mode-reducer・lib/lesson-dynamic-categories・lib/lessons/challenge-dynamic-categories・lib/lessons/apply-setup・containers/lesson-mode・components/lessons-library・containers/lessons-library・components/menu-bar-help-menu
  • headless で本番ビルドを開き、?tutorial=getStarted でカードが出ること、?tutorial=chat1Basic1 で何も開かないこと(上の表)
  • 上流の integration テスト how-tos.test.js・tutorials-shortcut.test.js は今も describe.skip。feat(menu-bar): revert のあともチュートリアルとデバッグを ? メニューに置く #2025 で ? メニューから開く形にして戻す。
  • docs: docs/analytics/README.md(category の一覧)・docs/tutorial/README.md(GA の計測・主要ファイル)・docs/maintenance/smalruby-markers-gui.md。チュートリアルの docs の書きなおしとスクリーンショットは docs(tutorials): チュートリアルを上流に戻したことを docs とスクリーンショットに反映する #2026。

人間の作業(GTM・GA4)

新しい category tutorial_url を足した(新しい項目は無い。action・label は既存の変数・パラメータ・カスタム ディメンションをそのまま使う)。

  • トリガー「CE - smalruby custom events」の正規表現に tutorial_url を足す(これを忘れると何も届かない)
    ^(block_run|mode_switch|furigana_toggle|ruby_tab|rubytee|classroom|google_drive|mesh_v2|smalrubot_s1|lessons|classroom_student|welcome|tutorial_url)$
    
  • GTM のプレビューで発火と値を確かめる(window.dataLayer.push({ event: 'tutorial_url', action: 'gtm_test_not_found', label: 'chat1Basic1' }) → g/collect に en=tutorial_url・ep.action・ep.label)
  • GTM を公開する
  • (要るなら)GA4 の探索で、イベント名 tutorial_url を label 別に数える
  • docs/analytics/README.md の「いまの設定」(トリガーの正規表現・category の一覧の ❌ → ✅)を更新する

タグのパラメータ(いま 25 個で上限)は増えない。

Closes #2024

🤖 Generated with Claude Code

smalruby3-editor-bot Bot and others added 30 commits November 14, 2026 01:33
…ade 2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Define the hints of read-and-build challenges, the data the swimlane is
drawn from, and keep the quiz position as the EPIC says until a human decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Put the quiz in the done balloon, allow 5 challenges and setup-loaded starts
in lessons 4 and 5, count lesson 5 by one theme, keep the mesh connection,
and let the lesson table scroll once there are 2 or more block courses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(lessons): 中 2「チャットをつくろう」の方針を design.md に書く
A challenge with `quiz: { question, choices, answer, explanation }` now shows
a 3-choice quiz inside the "You did it!" toast (also in "Lesson n complete!"
and "Assignment cleared!"). Choosing shows correct / wrong and the
explanation, and the student can choose again any number of times. The quiz
is not part of the completion check and nothing is recorded.

- courses.js: `quiz` default, `challengeQuiz(id, answer)`, `validateQuiz`
- lesson-completed-quiz.jsx: the quiz part (data-testid lesson-quiz-*)
- lessons.locale.js: quiz words in en / ja / ja-Hira
- docs/lessons: data format, testids, screenshots 0104-0106

Closes #1639

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s a11y

Address the round-1 review of PR #1812.

- Q1: tapping the task bar full text no longer dismisses a toast with a quiz.
  The toast is hidden while the full text is open (lessonMode.completedHidden,
  hideCompleted / showCompleted) and shown again with the same answer when
  the panel closes. "Keep looking" stays an explicit dismissal.
- FYI1: the quiz is a radiogroup of radios, the result starts with the
  chosen number so every pick is read, and the inner live region is gone.
- FYI2: courses.test.js checks the ja-Hira quiz words have no kanji.
- FYI3: picking a choice does not close the toast or go to the next one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Draw a simple activity diagram (SVG) from the answer program of a
challenge and show it in the full task text and on hint page 1 when
the challenge sets activityDiagram: true. Mesh challenges with a
partner definition get swimlanes.

The model and layout are pure functions over the blocks that the
Ruby to blocks converter makes from the answer code.

Refs #1637

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(lessons): 「できた!」の中に 3 択のふりかえりのクイズを出す
…utopilot-1637

# Conflicts:
#	docs/lessons/README.md
#	packages/scratch-gui/src/containers/lesson-mode.jsx
#	packages/scratch-gui/src/lib/lessons/courses.js
- read the practice partner in the #1638 shape (label/onBroadcast,
  set, broadcast) and write the shape in design.md
- keep the diagram at a readable scale; the full text shows a line
  pointing to the hint when it does not fit, the hint scrolls
- test the hook cache, repeat until, nesting and empty answers
- no end symbol after forever; add a title and a text alternative

Refs #1637

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rowser

A challenge can define a data-only partner (name, buttons, automatic replies).
The panel next to the stage acts as the partner on the mesh without the server:
values go to the mesh extension's remoteData, messages start the receive hats.
It does nothing while the real mesh is connected and removes what it put in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge of the quiz branch kept the old expectation of defineChallenge
without the two new defaults, so courses.test.js failed in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe the data-only partner shape, the in-browser loopback, the panel place at
1300x600 (top right of the code area, the stage column does not move) and that
the mesh group survives a challenge change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(lessons): 答えのプログラムからアクティビティ図を描き、課題の全文とヒントの 1 ページ目に出す
…utopilot-1638

# Conflicts:
#	packages/scratch-gui/.prettierignore
#	packages/scratch-gui/src/lib/lessons/courses.js
- remember the node id of each own seeded value and remove it from that node
- keep one pending reply per message name (cap 100), like fireEvent merges
- remove practice values at the step after connecting starts
- move focus to the open button / first partner button when the panel toggles
- drop the unused hasPracticePartner and document that sentBy cannot tell
  mesh messages apart

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(lessons): add the mesh practice partner that loops back in the browser
A challenge with mode: 'readDiagram' is given only by the explanation and
the activity diagram. The diagram is always shown, the task bar shows a
"read and build" tag, and the hint has only 3 pages: the diagram and the
explanation (auto-opened), a try page, and an answer page that draws the
whole answer in the balloon without replacing the student's program.
There is no last-resort page. Judging is the same as other challenges.

The hint balloon is now placed and sized below the lesson task bar, so
tall balloons next to the stage no longer hide their header under it.

Closes #1640

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Q1: the answer page draws code, or the first spriteCodes entry when
  there is no code, and names whose program it is when there is more
  than one script (e.g. "Program of Cat").
- Q2: courses.test.js checks every readDiagram challenge has an answer
  program; applyChallengeMode warns in development and never throws.
- FYI1: test the inline max-height of the hint below the task bar.
- FYI2: center the hint with no target in the area below the task bar.

Refs #1640

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(lessons): 説明とアクティビティ図だけで指示する「読んで作る」チャレンジ
…nswer

Add setup.sprites (replace the cat of the new project with library sprites
such as Shimaraby and Shimacat), setup.code / spriteCodes / stageCode (put the
answer of the previous step into the project when the challenge starts) and
allow a list of names in the goal trigger.message so either role of a pair
passes.

Closes #1936

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- mark the project unchanged after the start set it up (no "replace the
  project?" when choosing another challenge)
- show Shimaraby / Shimacat in the words of the locale in the diagram headings
- skip a sprite or a program that fails and go on; stop when another
  challenge or project takes over
- convert in the Ruby version of the setup; take an added sprite by the diff;
  share the choice of the code sprite with "insert the program"
- check that every setup sprite is in the sprite library

Refs #1936

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e practice partner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… from variables

- the practice partner panel shows one line: the last message the student
  project sent (with the shared value of the same name) or the last shared
  variable and its value (D3)
- a partner value may be { fromVariable } to use the value of a variable of
  the student project, or empty without it; the diagram draws it as
  "(name の値)" (D4)

Closes #1937

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(lessons): start challenges with library sprites and a previous answer
Keep the panel width; fix the line area at two lines (overflow is cut, the full text is in the
title) so the panel height never moves. Shorten the prefix to "届いた:" / "とどいた:" / "Received:".

Refs #1937

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- reattach the loopback per challenge so a challenge with the same partner
  starts over (M1)
- show only the variables the partner uses, tell at most once per frame, and
  read aloud only when a message reached the partner (Q1)
- read the partner lane of the diagram with normalizePartner, the same as the
  practice panel, including per-locale names (Q2, Q3)
- match the variable of a message by exact name first (FYI2); say "up to two
  lines" in the comments (FYI1)

Refs #1937

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… panel

Add an optional `watch` (names of student variables, per locale too) to the
partner definition. They join partnerNames, so the panel shows them even when
the partner itself does not use them (3-3: the own mood). Partners without
`watch` work as before.

Refs #1937

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
smalruby3-editor-bot Bot and others added 24 commits November 17, 2026 14:34
…nd guide

Refs #2147

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Course and lesson headings become buttons (aria-expanded / aria-controls,
Enter and Space). When the library opens, only the course in progress and
its current and next unfinished lessons are open; done and later lessons
fold into one line with a dot per challenge. Searching and the class
assignment library open everything. The rule is the pure initialFoldState
in lib/lessons/library-fold.js.

Refs #2148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #2148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #2148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ints change

0-5 starts with turn 15 degrees and go to mouse-pointer, so hint 1 changes the number
and hint 2 the ▼ of blocks already in the code area; the goal checks both.
0-6 starts with Shimaraby (2 costumes) and only asks to choose the 2nd costume.
Hint balloons no longer cover the costume/sound list or the scripts in the code area.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(lessons): make the guide button match the hint button
…eat/lessons-l0-content-2146

# Conflicts:
#	packages/scratch-gui/src/lib/lessons/courses.js
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests

Lesson 2 and 3 start folded, so open them before measuring the card bands,
and pick only the lesson sections (the headings now have testids too).

Refs #2148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(hosting): 本番の CloudFront のアクセスログを非公開バケットに残す
feat(hosting): DNS と配信内容を照合するスクリプト
# Conflicts:
#	docs/infra/smalruby-web-hosting.md
feat(lessons): give lesson 0 a two-costume sprite in 0-6 and clearer blocks in 0-5
# Conflicts:
#	docs/infra/smalruby-web-hosting.md
#	infra/smalruby-web-hosting/test/web-hosting.test.ts
feat(lessons): fold the lessons library to the lessons in progress
feat(hosting): prod に smalruby.app の Route 53 ゾーンを作り、お名前.com のレコードを写す
Re-render the map with the guide button in the task bar, and call the button
ガイド in the teacher script. Hints now open in every challenge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d the minimize button

Retake the task bar and hint screenshots of lesson 0 and lesson 1 that still
showed the old part names button or the close button of the hint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(lessons): finish the first step with the guide button (0.1.2 and screenshots)
feat(lessons): first step — lesson 0 and help for stuck students
Keep the first-step lesson (#2136) and point it at lib/lessons/apply-setup.js
(applySetup / normalizeRubyVersion) instead of the moved lib/deck-setup.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ot-2024

Keep the first-step lesson and the standard assignments from develop next to
the reverted tutorials: the activity diagram locale import, the sprite-library
marker row, and both the assignments and the tutorial images in the precache
exclusions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
stg — 2812264f Deployed Nov 17, 2026 by smalruby3-editor-bot[bot] via cleanup #370
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.

1 participant