···117117 await closeWindow(sharedBgWindow, result2.id);
118118 });
119119120120+ test('opening a URL with a key does NOT reuse a keyless window with the same URL', async () => {
121121+ // Regression: slides set address=http://localhost/ and key=address:edge.
122122+ // When a page-host already has http://localhost/ open (no key), pressing
123123+ // Option+Up used to fall through key-reuse → URL-reuse → got attached to
124124+ // the page-host's window instead of opening a fresh edge-anchored slide.
125125+ // An explicit key signals "I manage identity by key" — URL-reuse must skip.
126126+ const url = 'https://example.com/keyless-vs-keyed';
127127+128128+ // Open WITHOUT a key (the "existing page-host" stand-in)
129129+ const keylessResult = await openUrl(sharedBgWindow, url);
130130+ expect(keylessResult.success).toBe(true);
131131+ expect(keylessResult.reused).toBeFalsy();
132132+133133+ // Open SAME URL but WITH a key — must NOT reuse the keyless window
134134+ const keyedResult = await openUrl(sharedBgWindow, url, { key: 'keyed-slot-A' });
135135+ expect(keyedResult.success).toBe(true);
136136+ expect(keyedResult.reused).toBeFalsy();
137137+ expect(keyedResult.id).not.toBe(keylessResult.id);
138138+139139+ // Opening with the same key again reuses the keyed window (key-reuse)
140140+ const keyedAgain = await openUrl(sharedBgWindow, url, { key: 'keyed-slot-A' });
141141+ expect(keyedAgain.success).toBe(true);
142142+ expect(keyedAgain.reused).toBe(true);
143143+ expect(keyedAgain.id).toBe(keyedResult.id);
144144+145145+ // Clean up
146146+ await closeWindow(sharedBgWindow, keylessResult.id);
147147+ await closeWindow(sharedBgWindow, keyedResult.id);
148148+ });
149149+120150 test('key-based window reuse still works', async () => {
121151 const url = 'https://example.com/key-test';
122152 const key = 'test-key-reuse';