Skip to content

Try it: run the lesson on the playground's simulate view - #11

Merged
Kinflou merged 2 commits into
mainfrom
sim/web-kit
Nov 14, 2026
Merged

Kinflou merged 2 commits into
mainfrom
sim/web-kit

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026

Copy link
Copy Markdown
Member

Step 3 of ComlineProject/playground#118.

The "Try it" lesson's widget was a small hand-made copy of the playground's simulate view. It's now that view: comline-web-kit (a workspace in the playground repo) in its lesson layout.

What the lesson shows

  • The scene: the same Chat client and server as before, from chat.lesson.json, drawn as the playground draws them and fitted to the page.
  • The client's Call tab: send and note with their arguments, and the reply under each.
  • The server's behaviours: clicking the server offers reply, echo and drop, as before. The page text now says to click it.
  • The frame log: the playground's, with each frame's kind, function, round-trip time and size.
  • The theme: the tutorial's palette, set through the kit's --cl-* properties.

Changes

  • Dependency: comline-web-kit by git, #workspace=comline-web-kit&commit=<sha>, replaces the direct comline-simulator dependency; the kit depends on the simulator itself. .yarnrc.yml approves the playground repo.
  • CI: COMLINE_KIT_EDITOR=0 skips the kit's editor WASM, as COMLINE_SIMULATOR_SCRIPT=0 already skips the scripted engine. Only the lean engine WASM ships (1.2 MB, as before).
  • Vite serves the kit as source (optimizeDeps.exclude), and tsconfig.json allows its .ts import paths.
  • Simulation.svelte mounts the view through an action.
  • A Playwright test, tests/try-it.test.ts: it sends a call and sees the reply and frames, then switches the server to drop and sees the next call time out. /test-results is ignored.

Before merging

The pin points at a commit on the playground's kit/lesson-mode branch (ComlineProject/playground#120). Once #119 and #120 merge, repin to the merge commit on master, so the pin doesn't depend on a branch that gets deleted.

Verified locally

  • Install: a fresh yarn install resolves the kit from git, with COMLINE_KIT_EDITOR=0 COMLINE_SIMULATOR_SCRIPT=0.
  • Checks: yarn check reports 0 errors, BASE_PATH=/tutorial yarn build succeeds, and ESLint and Prettier are clean on the changed files. yarn lint as a whole still fails on files this PR doesn't touch, as it does on main.
  • Playwright: both tests pass, the new one and the existing index test. CI doesn't run Playwright.

Not in this PR

The tutorial page lays its paragraphs and the widget out side by side, so the view gets about 390px. It renders and fits at that width, but the frame log's columns are tight. That's the page's layout, the same on main, and it's left for whoever is working on tutorial_page.svelte.

The lesson's widget was a small hand-made copy of the playground's simulate
view. It's now that view, from comline-web-kit (a workspace of the playground
repo) in its lesson layout: the Chat client and server from
chat.lesson.json, the client's calls, the server's behaviours (reply, echo,
drop) and the frame log, themed with the tutorial's palette.

- comline-web-kit replaces the direct comline-simulator dependency; it
  depends on the simulator itself. CI skips the kit's editor WASM
  (COMLINE_KIT_EDITOR=0), as it skips the scripted engine.
- Vite serves the kit as source (optimizeDeps.exclude), and TypeScript
  allows its .ts import paths.
- The page says to click the server to change its behaviour.
- A Playwright test sends a call, sees the reply and frames, switches the
  server to drop, and sees the next call time out.
@Kinflou
Kinflou merged commit 0751f4d into main Nov 14, 2026
7 checks passed
@Kinflou
Kinflou deleted the sim/web-kit branch November 14, 2026 14:15
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