Oregami
Repositories/oxedyne/daimond

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.
3import { open, shot, signInAs, errors } from './harness.mjs';
4
5const s = await open({ name: 'workspace-shot', connect: false });
6const p = s.page;
7await p.waitForTimeout(2500);
8
9await 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});
14await p.reload({ waitUntil: 'domcontentloaded' });
15await signInAs(s, 'workspace-shot');
16await 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.
20await p.evaluate(() => {
21 localStorage.setItem('daimond-agents-revealed', '1');
22 document.body.classList.remove('agents-hidden');
23 window.DaimondPanels.reflow();
24});
25await p.waitForTimeout(300);
26await shot(s, 'ws-1-chips');
27
28await p.click('#settings-menu-btn');
29await p.waitForTimeout(400);
30await shot(s, 'ws-2-menu');
31
32// The widest tiling, which is the thing the dock grid was asked for.
33await p.evaluate(() => window.DaimondPanels.setGrid('2x3'));
34await p.waitForTimeout(300);
35await p.evaluate(() => {
36 ['agents', 'mail', 'work', 'spend'].forEach(id => window.DaimondPanels.show(id));
37});
38await p.waitForTimeout(500);
39await shot(s, 'ws-3-dock-2x3');
40
41await p.keyboard.press('Escape');
42await 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});
47await p.waitForTimeout(400);
48await shot(s, 'ws-4-overflow');
49
50await p.click('#panel-more');
51await p.waitForTimeout(400);
52await shot(s, 'ws-5-gallery');
53
54await p.keyboard.press('Escape');
55await p.keyboard.press('Control+k');
56await p.waitForTimeout(400);
57await p.keyboard.type('spe');
58await p.waitForTimeout(300);
59await shot(s, 'ws-6-palette');
60
61console.log('console errors:', JSON.stringify(errors(s)));
62await s.close();
63console.log('shots written');