feat(02-07): stable AIUI embed URL carrying both D-14 defaults
Demo images / Build & push demo images (push) Failing after 2m16s
Demo images / Build & push demo images (push) Failing after 2m16s
aiuiUrl now appends chatExpanded=true and mobileChat=true alongside
the pre-existing embedded=true and hideClose=true. Both are static
strings with no reactive dependency, so the computed's value never
changes after first evaluation — preserving the URL-stability
contract 02-04 relies on to keep the AIUI iframe from reloading on a
tab switch.
AIUI reads these two flags (commit 900c0b9 in the AIUI checkout,
recorded in 02-AIUI-D14.md) to start the chat expanded and, on
mobile, on the chat view rather than the context view. The deployed
AIUI build on any node does not yet carry that commit (anonymous push
to the AIUI remote was rejected — see 02-AIUI-D14.md's Deployment
Impact), so neode-ui's two new query params are inert no-ops against
today's deployed AIUI until that commit is merged and shipped; both
flags are additive and harmless in the meantime.
New test file chatAiuiEmbed.test.ts covers: both D-14 flags plus the
pre-existing embedded/hideClose params present in the URL; URL
string-equality across a simulated viewport resize and across a
KeepAlive deactivate/reactivate cycle; onAiuiMessage still rejecting
a foreign-origin message; and aiuiConnected surviving a
deactivate/reactivate cycle.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
8d2ce96eee
commit
e2b2ade3b2
@@ -71,13 +71,25 @@ const aiuiFrame = ref<HTMLIFrameElement | null>(null)
|
||||
const aiuiConnected = ref(false)
|
||||
let broker: ContextBroker | null = null
|
||||
|
||||
// D-14 presentation flags (Phase 02 Plan 07, 02-AIUI-D14.md): AIUI opens
|
||||
// already expanded (chatExpanded) and, on a mobile viewport, on its chat view
|
||||
// rather than its context view (mobileChat). Both are static strings — never
|
||||
// derived from a reactive viewport read, connection state, or timestamp — so
|
||||
// the computed below has no reactive dependencies and its value never
|
||||
// changes after first evaluation, which is exactly what keeps the iframe
|
||||
// `src` byte-identical across re-renders, resizes, and deactivate/reactivate
|
||||
// cycles (the load-bearing constraint that lets the AIUI panel survive a tab
|
||||
// switch without reloading). AIUI decides how to apply mobileChat against its
|
||||
// own viewport rather than neode-ui's, per 02-AIUI-D14.md's D-14b rationale.
|
||||
const D14_FLAGS = 'chatExpanded=true&mobileChat=true'
|
||||
|
||||
const aiuiUrl = computed(() => {
|
||||
// Demo: ?mockArchy makes AIUI use its built-in mock node data (apps, system,
|
||||
// network, wallet, bitcoin, files) and &seed pre-loads the example chats.
|
||||
const demo = IS_DEMO ? '&mockArchy=1&seed=1' : ''
|
||||
const envUrl = import.meta.env.VITE_AIUI_URL
|
||||
if (envUrl) return `${envUrl}?embedded=true&hideClose=true${demo}`
|
||||
if (import.meta.env.PROD || IS_DEMO) return `/aiui/?embedded=true&hideClose=true${demo}`
|
||||
if (envUrl) return `${envUrl}?embedded=true&hideClose=true&${D14_FLAGS}${demo}`
|
||||
if (import.meta.env.PROD || IS_DEMO) return `/aiui/?embedded=true&hideClose=true&${D14_FLAGS}${demo}`
|
||||
return ''
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user