Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/QUALITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ QUEUELAB_URL=http://127.0.0.1:4173 QUEUELAB_UX_PHASE=core node scripts/ux-smoke.

The script uses isolated browser contexts and synthetic models. It requires Playwright browser binaries; it does not install them. Generated screenshots and files stay outside version control.

Run `QUEUELAB_URL=http://127.0.0.1:4173 npm run test:learning` for the first experiment: real selection/edit/run/compare/template save at desktop and 320/390 px, keyboard focus, reduced motion, refresh, original-project/history restoration, storage errors and cancelled loading. Other smoke checks use the welcome's public **Explore on my own** path before testing the workspace.

The facility flow has a separate isolated smoke command:

```sh
Expand Down
10 changes: 10 additions & 0 deletions docs/QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Quickstart

## Learn by doing

On your first visit, choose **Start my first experiment**. You can also open **Learn by doing** from the playground at any time.

The five-step exercise opens a separate Service Studio project. Select **Specialists**, change its shared team from **2** to **3**, run the changed plan, compare completed work, waiting and resource cost, then optionally save your own template. The guide highlights the actual controls and follows your applied edits and completed calculations.

You can minimize or leave the guide at any time. Existing work is saved before practice starts; **Back to my previous project** reopens it. Refreshing an active practice restores its saved draft and asks you to run again before comparing. Templates and projects stay in this browser; download project JSON for a portable backup.

Choose **Explore on my own** to start without the exercise, or **Just show me the controls** for a short reference tour.

## Open a world

Open **[the live demo](https://berkebasbay.github.io/loopset/)**. No installation or account is required.
Expand Down
10 changes: 9 additions & 1 deletion docs/UX_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ Start with a process question: which arrival rate, processing time, team or wait

**Tools → A little guidance → Watch the video demos** opens the English quick tour and full walkthrough in a new tab, leaving the current project open.

**How it works** in the world opens the optional three-step guide: change one thing, run the changed plan, compare and keep it. On a phone, select a world object and use **Edit selected step** below the scene. Scenario settings links directly to arrivals and related team controls.
**Learn by doing → Just show me the controls** opens the optional three-step guide: change one thing, run the changed plan, compare and keep it. On a phone, select a world object and use **Edit selected step** below the scene. Scenario settings links directly to arrivals and related team controls.

The team’s base availability is visible in Properties. Installed capacity, cost and shifts have their own disclosures. A capacity note explains when the base team cannot staff every parallel station; shared use and calendar overrides remain separate limits. Short duration readouts retain the exact editable value when focused.

## Guided first experiment

**Learn by doing** opens a five-step Service Studio practice: select Specialists, apply a shared-team change, calculate, read the comparison and optionally save a reusable template. Progress follows real edits and completed runs. Highlighted controls remain ordinary editor controls with the same validation and Undo behavior.

The guide can be minimized or dismissed. It preserves an existing project before switching, offers a return action and resumes a saved practice after refresh. If you change other numerical inputs, it lets you keep exploring or start a fresh practice. Failed calculations and template saves remain incomplete and can be retried. The optional finish path explicitly says that no template was saved.

A first-visit welcome is shown only when no saved project is restored. Returning users can start the exercise from the playground. **Just show me the controls** retains the short reference tour.

## Start from a template

**Templates** contains twelve facilities, including Workshop, Factory, Festival and Service, alongside **Blank**, a site with no objects or process steps. Search or filter by category, inspect a preview and its assumptions, then choose **Open this template**. The Asset library also offers **Empty site**. Place objects first; choose **Start a process** when ready to add a runnable flow.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "queuelab",
"version": "1.0.0-rc.14",
"version": "1.0.0-rc.15",
"private": true,
"type": "module",
"description": "A playable process and capacity simulation laboratory",
Expand All @@ -15,6 +15,7 @@
"simulate": "node scripts/simulate.mjs",
"examples:export": "npm run build:engine && node scripts/export-examples.mjs",
"test:headless": "npm run build:engine && node examples/verify.mjs",
"test:learning": "node scripts/learning-smoke.mjs",
"test:ux": "node scripts/ux-smoke.mjs",
"setup:hooks": "node scripts/setup-hooks.mjs",
"check:publication": "node scripts/check-publication.mjs",
Expand Down
4 changes: 2 additions & 2 deletions scripts/facility-edge-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import assert from 'node:assert/strict';
import * as THREE from 'three';
import { headerProjectInput, runPlan } from './ui-actions.mjs';
import { dismissLearningWelcome, headerProjectInput, runPlan } from './ui-actions.mjs';

const origin = new URL(process.env.QUEUELAB_URL || 'http://127.0.0.1:4173/');
assert(['localhost', '127.0.0.1'].includes(origin.hostname));
Expand All @@ -18,7 +18,7 @@ const ready = page => page.waitForFunction(() => { const state = JSON.parse(wind
async function fresh(width = 1440) {
const context = await browser.newContext({ viewport: { width, height: 1000 }, reducedMotion: 'reduce', acceptDownloads: true });
const page = await context.newPage(); page.on('pageerror', error => errors.push(String(error)));
await page.goto(origin.href); await ready(page);
await page.goto(origin.href); await dismissLearningWelcome(page); await ready(page);
// Use the original numerical fixture for these compatibility checks.
if (width > 740) { await page.locator('.studio-world-picker select').selectOption('factory'); await ready(page); }
const pause = page.getByRole('button', { name: 'Pause replay', exact: true }); if (await pause.count()) await pause.click();
Expand Down
3 changes: 2 additions & 1 deletion scripts/facility-navigation-smoke.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { dismissLearningWelcome } from './ui-actions.mjs';
import { chromium } from 'playwright';
import fs from 'node:fs/promises';
import path from 'node:path';
Expand All @@ -9,7 +10,7 @@ await fs.mkdir(out, { recursive: true }); await fs.mkdir('.cache/tmp', { recursi
let installed = true; try { await fs.access(chromium.executablePath()); } catch { installed = false; }
const browser = await chromium.launch({ headless: true, ...(installed ? { executablePath: chromium.executablePath() } : { channel: 'chrome' }) });
const errors = [], checks = []; let page;
async function fresh(width) { const context = await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: 'reduce', acceptDownloads: true }); const p = await context.newPage(); p.on('pageerror', e => errors.push(String(e))); await p.goto(origin.href); await p.waitForFunction(() => { const s = JSON.parse(window.render_game_to_text?.() || '{}'); return !s.running && s.result?.status === 'completed' && !s.result.stale; }); const pause = p.getByRole('button', { name: 'Pause replay', exact: true }); if (await pause.count()) await pause.click(); return { context, page: p }; }
async function fresh(width) { const context = await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: 'reduce', acceptDownloads: true }); const p = await context.newPage(); p.on('pageerror', e => errors.push(String(e))); await p.goto(origin.href); await dismissLearningWelcome(p); await p.waitForFunction(() => { const s = JSON.parse(window.render_game_to_text?.() || '{}'); return !s.running && s.result?.status === 'completed' && !s.result.stale; }); const pause = p.getByRole('button', { name: 'Pause replay', exact: true }); if (await pause.count()) await pause.click(); return { context, page: p }; }
async function download(p, name) { const next = p.waitForEvent('download'); await p.locator('.studio-save').click(); const file = await next, target = path.join(out, name); await file.saveAs(target); return JSON.parse(await fs.readFile(target, 'utf8')); }
try {
const mobile = await fresh(390); page = mobile.page;
Expand Down
4 changes: 2 additions & 2 deletions scripts/facility-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { chromium } from 'playwright';
import fs from 'node:fs/promises';
import path from 'node:path';
import assert from 'node:assert/strict';
import { headerProjectInput, openPanel, runPlan, canvasDropPoint } from './ui-actions.mjs';
import { dismissLearningWelcome, headerProjectInput, openPanel, runPlan, canvasDropPoint } from './ui-actions.mjs';

const origin = new URL(process.env.QUEUELAB_URL || 'http://127.0.0.1:4173/');
assert(['127.0.0.1', 'localhost'].includes(origin.hostname), 'Use a separate loopback QA origin.');
Expand All @@ -18,7 +18,7 @@ const ready = page => page.waitForFunction(() => { const s = JSON.parse(window.r
async function fresh(width = 1440) {
const context = await browser.newContext({ viewport: { width, height: 1000 }, reducedMotion: 'reduce', acceptDownloads: true });
const page = await context.newPage(); page.on('pageerror', error => errors.push(String(error)));
await page.goto(origin.href); await ready(page);
await page.goto(origin.href); await dismissLearningWelcome(page); await ready(page);
// Use the original numerical fixture for these compatibility checks.
await page.locator('.studio-world-picker select').selectOption('factory'); await ready(page);
const pause = page.getByRole('button', { name: 'Pause replay', exact: true }); if (await pause.count()) await pause.click();
Expand Down
4 changes: 2 additions & 2 deletions scripts/facility-workspace-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { chromium } from 'playwright';
import fs from 'node:fs/promises';
import path from 'node:path';
import assert from 'node:assert/strict';
import { headerProjectInput, runPlan, canvasDropPoint } from './ui-actions.mjs';
import { dismissLearningWelcome, headerProjectInput, runPlan, canvasDropPoint } from './ui-actions.mjs';
const origin = new URL(process.env.QUEUELAB_URL || 'http://127.0.0.1:4173/');
assert(['localhost', '127.0.0.1'].includes(origin.hostname), 'Use an isolated QA origin.');
const out = path.resolve(process.env.QUEUELAB_EVIDENCE_DIR || '.private/evidence/facility-redesign/workspace');
Expand All @@ -13,7 +13,7 @@ const checks = [], errors = [];
const state = p => p.evaluate(() => JSON.parse(window.render_game_to_text()));
const ready = p => p.waitForFunction(() => { const s = JSON.parse(window.render_game_to_text?.() || '{}'); return !document.querySelector('.studio-world-picker select')?.disabled && !s.running && s.result?.status === 'completed' && !s.result.stale; });
async function artwork(p) { await p.waitForFunction(() => { const e = document.querySelector('.world-scene'), s = JSON.parse(e?.getAttribute('data-facility') || '{}'); return e?.getAttribute('data-status') === 'ready' && s.pending === 0 && s.failed === 0; }); }
async function fresh(width) { const context = await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: 'reduce', acceptDownloads: true }); const page = await context.newPage(); page.on('pageerror', e => errors.push(String(e))); await page.goto(origin.href); await ready(page); await artwork(page); const pause = page.getByRole('button', { name: 'Pause replay', exact: true }); if (await pause.count()) await pause.click(); return { context, page }; }
async function fresh(width) { const context = await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: 'reduce', acceptDownloads: true }); const page = await context.newPage(); page.on('pageerror', e => errors.push(String(e))); await page.goto(origin.href); await dismissLearningWelcome(page); await ready(page); await artwork(page); const pause = page.getByRole('button', { name: 'Pause replay', exact: true }); if (await pause.count()) await pause.click(); return { context, page }; }
async function download(p, name) { const next = p.waitForEvent('download'); await p.locator('.studio-save').click(); const file = await next, target = path.join(out, name); await file.saveAs(target); return JSON.parse(await fs.readFile(target, 'utf8')); }
async function findModel(p) { const tray = p.locator('.facility-library'); if (!await tray.isVisible()) await p.locator('[data-build-opener]').click(); await tray.locator('.library-tabs').getByRole('button', { name: '3D models', exact: true }).click(); await tray.getByRole('searchbox', { name: 'Search equipment and objects', exact: true }).fill('Dispensing system'); const tile = tray.getByRole('button', { name: 'Dispensing system · C01', exact: true }); await tile.click(); return { tray, tile }; }
let page;
Expand Down
4 changes: 2 additions & 2 deletions scripts/interface-polish-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { chromium } from 'playwright';
import fs from 'node:fs/promises';
import path from 'node:path';
import assert from 'node:assert/strict';
import { openPanel, runPlan } from './ui-actions.mjs';
import { dismissLearningWelcome, openPanel, runPlan } from './ui-actions.mjs';
const origin = new URL(process.env.QUEUELAB_URL || 'http://127.0.0.1:4173/');
assert(['127.0.0.1','localhost'].includes(origin.hostname), 'Use an isolated QA origin.');
const out = path.resolve(process.env.QUEUELAB_EVIDENCE_DIR || '.private/evidence/interface-polish/checks');
Expand All @@ -12,7 +12,7 @@ const browser=await chromium.launch({headless:true,...(installed?{executablePath
const errors=[],checks=[];let page,stage='start';
const state=p=>p.evaluate(()=>JSON.parse(window.render_game_to_text()));
async function ready(p){await p.waitForFunction(()=>{const s=JSON.parse(window.render_game_to_text?.()||'{}');return !document.querySelector('.studio-world-picker select')?.disabled && !s.running&&s.result?.status==='completed'&&!s.result.stale})}
async function fresh(width=1440,height=960){const context=await browser.newContext({viewport:{width,height},reducedMotion:'reduce',acceptDownloads:true});const p=await context.newPage();p.on('pageerror',e=>errors.push(String(e)));await p.goto(origin.href);await ready(p);const pause=p.getByRole('button',{name:'Pause replay',exact:true});if(await pause.count())await pause.click();return{context,page:p}}
async function fresh(width=1440,height=960){const context=await browser.newContext({viewport:{width,height},reducedMotion:'reduce',acceptDownloads:true});const p=await context.newPage();p.on('pageerror',e=>errors.push(String(e)));await p.goto(origin.href); await dismissLearningWelcome(p);await ready(p);const pause=p.getByRole('button',{name:'Pause replay',exact:true});if(await pause.count())await pause.click();return{context,page:p}}
async function download(p,name){const next=p.waitForEvent('download');await p.locator('.studio-save').click();const file=await next,target=path.join(out,name);await file.saveAs(target);return JSON.parse(await fs.readFile(target,'utf8'))}
async function screenshot(name){await page.screenshot({path:path.join(out,name+'.png')})}
async function overflow(p){assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+1));const dialog=p.getByRole('dialog');if(await dialog.count())assert(await dialog.evaluate(e=>e.getBoundingClientRect().right<=innerWidth+1&&e.getBoundingClientRect().left>=-1));}
Expand Down
Loading
Loading