oxedyne/daimond/dev/shot_workspace.mjs
2.1 KiB, 1 run
created by r2519314175:207, 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_workspace.mjs — the arranging controls: the chip row, the appearance |
| 2 | // menu, the panel gallery and the palette. |
| 3 | import { open, shot, signInAs, errors } from './harness.mjs'; |
| 4 | |
| 5 | const s = await open({ name: 'workspace-shot', connect: false }); |
| 6 | const p = s.page; |
| 7 | await p.waitForTimeout(2500); |
| 8 | |
| 9 | await p.evaluate(async () => { |
| 10 | const mod = await import('../pkg/oxedyne_daimond.js'); |
| 11 | const app = new mod.DaimondApp('http://127.0.0.1/v1/chat/completions', '', 'none', 256, '', true); |
| 12 | await app.create_diamond('Ship the launch'); |
| 13 | }); |
| 14 | await p.reload({ waitUntil: 'domcontentloaded' }); |
| 15 | await signInAs(s, 'workspace-shot'); |
| 16 | await p.waitForTimeout(3000); |
| 17 | |
| 18 | // The Agents panel hides until the first agent runs, which would keep it out of |
| 19 | // both the row and the gallery -- reveal it so the shots show the whole fleet. |
| 20 | await p.evaluate(() => { |
| 21 | localStorage.setItem('daimond-agents-revealed', '1'); |
| 22 | document.body.classList.remove('agents-hidden'); |
| 23 | window.DaimondPanels.reflow(); |
| 24 | }); |
| 25 | await p.waitForTimeout(300); |
| 26 | await shot(s, 'ws-1-chips'); |
| 27 | |
| 28 | await p.click('#settings-menu-btn'); |
| 29 | await p.waitForTimeout(400); |
| 30 | await shot(s, 'ws-2-menu'); |
| 31 | |
| 32 | // The widest tiling, which is the thing the dock grid was asked for. |
| 33 | await p.evaluate(() => window.DaimondPanels.setGrid('2x3')); |
| 34 | await p.waitForTimeout(300); |
| 35 | await p.evaluate(() => { |
| 36 | ['agents', 'mail', 'work', 'spend'].forEach(id => window.DaimondPanels.show(id)); |
| 37 | }); |
| 38 | await p.waitForTimeout(500); |
| 39 | await shot(s, 'ws-3-dock-2x3'); |
| 40 | |
| 41 | await p.keyboard.press('Escape'); |
| 42 | await p.evaluate(() => { |
| 43 | // Unpin two, so the row has to overflow and the gallery earns its place. |
| 44 | window.DaimondPanels.setPinned('compose', false); |
| 45 | window.DaimondPanels.setPinned('tools', false); |
| 46 | }); |
| 47 | await p.waitForTimeout(400); |
| 48 | await shot(s, 'ws-4-overflow'); |
| 49 | |
| 50 | await p.click('#panel-more'); |
| 51 | await p.waitForTimeout(400); |
| 52 | await shot(s, 'ws-5-gallery'); |
| 53 | |
| 54 | await p.keyboard.press('Escape'); |
| 55 | await p.keyboard.press('Control+k'); |
| 56 | await p.waitForTimeout(400); |
| 57 | await p.keyboard.type('spe'); |
| 58 | await p.waitForTimeout(300); |
| 59 | await shot(s, 'ws-6-palette'); |
| 60 | |
| 61 | console.log('console errors:', JSON.stringify(errors(s))); |
| 62 | await s.close(); |
| 63 | console.log('shots written'); |