mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(ui): render Provider Settings from a store
initKeySetup keeps the setup requests, the ChatGPT OAuth flow, the pasted field values and the dialog's keyboard, and publishes the POWER UP chip, the dialog, its key rows and the status line to the gev-provider-settings store. ProviderSettingsView renders them and sends clicks and typing to the connected owner; in Cyber the chip is teleported into the top toolbar. A successful save renders the rows afresh so no field keeps a key, and the status line announces a repeated message again. The voice action opens and closes the dialog through the same controls.
This commit is contained in:
1 parent
6cb01ff975
commit
fe963a1219
9 files changed
+840
-517
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { markRaw, shallowRef } from 'vue';
|
||||
|
||||
/**
|
||||
* Provider Settings (the dev-only key setup) as its view renders it. The
|
||||
* setup owner (src/keySetup.js) presents the POWER UP chip, the dialog, its
|
||||
* key rows, the field values and the status line, and publishes them here;
|
||||
* the view sends clicks and typing to the connected owner.
|
||||
*/
|
||||
export const useProviderSettingsStore = defineStore(
|
||||
'gev-provider-settings',
|
||||
() => {
|
||||
/** The presented setup; null until the owner first publishes. */
|
||||
const view = shallowRef(null);
|
||||
|
||||
/** @param {?object} next A fresh presentation; every publish re-renders. */
|
||||
function publish(next) {
|
||||
view.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
/** The setup owner the controls call, or null while none is wired. */
|
||||
const controls = shallowRef(null);
|
||||
|
||||
/** @param {?object} next The owner, or null to disconnect. */
|
||||
function connect(next) {
|
||||
controls.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
return { view, publish, controls, connect };
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user