mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(first-run): render the mission launcher from a store
initFirstRunExperience no longer writes the launcher card's classes, attributes and text, wires its listeners or removes it: it presents the card's visibility, busy state, status line, copy and scroll fade to the gev-first-run store and connects the controls the welcome view's choices, DISMISS and "Don't show this again" call. A refused save hands the tick back to the view to revert. The launcher still reads the rendered card for its hit test, keyboard trap, focus and overflow measurement. The owner-chosen copy moves to src/firstRunCopy.js, shared by both. The source-text tests give way to component tests, and the first-run mutation QA follows the new code (67/67 caught).
This commit is contained in:
1 parent
c03b4a7643
commit
0adcd61184
11 files changed
+447
-179
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { markRaw, shallowRef } from 'vue';
|
||||
|
||||
/**
|
||||
* The first-run mission launcher as the welcome view renders it.
|
||||
* initFirstRunExperience presents it and connects the controls its buttons
|
||||
* and checkbox call.
|
||||
*/
|
||||
export const useFirstRunStore = defineStore('gev-first-run', () => {
|
||||
/**
|
||||
* `{removed, shown, visible, closing, state, busy, status, description,
|
||||
* environmentalTitle, environmentalSub, scrollable}`, or null until the
|
||||
* launcher is initialized (the card stays hidden).
|
||||
*/
|
||||
const launcher = shallowRef(null);
|
||||
|
||||
/** @param {?object} next A fresh presentation; every publish re-renders. */
|
||||
function publish(next) {
|
||||
launcher.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
/** `{choose(choice), dismiss(), suppress(wanted) → boolean}`, or null. */
|
||||
const controls = shallowRef(null);
|
||||
|
||||
/** @param {?object} next The launcher's controls, or null to disconnect. */
|
||||
function connect(next) {
|
||||
controls.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
return { launcher, publish, controls, connect };
|
||||
});
|
||||
Reference in new issue
Block a user