experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

rename(hello-world): hello → hello world to match feature name

+14 -14
+4 -4
features/hello-world/home.html
··· 89 89 <pre>yarn test:electron:bg <span class="cmt"># background, logs to /tmp/test-electron.log</span> 90 90 yarn test:electron <span class="cmt"># foreground headless</span></pre> 91 91 <p><strong>Minimal Playwright test for a tile command:</strong></p> 92 - <pre>test(<span class="str">'hello command shows window'</span>, <span class="kw">async</span> ({ page }) =&gt; { 93 - <span class="kw">await</span> <span class="fn">runCommand</span>(page, <span class="str">'hello'</span>); 92 + <pre>test(<span class="str">'hello world command shows window'</span>, <span class="kw">async</span> ({ page }) =&gt; { 93 + <span class="kw">await</span> <span class="fn">runCommand</span>(page, <span class="str">'hello world'</span>); 94 94 <span class="kw">const</span> win = <span class="kw">await</span> app.<span class="fn">waitForWindow</span>(<span class="str">'Hello World'</span>); 95 95 <span class="kw">await</span> expect(win).<span class="fn">toBeDefined</span>(); 96 96 });</pre> ··· 173 173 // ── Register command ── 174 174 if (api.commands?.register) { 175 175 api.commands.register({ 176 - name: 'hello', 176 + name: 'hello world', 177 177 description: 'Open Hello World tile', 178 178 execute: async () => { 179 179 await api.window.showSelf(); 180 180 return { output: 'Hello World shown', mimeType: 'text/plain' }; 181 181 } 182 182 }); 183 - log('registered `hello` command (showSelf)', 'ok'); 183 + log('registered `hello world` command (showSelf)', 'ok'); 184 184 } 185 185 186 186 // ── Phase 3: datastore query ──
+1 -1
features/hello-world/manifest.json
··· 28 28 }, 29 29 "commands": [ 30 30 { 31 - "name": "hello", 31 + "name": "hello world", 32 32 "description": "Open Hello World tile (tutorial + debug)", 33 33 "action": { "type": "execute" } 34 34 }
+9 -9
tests/desktop/cmd-execute-twice.spec.ts
··· 4 4 * stalls — the result never comes back. This test pins that behavior 5 5 * down so the fix is verifiable. 6 6 * 7 - * Uses the hello-world tile because its `hello` command is the 7 + * Uses the hello-world tile because its `hello world` command is the 8 8 * simplest programmatic command in the codebase: a single tile entry 9 - * (resident `home`) that registers `hello` via 9 + * (resident `home`) that registers `hello world` via 10 10 * `api.commands.register(...)` with an async execute that returns a 11 11 * plain object. 12 12 */ ··· 26 26 // Wait for hello-world's command registration to actually reach the 27 27 // main-process pubsub bus. `waitForExtensionsReady` gates on feature 28 28 // *load* but not on the `cmd:register`/`cmd:register-batch` round- 29 - // trip that announces `hello` to the cmd panel. Firing before that 30 - // round-trip means zero subscribers exist for `cmd:execute:hello`. 29 + // trip that announces `hello world` to the cmd panel. Firing before that 30 + // round-trip means zero subscribers exist for `cmd:execute:hello world`. 31 31 // 32 32 // Approach: poll `api.features.list('builtin')` for hello-world 33 33 // presence, THEN do a single pubsub query-round-trip to confirm the ··· 51 51 const unsubscribe = api.subscribe('cmd:query-commands-response', (msg: unknown) => { 52 52 unsubscribe?.(); 53 53 const cmds = (msg as { commands?: Array<{ name: string }> })?.commands || []; 54 - resolve(cmds.some(c => c.name === 'hello')); 54 + resolve(cmds.some(c => c.name === 'hello world')); 55 55 }); 56 56 api.publish('cmd:query-commands', {}); 57 57 setTimeout(() => { unsubscribe?.(); resolve(false); }, 200); ··· 91 91 }, { cmdName: name, timeout: timeoutMs }); 92 92 } 93 93 94 - test('cmd:execute:hello returns a result on repeat invocations', async () => { 94 + test('cmd:execute:hello world returns a result on repeat invocations', async () => { 95 95 // First invocation — expected to succeed per manual repro. 96 - const first = await invoke(sharedBg, 'hello', 10000); 96 + const first = await invoke(sharedBg, 'hello world', 10000); 97 97 expect(first, 'first invocation result').toBeDefined(); 98 98 99 99 // Second invocation — user-reported stall happens here. 100 - const second = await invoke(sharedBg, 'hello', 10000); 100 + const second = await invoke(sharedBg, 'hello world', 10000); 101 101 expect(second, 'second invocation result (user-reported stall)').toBeDefined(); 102 102 103 103 // Third invocation — sanity check that it's not just a "works once" fluke. 104 - const third = await invoke(sharedBg, 'hello', 10000); 104 + const third = await invoke(sharedBg, 'hello world', 10000); 105 105 expect(third, 'third invocation result').toBeDefined(); 106 106 });