diff --git a/packages/runtime/src/lesson-files.spec.ts b/packages/runtime/src/lesson-files.spec.ts index eee8f8f5e..927c9f4c7 100644 --- a/packages/runtime/src/lesson-files.spec.ts +++ b/packages/runtime/src/lesson-files.spec.ts @@ -1,3 +1,4 @@ +// where is global? import { describe, test, expect, beforeAll, vi, afterAll, beforeEach } from 'vitest'; import { LessonFilesFetcher } from './lesson-files.js'; diff --git a/packages/runtime/src/store/terminal.ts b/packages/runtime/src/store/terminal.ts index 90f64f18f..b79223186 100644 --- a/packages/runtime/src/store/terminal.ts +++ b/packages/runtime/src/store/terminal.ts @@ -27,6 +27,13 @@ export class TerminalStore { } hasTerminalPanel() { + // This condition checks if the 'metadata' object exists and whether the 'terminal' property within the metadata is explicitly set to 'false'. +// If the 'terminal' property is false, it returns 'false', which likely disables or hides the terminal in the user interface. +// However, if the 'metadata' object itself or the 'terminal' property is undefined or true, this condition is bypassed, and the terminal remains enabled. + + /*if(this.metadata && this.metadata.terminal === false) { + return false; + }*/ return this.terminalConfig.get().panels.length > 0; } diff --git a/packages/types/src/schemas/part.ts b/packages/types/src/schemas/part.ts index ce3682e1b..ed92b7432 100644 --- a/packages/types/src/schemas/part.ts +++ b/packages/types/src/schemas/part.ts @@ -9,6 +9,29 @@ export const partSchema = baseSchema.extend({ .describe( 'The list of chapters in this part. The order of this array defines the order of the chapters. If not specified a folder-based numbering system is used instead.', ), + terminal: z + .boolean() + .optional() + .describe('Controls whether the terminal is visible for this part. Defaults to true.'), }); export type PartSchema = z.infer; + +// This schema defines the structure of a "part" in the tutorial. +// The `type` is fixed as 'part', applying only to parts. +// `chapters` is an optional array to list chapters, ordered by folder if not provided. +// The `terminal` flag controls terminal visibility: `false` hides it, defaults to `true` (visible). +/*export const partSchema = baseSchema.extend({ + type: z.literal('part'), + chapters: z + .array(z.string()) + .optional() + .describe( + 'The list of chapters in this part. The order of this array defines the order of the chapters. If not specified a folder-based numbering system is used instead.', + ), + terminal: z + .boolean() + .optional() + .describe('Controls whether the terminal is visible for this part. Defaults to true.'), +}); +*/