Skip to content

Commit 81e8fd0

Browse files
Web 0.13.6: Lektionskopf oben fixiert, Zurück/Weiter im Kopf (#203)
Claude-Session: https://claude.ai/code/session_01Ugz28Ubj699xQDaZLZwKcC Co-authored-by: Claude <noreply@anthropic.com>
1 parent c883b8b commit 81e8fd0

12 files changed

Lines changed: 82 additions & 39 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
### Added
1010

11+
- **Web 0.13.6, lesson header pinned at the top:** in a lesson step the header (← Alle Lektionen, lesson title, step numbers, step title) stays at the top of the lesson column with its own ← Zurück / Weiter → buttons next to „Alle Lektionen“; only the step content below scrolls. The buttons at the end of the step stay as well.
1112
- **Web 0.13.4, Pseudocode switch in the toolbar and simulation of pseudocode:** the checkbox „Pseudocode“ now sits in the toolbar left of ⇄ (before it was only in the code window). For a diagram marked as pseudocode (e.g. „Tee kochen“ in Lektion 1) the simulation no longer runs the boxes as Java: it only highlights them one after another, and for a condition („Regnet es?“), a loop or a Fallauswahl it asks for the answer (true/false or ja/nein, case name). Programmieren shows no Java errors for pseudocode. Lektion 1 now mentions spaghetti code right where it says a Struktogramm has no jumps.
1213
- **Web 0.13.3, Struktogramm and Elemente in the code block colours:** the Struktogramm uses the same soft colours as the blocks in Programmieren: statements yellow like the method, loops (for, while, do-until, endless) pink, Verzweigung and Fallauswahl blue; elements inside a loop or branch take its colour, so code and diagram side by side show the matching blocks at a glance. The boxes in „Elemente“ get the same colours. The setting is now called „Blöcke farbig“ and switches code, diagram and Elemente together; a colour stored in the file still wins, and exports stay white. Lesson 1 uses the same colours (statements yellow, branch blue, loop pink; the sequence itself has no colour, it is the row of statements).
1314
- **Web 0.13.1, divider between Struktogramm and Programmieren always draggable:** with four open columns (lessons, Struktogramm, Programmieren, „mBot2 live“) the diagram sat at its minimum width and the divider barely moved. Dragging it now first uses the space of the two columns next to it, then takes width from „mBot2 live“, then from the lessons and files columns (down to their minimum widths). Works in both orders after ⇄; all widths are remembered.

‎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.13.4",
4+
"version": "0.13.6",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

‎web/src/ui/learnPanel.ts‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,18 @@ export class LearnPanel {
259259
return b
260260
}),
261261
)
262+
// Kopf mit Zurück/Weiter bleibt oben stehen, nur der Inhalt darunter scrollt.
262263
this.body.append(
263-
back,
264-
h('p', { class: 'learn-kicker' }, `${t('web_learn_lesson_fmt', lesson.number)} · ${lesson.section}${lesson.robot ? ' · 🤖 VisuBot' : ''}`),
265-
// Dieselbe Nummer wie in der Liste, gut sichtbar neben dem Titel.
266-
h('h2', { class: 'learn-title' }, h('span', { class: 'learn-num', 'aria-hidden': 'true' }, String(lesson.number)), lesson.title),
267-
bar,
268-
h('h3', { class: 'learn-step-title' }, `${index + 1}. ${step.title}`),
264+
h(
265+
'div',
266+
{ class: 'learn-lesson-head' },
267+
h('div', { class: 'learn-head-row' }, back, this.stepNav(lesson, index, p.done, 'learn-nav learn-nav-top')),
268+
h('p', { class: 'learn-kicker' }, `${t('web_learn_lesson_fmt', lesson.number)} · ${lesson.section}${lesson.robot ? ' · 🤖 VisuBot' : ''}`),
269+
// Dieselbe Nummer wie in der Liste, gut sichtbar neben dem Titel.
270+
h('h2', { class: 'learn-title' }, h('span', { class: 'learn-num', 'aria-hidden': 'true' }, String(lesson.number)), lesson.title),
271+
bar,
272+
h('h3', { class: 'learn-step-title' }, `${index + 1}. ${step.title}`),
273+
),
269274
)
270275
const ret = this.returnTo?.lesson === lesson.id && this.returnTo.step !== index ? this.returnTo : undefined
271276
const backToChecklist = () => {
@@ -284,7 +289,13 @@ export class LearnPanel {
284289
this.openNeededColumns(step.blocks)
285290
markTerms(this.body, glossary)
286291

287-
const nav = h('div', { class: 'learn-nav' })
292+
this.body.append(this.stepNav(lesson, index, p.done, 'learn-nav'))
293+
if (ret) this.body.append(backToChecklist())
294+
}
295+
296+
/** Zurück/Weiter (im letzten Schritt „Fertig“): oben im Kopf und unten nach dem Text. */
297+
private stepNav(lesson: Lesson, index: number, done: boolean | undefined, class_: string) {
298+
const nav = h('div', { class: class_ })
288299
const prev = h('button', {}, `← ${t('web_learn_back')}`) as HTMLButtonElement
289300
prev.disabled = index === 0
290301
prev.addEventListener('click', () => this.goToStep(lesson, index - 1))
@@ -294,16 +305,15 @@ export class LearnPanel {
294305
next.addEventListener('click', () => this.goToStep(lesson, index + 1))
295306
nav.append(next)
296307
} else {
297-
const finish = h('button', { class: 'primary' }, p.done ? `✓ ${t('web_learn_done')}` : t('web_learn_finish'))
308+
const finish = h('button', { class: 'primary' }, done ? `✓ ${t('web_learn_done')}` : t('web_learn_finish'))
298309
finish.addEventListener('click', () => {
299310
progress.updateLesson(lesson.id, { done: true })
300311
const following = lessons.find((l) => l.number === lesson.number + 1)
301312
this.openLesson(following?.id)
302313
})
303314
nav.append(finish)
304315
}
305-
this.body.append(nav)
306-
if (ret) this.body.append(backToChecklist())
316+
return nav
307317
}
308318

309319
private goToStep(lesson: Lesson, step: number) {

‎web/src/ui/styles.css‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,38 @@ button.danger-text:not(:disabled) {
15091509
padding: 0;
15101510
text-align: start;
15111511
}
1512+
/* Lektionskopf bleibt oben stehen, nur der Schritt darunter scrollt. */
1513+
.learn-lesson-head {
1514+
position: sticky;
1515+
top: -4px;
1516+
z-index: 3;
1517+
margin: -4px -16px 10px;
1518+
padding: 4px 16px 8px;
1519+
background: var(--panel);
1520+
border-bottom: 1px solid var(--border);
1521+
}
1522+
.learn-lesson-head .learn-progress {
1523+
margin-bottom: 8px;
1524+
}
1525+
.learn-lesson-head .learn-step-title {
1526+
margin: 0;
1527+
}
1528+
.learn-head-row {
1529+
display: flex;
1530+
align-items: center;
1531+
justify-content: space-between;
1532+
gap: 8px;
1533+
flex-wrap: wrap;
1534+
}
1535+
.learn-nav.learn-nav-top {
1536+
margin-top: 0;
1537+
gap: 6px;
1538+
}
1539+
.learn-nav-top button {
1540+
padding: 3px 10px;
1541+
min-height: 0;
1542+
font-size: 13px;
1543+
}
15121544
.learn-kicker {
15131545
margin: 4px 0 0;
15141546
color: var(--muted);

‎website/app/assets/index-B-A0tKyY.css‎

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

‎website/app/assets/index-BEDgt2SF.css‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)