oxedyne/daimond/dev/shot_typescale.mjs
1.4 KiB, 1 run
created by r2519314175:203, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | // shot_typescale.mjs — the reading-size control, at every step of the scale. |
| 2 | // |
| 3 | // The claim the first shot exists to test is that moving 253 literal px sizes onto |
| 4 | // tokens changed NOTHING at scale 1. That is checkable rather than arguable: shoot |
| 5 | // the app with the tokens in place, shoot it again with the stylesheets reverted, |
| 6 | // and diff. The rest of the shots are the point of the exercise -- the type growing |
| 7 | // while the frame stays where it is. |
| 8 | import { open, shot, signInAs } from './harness.mjs'; |
| 9 | |
| 10 | const s = await open({ name: 'typescale', connect: false }); |
| 11 | const p = s.page; |
| 12 | await p.waitForTimeout(2500); |
| 13 | |
| 14 | // Something to read, so the scale has text to act on rather than empty panels. |
| 15 | await p.evaluate(async () => { |
| 16 | const mod = await import('../pkg/oxedyne_daimond.js'); |
| 17 | const app = new mod.DaimondApp('http://127.0.0.1/v1/chat/completions', '', 'none', 256, '', true); |
| 18 | await app.create_diamond('Ship the launch'); |
| 19 | await app.create_diamond('Brand voice'); |
| 20 | }); |
| 21 | await p.reload({ waitUntil: 'domcontentloaded' }); |
| 22 | await signInAs(s, 'typescale'); |
| 23 | await p.waitForTimeout(3000); |
| 24 | |
| 25 | const label = process.env.SHOT_LABEL || 'scale'; |
| 26 | |
| 27 | for (const step of ['0.85', '1', '1.15', '1.3']) { |
| 28 | await p.evaluate((v) => { |
| 29 | document.documentElement.style.setProperty('--fs-scale', v); |
| 30 | }, step); |
| 31 | await p.waitForTimeout(400); |
| 32 | await shot(s, `${label}-${step.replace('.', '_')}`); |
| 33 | } |
| 34 | |
| 35 | await s.close(); |
| 36 | console.log('shots written'); |