Launch from the welcome only on a press made on its step, and keep it up if Stories refuses

From review:
- A press begun while the steps were changing and released after (a click
  aimed at NEXT) ran ENTER GOD MODE; a press now belongs to the step it
  began on. Keyboard activation is unchanged.
- BROWSE STORIES closed the card before asking Stories to open, so a
  refusal (another mode holding the globe) left nothing on screen; the card
  closes only once Stories opens.
- On phones a mission's error line was squeezed beside the checkbox and
  BACK; it takes its own row above the buttons.
- CURRENT-STATE calls the YouTube, X, Instagram, LinkedIn and bilawal.ai
  links the author's channels, as the card does.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju authored and Sameh Khamis committed 2026-11-18 17:00:10 -08:00
1 parent e342149a09
commit 0936da98a9
4 files changed
+53 -6

No files matched your search

+20
View File
@@ -182,7 +182,11 @@ test('a busy mission marks the choices aria-disabled, never disabled', async (t)
0,
'the new action cannot launch during the step transition',
);
// A press begun during the transition and released after it runs nothing.
enter.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true }));
await settle(frames);
enter.dispatchEvent(new MouseEvent('click', { bubbles: true, detail: 1 }));
assert.equal(calls, 0, 'a press held through the step change never launches');
assert.ok(
document.activeElement === enter,
'the primary action retains focus',
@@ -341,6 +345,22 @@ test('BROWSE STORIES closes the card and opens Stories in place', async (t) => {
assert.equal(opened, 1, 'a closing card cannot open Stories again');
});
test('BROWSE STORIES keeps the welcome up when Stories refuses to open', async (t) => {
const { root, pinia, frames, sessionStorageRef } = await launch(t);
const stories = useStoriesStore(pinia);
stories.connect({ open: () => false });
await move(root, frames);
await move(root, frames);
root.querySelector('[data-first-run-stories]').click();
await nextTick();
assert.equal(root.classList.contains('visible'), true, 'the card stays');
assert.equal(sessionStorageRef.read(), null, 'not dismissed');
assert.equal(
document.body.classList.contains('first-run-opening-stories'),
false,
);
});
test('the Stories card is left out where Stories is not offered', async (t) => {
const { root, pinia, frames } = await launch(t);
const stories = useStoriesStore(pinia);