Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.

Commit 2d529a9

Browse files
Web 0.14.31: Links der Web-App auf visucode.de (#260)
Startseite, Impressum und Datenschutz verlinken die Startseite der aktuellen Welt auf ihrer Subdomain (site.ts). Auf visubot und visuobject.visucode.de startet die App ohne Angabe in dieser Welt. Claude-Session: https://claude.ai/code/session_01Ugz28VmksqdjZ9e5uLshKP Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4aa8ca4 commit 2d529a9

20 files changed

Lines changed: 1510 additions & 1447 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is loosely inspired by Keep a Changelog.
88

99
### Changed
1010

11+
- **Web 0.14.31, web app links point to visucode.de:** the website now lives on one subdomain per world (visustruct.visucode.de, visubot.visucode.de, visuobject.visucode.de, published from the GitLab repo visucode/website). The app's home, imprint and privacy links go to the start page of the current world there (relative on its own subdomain, e.g. `../de/index.html`, otherwise absolute); before, in VisuBot they pointed to `../de/visubot.html`, which no longer exists. On visubot.visucode.de and visuobject.visucode.de the app starts in that world when no world was chosen yet. The about link (web and Swift app) and the Messprotokoll links in lesson 22 use the new addresses (`web/src/ui/site.ts`, test `site.test.ts`).
1112
- **Web 0.14.30, VisuBot concentrates on robotics:** the VisuBot world now shows only the robot lessons and robot tasks (23 lessons in four parts: Losfahren, Sensoren und Entscheidungen, Licht/Ton/Bildschirm, Motoren und Methoden) instead of all 40 VisuStruct lessons with the robot lessons in between; plain Java (console, Scanner, files, windows) stays in VisuStruct (Holger 2026-11-03). The five „Jetzt ohne Roboter“ steps became robot steps: L3 „Ergebnis auf dem Bildschirm“ (`mbot.showText`, data types with robot examples), L9 „Startsignal“ (switch in a for loop), L17 „Messreihe“ (five distance measurements in an array, average), L19 „Laufschrift“ (`charAt` backwards on the screen), L22 „Methode mit Rückgabe“ (`int zentimeter(int umdrehungen)`). New lesson 8 „Und, oder, nicht“ (`&&`, `||`, `!` with distance, line and buttons, truth tables, Java exercise „Sicher fahren“ in four worlds); it is inserted after the line lesson without renaming files, robot lessons are numbered in file order. Links „📘 Mehr dazu ohne Roboter“ (`[…](?visustruct&lektion=…)`) open the matching VisuStruct lesson in a new window (`?lektion=` opens a lesson). The robot lesson file `09-fallauswahl.md` is now `09-fallauswahl-mbot2.md`, because an old progress rename for VisuStruct deleted its progress on every load. Robot Java exercises are now also checked by typing them as Java (de/en).
1213
- **Web 0.14.29, VisuBot commands grouped by colour:** in the palette every mBot2 box gets a 4 px stripe on the left and every group heading a dot in the colour of its group: driving and wheels orange, light (LEDs) yellow-green, sound magenta, screen and emotions indigo, waiting and stopwatch grey, all sensors turquoise. The boxes themselves stay yellow (statement), and the structure chart and the code are unchanged. The former group „Licht, Ton und Bildschirm“ is split into „Licht“, „Ton“ and „Bildschirm“ in the palette and in the VisuBot Nachschlagen (de/en), whose `###` headings show the same dots. New lesson syntax `### Überschrift {.klasse}`. With „Blöcke farbig“ off, stripes and dots disappear. Every sub-group also gets a symbol in the palette (all languages) and in the Nachschlagen headings: 🚗 driving, ⚙️ wheels, 💡 LEDs, 🔊 sound, 🖥️ screen, 😊 emotions, ⏱️ waiting, 📏 distance, ➖ line, 🎨 colours, 🕹️ buttons/joystick, 🔆 light/loudness, 📐 tilt, 🔋 stopwatch/battery.
1314
- **Web 0.14.27, VisuBot: `forward`/`backward` overloaded with a unit:** besides `mbot.forward()` (10 cm) and `mbot.forward(30)` there is now `mbot.forward(2, "Umdrehungen")` and `mbot.forward(30, "cm")` (en `"rotations"`, pt `"rotações"`), same for `backward`. One wheel rotation is π · 6.5 cm ≈ 20.4 cm; the action stores the distance in cm, so simulation, exercise check and the real robot (`mbot2.straight`) work unchanged, and the console shows e.g. „2 Umdrehungen vorwärts (40.84 cm)“. An unknown unit is an error naming the allowed units. The CyberPi program export gets the same overload. VisuBot lesson 22 gets a step „Gleicher Name, andere Parameter: Überladung“ with the three headers, a Ludwig Angeberwissen asking pupils to measure their own robot with a printable test record (PDF, de/en, `website/visubot/messprotokoll-radumdrehung.pdf` / `test-record-wheel-rotation.pdf`: wheel diameter, five test cases expected vs. actual, evaluation, causes, feedback for the teacher, box „So testet man Softwaresysteme“), the exercise „Quadrat mit Umdrehungen“ and a quiz; Nachschlagen, glossary („Überladung“) and code completion list the new variants (de/en).

‎VisuStruct-iOS/VisuStructXcodeOpen/VisuStruct/About/AboutVisuStructView.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ struct AboutVisuStructView: View {
1616
// Öffentliches Java-Repo: maßgebliche Quelle & Releases (aktueller als dieses SwiftUI-Repo).
1717
private let projectDisplay = "code4teaching/VisuStruct"
1818
private let projectURL = URL(string: "https://github.com/code4teaching/VisuStruct")
19-
private let webDisplay = "www.visustruct.org"
20-
private let webURL = URL(string: "https://www.visustruct.org")
19+
private let webDisplay = "visustruct.visucode.de"
20+
private let webURL = URL(string: "https://visustruct.visucode.de")
2121
private let developerDisplay = "www.sebastiao.org"
2222
private let developerURL = URL(string: "https://www.sebastiao.org")
2323
// Java-Referenzrepo (aktuell gepflegt): code4teaching/VisuStruct

‎web/lessons/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Der Text darf Markdown und Links enthalten:
165165

166166
```
167167
::: angeberwissen
168-
Ben Shneiderman hatte die Idee 1972. [Mehr dazu](https://visustruct.org/de/angeberwissen.html)
168+
Ben Shneiderman hatte die Idee 1972. [Mehr dazu](https://visustruct.visucode.de/de/angeberwissen.html)
169169
:::
170170
```
171171

‎web/lessons/de/visubot/22-eigene-methoden.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void forward(int wert, String einheit)
9797
Überladung kennst du schon: `System.out.println` gibt es für `int`, für `double`, für `String` und noch mehr. Deshalb kannst du jeden dieser Werte einfach in die Klammern schreiben.
9898

9999
::: angeberwissen
100-
Stimmen die 20,4 cm bei **deinem** mBot2 wirklich? Profis glauben keiner Zahl, die sie nicht nachgemessen haben. Miss den Raddurchmesser und lass `mbot.forward(5, "Umdrehungen")` fahren: Soll sind 102,1 cm. So testet man Softwaresysteme: Jeder **Testfall** hat ein erwartetes Ergebnis (**Soll**) und ein gemessenes (**Ist**). Man testet mehrmals und schreibt alles in ein **Protokoll**. Hier ist dein [Messprotokoll zum Ausdrucken (PDF)](https://visustruct.org/visubot/messprotokoll-radumdrehung.pdf). Gib es deiner Lehrkraft, dann sieht sie, ob alle Roboter gleich weit fahren.
100+
Stimmen die 20,4 cm bei **deinem** mBot2 wirklich? Profis glauben keiner Zahl, die sie nicht nachgemessen haben. Miss den Raddurchmesser und lass `mbot.forward(5, "Umdrehungen")` fahren: Soll sind 102,1 cm. So testet man Softwaresysteme: Jeder **Testfall** hat ein erwartetes Ergebnis (**Soll**) und ein gemessenes (**Ist**). Man testet mehrmals und schreibt alles in ein **Protokoll**. Hier ist dein [Messprotokoll zum Ausdrucken (PDF)](https://visubot.visucode.de/messprotokoll-radumdrehung.pdf). Gib es deiner Lehrkraft, dann sieht sie, ob alle Roboter gleich weit fahren.
101101
:::
102102

103103
::: übung vb-ueberladung-umdrehung

‎web/lessons/en/visubot/22-eigene-methoden.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void forward(int value, String unit)
9797
You already know overloading: `System.out.println` exists for `int`, for `double`, for `String` and more. That is why you can simply put any of these values in the brackets.
9898

9999
::: angeberwissen
100-
Are the 20.4 cm really true for **your** mBot2? Professionals don't trust a number they haven't measured. Measure the wheel diameter and run `mbot.forward(5, "rotations")`: the expected distance is 102.1 cm. This is how software systems are tested: every **test case** has an expected result and an actual (measured) result. You test several times and write everything into a **test record**. Here is your [test record to print (PDF)](https://visustruct.org/visubot/test-record-wheel-rotation.pdf). Give it to your teacher, so they can see whether all robots drive the same distance.
100+
Are the 20.4 cm really true for **your** mBot2? Professionals don't trust a number they haven't measured. Measure the wheel diameter and run `mbot.forward(5, "rotations")`: the expected distance is 102.1 cm. This is how software systems are tested: every **test case** has an expected result and an actual (measured) result. You test several times and write everything into a **test record**. Here is your [test record to print (PDF)](https://visubot.visucode.de/test-record-wheel-rotation.pdf). Give it to your teacher, so they can see whether all robots drive the same distance.
101101
:::
102102

103103
::: übung vb-ueberladung-umdrehung

‎web/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎web/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "visustruct-web",
33
"private": true,
4-
"version": "0.14.30",
4+
"version": "0.14.31",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

‎web/src/main.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import './ui/styles.css'
22
import { App, applyCanvasStubTexts } from './ui/app'
33
import { installTooltips } from './ui/tooltip'
44
import { preferredLanguage, setCodeKeywords, setLanguage, storedCodeKeywords } from './ui/i18n'
5-
import { setVisuFlowWorld, setVisuObjectWorld, visuFlowWorld, visuObjectWorld } from './ui/visubotView'
5+
import { setVisuBotMode, setVisuFlowWorld, setVisuObjectWorld, visuFlowWorld, visuObjectWorld, worldChosen } from './ui/visubotView'
6+
import { hostWorld } from './ui/site'
67

78
// Nach einem Update kann eine noch offene oder zwischengespeicherte Seite Dateien der alten Version
89
// nachladen wollen, die es nicht mehr gibt. Dann einmal neu laden statt leer zu bleiben.
@@ -53,6 +54,13 @@ Promise.all([setLanguage(language, false), setCodeKeywords(storedCodeKeywords(),
5354
installTooltips()
5455
// Welten VisuObject (…/app/?visuobject) und VisuFlow (?visuflow) haben eine eigene Oberfläche; ?visustruct und ?visubot wählt die App selbst.
5556
const query = new URLSearchParams(location.search)
57+
// Erster Besuch auf visubot.visucode.de oder visuobject.visucode.de ohne Welt in der Adresse: gleich die Welt der Seite
58+
const anyWorld = ['visustruct', 'visubot', 'visuobject', 'visuflow'].some((k) => query.has(k))
59+
if (!anyWorld && !worldChosen()) {
60+
const site = hostWorld()
61+
if (site === 'visubot') setVisuBotMode('on')
62+
else if (site === 'visuobject') setVisuObjectWorld()
63+
}
5664
if (query.has('visuobject')) setVisuObjectWorld()
5765
if (query.has('visuflow')) setVisuFlowWorld()
5866
const root = document.getElementById('app')!

‎web/src/ui/app.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { canvasTextLines, setCanvasStubTexts } from '../core/diagramText'
2+
import { worldHomeURL } from './site'
23
import {
34
appendCaseToFallauswahl,
45
canDeleteElement,
@@ -199,12 +200,7 @@ const isMac = /Mac|iPhone|iPad/.test(navigator.platform)
199200
/** Tastenkürzel im Tooltip, z. B. „Strg+S“ bzw. „⌘S“. */
200201
/** Startseite (oder ein Abschnitt ihrer Fußzeile) in der passenden Sprache der Webseite; im VisuBot-Modus die VisuBot-Startseite. */
201202
function siteURL(section?: 'contact' | 'privacy'): string {
202-
const code = currentLanguage()
203-
const lang = code === 'pt-PT' ? 'pt' : code === 'de' ? 'de' : 'en'
204-
// Auf visustruct.org liegt die Web-App unter /app/, sonst (Vorschau, Einzeldatei) zur echten Seite
205-
const base = /\/app\/(index\.html)?$/.test(location.pathname) ? '../' : 'https://visustruct.org/'
206-
const page = visuBotEnabled() ? 'visubot' : 'index'
207-
return `${base}${lang}/${page}.html${section ? `#${section}` : ''}`
203+
return worldHomeURL(visuBotEnabled() ? 'visubot' : 'visustruct', currentLanguage(), section)
208204
}
209205

210206
/** Symbolknopf; der Name (mit Tastenkürzel) erscheint als Tooltip. */
@@ -1162,7 +1158,7 @@ export class App {
11621158
<h3>VisuStruct <small>${e(t('web_brand_suffix'))}</small></h3>
11631159
<p class="about-version">${e(t('web_about_version_fmt').replace('%@', __APP_VERSION__))}</p>
11641160
<p class="about-author">Holger Sebastiao</p>
1165-
${link('about_web_label', 'https://www.visustruct.org', 'www.visustruct.org')}
1161+
${link('about_web_label', 'https://visustruct.visucode.de', 'visustruct.visucode.de')}
11661162
${link('about_developer_label', 'https://www.sebastiao.org', 'www.sebastiao.org')}
11671163
${link('about_project_github_label', 'https://github.com/code4teaching/VisuStruct', 'code4teaching/VisuStruct')}
11681164
</div>

‎web/src/ui/flowApp.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
import { gearIcon } from './app'
3030
import { buildDiagramPDF, canvasRGB, canvasToPNG, exportFilenameSlug, rasterize, svgMarkup, type ExportImage } from './exporter'
3131
import { currentLanguage, t } from './i18n'
32+
import { worldHomeURL } from './site'
3233
import { icons } from './icons'
3334
import { setVisuBotMode, setVisuObjectWorld, worldChooserHTML, type WorldChoice } from './visubotView'
3435

@@ -65,10 +66,7 @@ function store(key: string, value: string) {
6566
}
6667

6768
function siteURL(): string {
68-
const code = currentLanguage()
69-
const lang = code === 'pt-PT' ? 'pt' : code === 'de' ? 'de' : 'en'
70-
const base = /\/app\/(index\.html)?$/.test(location.pathname) ? '../' : 'https://visustruct.org/'
71-
return `${base}${lang}/index.html`
69+
return worldHomeURL('visustruct', currentLanguage())
7270
}
7371

7472
function download(name: string, data: BlobPart, type: string) {

0 commit comments

Comments
 (0)