@cat-factory/app 0.315.4 → 0.315.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/app/components/bootstrap/BootstrapModal.vue +1 -1
- package/app/components/common/ConfirmDialog.vue +5 -28
- package/app/components/common/TakeoverShell.vue +97 -0
- package/app/components/focus/BlockFocusView.vue +24 -3
- package/app/components/github/AddServiceFromRepoModal.vue +2 -2
- package/app/components/github/GitHubPanel.vue +1 -1
- package/app/components/kaizen/KaizenPanel.vue +6 -11
- package/app/components/media/ArtifactLightbox.vue +13 -21
- package/app/components/observability/StepModelActivity.vue +1 -0
- package/app/components/panels/AgentStepDetail.vue +8 -12
- package/app/components/panels/InspectorPanel.vue +6 -1
- package/app/components/panels/ObservabilityPanel.vue +7 -11
- package/app/components/panels/OperatorDashboardPanel.vue +6 -11
- package/app/components/panels/ReportsPanel.vue +6 -11
- package/app/components/panels/inspector/ServiceTestConfig.vue +2 -2
- package/app/components/pipeline/PipelineBuilder.vue +4 -0
- package/app/components/settings/ModelConfigurationPanel.vue +21 -13
- package/app/plugins/foreign-layers.client.ts +8 -0
- package/app/stores/github/connection.ts +2 -4
- package/app/stores/github/context.ts +5 -1
- package/app/stores/github/projectionLoad.ts +127 -0
- package/app/stores/github/repoActions.ts +7 -2
- package/app/stores/github.spec.ts +355 -1
- package/app/stores/github.ts +21 -22
- package/app/stores/ui/builderModelConfigHandoff.spec.ts +88 -0
- package/app/stores/ui/modals.ts +78 -12
- package/app/utils/foreignLayers.spec.ts +100 -0
- package/app/utils/foreignLayers.ts +71 -0
- package/i18n/locales/de.json +1 -0
- package/i18n/locales/en.json +1 -0
- package/i18n/locales/es.json +1 -0
- package/i18n/locales/fr.json +1 -0
- package/i18n/locales/he.json +1 -0
- package/i18n/locales/it.json +1 -0
- package/i18n/locales/ja.json +1 -0
- package/i18n/locales/pl.json +1 -0
- package/i18n/locales/tr.json +1 -0
- package/i18n/locales/uk.json +1 -0
- package/package.json +1 -1
package/app/stores/github.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { useServicesStore } from '~/stores/services'
|
|
|
20
20
|
import { pullKey, type GitHubStoreContext } from '~/stores/github/context'
|
|
21
21
|
import { createGitHubConnectionActions } from '~/stores/github/connection'
|
|
22
22
|
import { createGitHubProbe } from '~/stores/github/probe'
|
|
23
|
+
import { createGitHubProjectionLoad } from '~/stores/github/projectionLoad'
|
|
23
24
|
import { createGitHubRepoActions } from '~/stores/github/repoActions'
|
|
24
25
|
import { createVcsConnectActions, createVcsProviderViews } from '~/stores/github/vcsConnect'
|
|
25
26
|
|
|
@@ -138,23 +139,20 @@ export const useGitHubStore = defineStore('github', () => {
|
|
|
138
139
|
return branchWebUrl(providerOfRepo(repoGithubId), repoUrl(repoGithubId), branch)
|
|
139
140
|
}
|
|
140
141
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
loading.value = false
|
|
156
|
-
}
|
|
157
|
-
}
|
|
142
|
+
// The projection read and the record of whether it is loaded for this workspace.
|
|
143
|
+
const projection = createGitHubProjectionLoad({
|
|
144
|
+
api,
|
|
145
|
+
workspace,
|
|
146
|
+
connection,
|
|
147
|
+
repos,
|
|
148
|
+
pulls,
|
|
149
|
+
issues,
|
|
150
|
+
loading,
|
|
151
|
+
})
|
|
152
|
+
/** Reload the cached repos, pull requests and issues after a write. */
|
|
153
|
+
const load = projection.load
|
|
154
|
+
/** Reload them on demand, sharing a read already in flight. */
|
|
155
|
+
const refresh = projection.refresh
|
|
158
156
|
|
|
159
157
|
/** Full file listing per repo (recursive tree), cached by GitHub numeric id. */
|
|
160
158
|
const repoFiles = ref<Record<number, RepoTreeEntry[]>>({})
|
|
@@ -184,6 +182,8 @@ export const useGitHubStore = defineStore('github', () => {
|
|
|
184
182
|
syncing,
|
|
185
183
|
connected,
|
|
186
184
|
load,
|
|
185
|
+
markWritten: projection.markWritten,
|
|
186
|
+
clearProjection: projection.clearProjection,
|
|
187
187
|
}
|
|
188
188
|
// The board-load probe (integration availability + the bound connection + the connect options +
|
|
189
189
|
// the credential check). Built from the context rather than inline, so this setup stays within
|
|
@@ -193,11 +193,11 @@ export const useGitHubStore = defineStore('github', () => {
|
|
|
193
193
|
/**
|
|
194
194
|
* Ensure the projection (repos/PRs/issues) is loaded at least once — for views
|
|
195
195
|
* that need it without opening the GitHub panel (e.g. the inspector's repo link).
|
|
196
|
-
* Probes the integration first if it hasn't been yet.
|
|
196
|
+
* Probes the integration first if it hasn't been yet. Concurrent callers share one read.
|
|
197
197
|
*/
|
|
198
198
|
async function ensureLoaded() {
|
|
199
199
|
if (available.value === null) await probe()
|
|
200
|
-
|
|
200
|
+
await projection.ensureLoaded()
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
const connectionActions = createGitHubConnectionActions(context)
|
|
@@ -213,16 +213,14 @@ export const useGitHubStore = defineStore('github', () => {
|
|
|
213
213
|
* land. `available` returns to `null` (unknown) so the onboarding gate re-resolves.
|
|
214
214
|
*/
|
|
215
215
|
function reset() {
|
|
216
|
+
projection.clearProjection()
|
|
216
217
|
available.value = null
|
|
217
218
|
unavailableCause.value = null
|
|
218
219
|
connection.value = null
|
|
219
220
|
connectOptions.value = []
|
|
220
221
|
patCheck.value = null
|
|
221
222
|
installations.value = []
|
|
222
|
-
repos.value = []
|
|
223
223
|
availableRepos.value = []
|
|
224
|
-
pulls.value = []
|
|
225
|
-
issues.value = []
|
|
226
224
|
branches.value = {}
|
|
227
225
|
repoFiles.value = {}
|
|
228
226
|
}
|
|
@@ -259,6 +257,7 @@ export const useGitHubStore = defineStore('github', () => {
|
|
|
259
257
|
probe,
|
|
260
258
|
ensureProbed,
|
|
261
259
|
load,
|
|
260
|
+
refresh,
|
|
262
261
|
ensureLoaded,
|
|
263
262
|
repoFiles,
|
|
264
263
|
...connectionActions,
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { createUiModals } from '~/stores/ui/modals'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The pipeline builder and the model configuration never stack. The builder is a modal Reka
|
|
6
|
+
* slideover that holds `pointer-events: none` on <body> until its exit animation ends, so the
|
|
7
|
+
* model configuration (the app's own takeover) only shows once the builder reports it has left.
|
|
8
|
+
*/
|
|
9
|
+
describe('pipeline builder to model configuration handoff', () => {
|
|
10
|
+
it('shows the model configuration only after the builder has left, and reopens the builder on close', () => {
|
|
11
|
+
const ui = createUiModals()
|
|
12
|
+
ui.openBuilder()
|
|
13
|
+
|
|
14
|
+
ui.openModelConfig()
|
|
15
|
+
expect(ui.builderOpen.value).toBe(false)
|
|
16
|
+
expect(ui.modelConfigOpen.value).toBe(false)
|
|
17
|
+
|
|
18
|
+
ui.builderLeft()
|
|
19
|
+
expect(ui.modelConfigOpen.value).toBe(true)
|
|
20
|
+
|
|
21
|
+
ui.closeModelConfig()
|
|
22
|
+
expect(ui.modelConfigOpen.value).toBe(false)
|
|
23
|
+
expect(ui.builderOpen.value).toBe(true)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('opens at once when the builder is not open, and ignores a stray builder exit', () => {
|
|
27
|
+
const ui = createUiModals()
|
|
28
|
+
ui.openModelConfig()
|
|
29
|
+
expect(ui.modelConfigOpen.value).toBe(true)
|
|
30
|
+
|
|
31
|
+
ui.closeModelConfig()
|
|
32
|
+
expect(ui.builderOpen.value).toBe(false)
|
|
33
|
+
|
|
34
|
+
ui.builderLeft()
|
|
35
|
+
expect(ui.modelConfigOpen.value).toBe(false)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('returns to the builder once, not on every later close', () => {
|
|
39
|
+
const ui = createUiModals()
|
|
40
|
+
ui.openBuilder()
|
|
41
|
+
ui.openModelConfig()
|
|
42
|
+
ui.builderLeft()
|
|
43
|
+
ui.closeModelConfig()
|
|
44
|
+
ui.builderOpen.value = false
|
|
45
|
+
|
|
46
|
+
ui.openModelConfig()
|
|
47
|
+
ui.closeModelConfig()
|
|
48
|
+
expect(ui.builderOpen.value).toBe(false)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('opening the builder another way closes the model configuration and drops the return', () => {
|
|
52
|
+
const ui = createUiModals()
|
|
53
|
+
ui.openBuilder()
|
|
54
|
+
ui.openModelConfig()
|
|
55
|
+
ui.builderLeft()
|
|
56
|
+
|
|
57
|
+
ui.openBuilder()
|
|
58
|
+
expect(ui.modelConfigOpen.value).toBe(false)
|
|
59
|
+
expect(ui.builderOpen.value).toBe(true)
|
|
60
|
+
|
|
61
|
+
ui.builderOpen.value = false
|
|
62
|
+
ui.openModelConfig()
|
|
63
|
+
ui.closeModelConfig()
|
|
64
|
+
expect(ui.builderOpen.value).toBe(false)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('drops a pending show when the builder is reopened before it has left', () => {
|
|
68
|
+
const ui = createUiModals()
|
|
69
|
+
ui.openBuilder()
|
|
70
|
+
ui.openModelConfig()
|
|
71
|
+
ui.openBuilder()
|
|
72
|
+
|
|
73
|
+
ui.builderLeft()
|
|
74
|
+
expect(ui.modelConfigOpen.value).toBe(false)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('reports a return to the builder once, so it can skip its reloads', () => {
|
|
78
|
+
const ui = createUiModals()
|
|
79
|
+
ui.openBuilder()
|
|
80
|
+
expect(ui.consumeBuilderReturn()).toBe(false)
|
|
81
|
+
|
|
82
|
+
ui.openModelConfig()
|
|
83
|
+
ui.builderLeft()
|
|
84
|
+
ui.closeModelConfig()
|
|
85
|
+
expect(ui.consumeBuilderReturn()).toBe(true)
|
|
86
|
+
expect(ui.consumeBuilderReturn()).toBe(false)
|
|
87
|
+
})
|
|
88
|
+
})
|
package/app/stores/ui/modals.ts
CHANGED
|
@@ -182,6 +182,80 @@ function createHealthAdvisoryModals() {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
/**
|
|
186
|
+
* The pipeline builder and the model configuration never stack. Opening the model configuration
|
|
187
|
+
* from the builder closes the builder, shows the model configuration once the builder has
|
|
188
|
+
* finished leaving, and brings the builder back when the model configuration closes.
|
|
189
|
+
*
|
|
190
|
+
* The builder is a `USlideover`, a modal Reka layer: while it is mounted, Reka sets
|
|
191
|
+
* `pointer-events: none` on `<body>`, and lifts it only when the exit animation ends. The model
|
|
192
|
+
* configuration is the app's own takeover, teleported to `<body>` and not a Reka layer, so shown
|
|
193
|
+
* over the builder (or during its exit) every click landed on the builder behind it. Waiting for
|
|
194
|
+
* the exit (`builderLeft`, from the builder's `after:leave`) fixes that without an escape hatch on
|
|
195
|
+
* the panel, which would also defeat the pointer lock of the panel's OWN dropdowns. The fix lives
|
|
196
|
+
* here, not at the builder's "Configure models" button, because the "choose a model" action on a
|
|
197
|
+
* run-admission failure toast (`preset_unsatisfiable`, `model_policy_blocked`) also opens the
|
|
198
|
+
* model configuration.
|
|
199
|
+
*
|
|
200
|
+
* This owns BOTH openers: `openBuilder` closes the model configuration and drops a pending return,
|
|
201
|
+
* so a builder the user opened another way is not followed by a stale reopen.
|
|
202
|
+
*
|
|
203
|
+
* Closing the builder unmounts its body. The draft pipeline is in the pipelines store and survives,
|
|
204
|
+
* but component-local state does not: a half-typed output size in the binary-output picker, the
|
|
205
|
+
* rejected media types and references it reports, and the guarded-gate roster. The builder
|
|
206
|
+
* reloads nothing on the way back (`consumeBuilderReturn`), since nothing it loads changes while
|
|
207
|
+
* the model configuration is open.
|
|
208
|
+
*
|
|
209
|
+
* Other takeovers (reports, kaizen, operator dashboard) opened over a modal Reka layer have the
|
|
210
|
+
* same unclickable-takeover defect and are not handled here.
|
|
211
|
+
*/
|
|
212
|
+
function createBuilderModelConfigHandoff(
|
|
213
|
+
misc: Pick<ReturnType<typeof createMiscModals>, 'builderOpen'>,
|
|
214
|
+
panels: Pick<ReturnType<typeof createIntegrationPanelModals>, 'modelConfigOpen'>,
|
|
215
|
+
) {
|
|
216
|
+
const returnToBuilder = ref(false)
|
|
217
|
+
const showAfterBuilderExit = ref(false)
|
|
218
|
+
const returningToBuilder = ref(false)
|
|
219
|
+
|
|
220
|
+
function openModelConfig() {
|
|
221
|
+
if (showAfterBuilderExit.value) return
|
|
222
|
+
if (misc.builderOpen.value) {
|
|
223
|
+
misc.builderOpen.value = false
|
|
224
|
+
returnToBuilder.value = true
|
|
225
|
+
showAfterBuilderExit.value = true
|
|
226
|
+
return
|
|
227
|
+
}
|
|
228
|
+
panels.modelConfigOpen.value = true
|
|
229
|
+
}
|
|
230
|
+
function builderLeft() {
|
|
231
|
+
if (!showAfterBuilderExit.value) return
|
|
232
|
+
showAfterBuilderExit.value = false
|
|
233
|
+
panels.modelConfigOpen.value = true
|
|
234
|
+
}
|
|
235
|
+
function closeModelConfig() {
|
|
236
|
+
panels.modelConfigOpen.value = false
|
|
237
|
+
if (!returnToBuilder.value) return
|
|
238
|
+
returnToBuilder.value = false
|
|
239
|
+
returningToBuilder.value = true
|
|
240
|
+
misc.builderOpen.value = true
|
|
241
|
+
}
|
|
242
|
+
function openBuilder() {
|
|
243
|
+
panels.modelConfigOpen.value = false
|
|
244
|
+
showAfterBuilderExit.value = false
|
|
245
|
+
returnToBuilder.value = false
|
|
246
|
+
returningToBuilder.value = false
|
|
247
|
+
misc.builderOpen.value = true
|
|
248
|
+
}
|
|
249
|
+
/** True once per return from the model configuration, so the builder can skip its reloads. */
|
|
250
|
+
function consumeBuilderReturn(): boolean {
|
|
251
|
+
const returning = returningToBuilder.value
|
|
252
|
+
returningToBuilder.value = false
|
|
253
|
+
return returning
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return { openModelConfig, closeModelConfig, openBuilder, builderLeft, consumeBuilderReturn }
|
|
257
|
+
}
|
|
258
|
+
|
|
185
259
|
/**
|
|
186
260
|
* Small standalone surfaces with no hub relationship: the pipeline builder and the
|
|
187
261
|
* decision-wait window.
|
|
@@ -190,9 +264,6 @@ function createMiscModals() {
|
|
|
190
264
|
const builderOpen = ref(false)
|
|
191
265
|
const decisionContext = ref<{ instanceId: string; decisionId: string } | null>(null)
|
|
192
266
|
|
|
193
|
-
function openBuilder() {
|
|
194
|
-
builderOpen.value = true
|
|
195
|
-
}
|
|
196
267
|
function openDecision(instanceId: string, decisionId: string) {
|
|
197
268
|
decisionContext.value = { instanceId, decisionId }
|
|
198
269
|
}
|
|
@@ -200,7 +271,7 @@ function createMiscModals() {
|
|
|
200
271
|
decisionContext.value = null
|
|
201
272
|
}
|
|
202
273
|
|
|
203
|
-
return { builderOpen, decisionContext,
|
|
274
|
+
return { builderOpen, decisionContext, openDecision, closeDecision }
|
|
204
275
|
}
|
|
205
276
|
|
|
206
277
|
/** What the guided review window opens on: a session, a pull request, or neither (the picker). */
|
|
@@ -590,6 +661,7 @@ function createIntegrationPanelModals(resetHubReturn: ResetHubReturn) {
|
|
|
590
661
|
// API access tokens: the workspace's inbound public-API keys external systems present to
|
|
591
662
|
// the `/api/v1` surface. Opened from the Integrations hub.
|
|
592
663
|
const apiTokensOpen = ref(false)
|
|
664
|
+
// Opened and closed by `createBuilderModelConfigHandoff`, which hands the pipeline builder over.
|
|
593
665
|
const modelConfigOpen = ref(false)
|
|
594
666
|
// LLM-vendor subscription credentials (the token pool powering the Claude Code
|
|
595
667
|
// / Codex harnesses). `vendorCredentialsTab` lets a caller deep-link to one tab —
|
|
@@ -651,12 +723,6 @@ function createIntegrationPanelModals(resetHubReturn: ResetHubReturn) {
|
|
|
651
723
|
function closeApiTokens() {
|
|
652
724
|
apiTokensOpen.value = false
|
|
653
725
|
}
|
|
654
|
-
function openModelConfig() {
|
|
655
|
-
modelConfigOpen.value = true
|
|
656
|
-
}
|
|
657
|
-
function closeModelConfig() {
|
|
658
|
-
modelConfigOpen.value = false
|
|
659
|
-
}
|
|
660
726
|
function openVendorCredentials(tab = 'pool') {
|
|
661
727
|
resetHubReturn()
|
|
662
728
|
vendorCredentialsTab.value = tab
|
|
@@ -718,8 +784,6 @@ function createIntegrationPanelModals(resetHubReturn: ResetHubReturn) {
|
|
|
718
784
|
closeOperatorDashboard,
|
|
719
785
|
openApiTokens,
|
|
720
786
|
closeApiTokens,
|
|
721
|
-
openModelConfig,
|
|
722
|
-
closeModelConfig,
|
|
723
787
|
openVendorCredentials,
|
|
724
788
|
setVendorCredentialsTab,
|
|
725
789
|
closeVendorCredentials,
|
|
@@ -1223,6 +1287,7 @@ export function createUiModals() {
|
|
|
1223
1287
|
const settings = createSettingsModals(resetHubReturn)
|
|
1224
1288
|
const infra = createInfraModals(resetHubReturn)
|
|
1225
1289
|
const ai = createAiOnboardingModals()
|
|
1290
|
+
const builderHandoff = createBuilderModelConfigHandoff(misc, panels)
|
|
1226
1291
|
|
|
1227
1292
|
return {
|
|
1228
1293
|
integrationsOpen,
|
|
@@ -1249,5 +1314,6 @@ export function createUiModals() {
|
|
|
1249
1314
|
...settings,
|
|
1250
1315
|
...infra,
|
|
1251
1316
|
...ai,
|
|
1317
|
+
...builderHandoff,
|
|
1252
1318
|
}
|
|
1253
1319
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
2
|
+
import { createOverlayStack, type OverlayStack } from '@modular-vue/core'
|
|
3
|
+
import { trackForeignLayers } from '~/utils/foreignLayers'
|
|
4
|
+
|
|
5
|
+
/** A Reka-shaped layer as Nuxt UI portals it: a wrapper on `<body>` around the layer element. */
|
|
6
|
+
function openLayer(root: HTMLElement, role: string | null): HTMLElement {
|
|
7
|
+
const wrapper = document.createElement('div')
|
|
8
|
+
const layer = document.createElement('div')
|
|
9
|
+
layer.setAttribute('data-dismissable-layer', '')
|
|
10
|
+
layer.dataset.state = 'open'
|
|
11
|
+
if (role) layer.setAttribute('role', role)
|
|
12
|
+
wrapper.append(layer)
|
|
13
|
+
root.append(wrapper)
|
|
14
|
+
return layer
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** MutationObserver callbacks run as a microtask after the DOM change. */
|
|
18
|
+
const settle = () => new Promise((resolve) => setTimeout(resolve, 0))
|
|
19
|
+
|
|
20
|
+
describe('trackForeignLayers', () => {
|
|
21
|
+
let root: HTMLElement
|
|
22
|
+
let stack: OverlayStack
|
|
23
|
+
let stop: () => void
|
|
24
|
+
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
root = document.createElement('div')
|
|
27
|
+
document.body.append(root)
|
|
28
|
+
stack = createOverlayStack()
|
|
29
|
+
stop = trackForeignLayers(root, stack)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
stop()
|
|
34
|
+
root.remove()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('puts an open menu above the overlay under it, and gives the top back when it closes', async () => {
|
|
38
|
+
const takeover = stack.push()
|
|
39
|
+
const menu = openLayer(root, 'menu')
|
|
40
|
+
await settle()
|
|
41
|
+
expect(takeover.isTop()).toBe(false)
|
|
42
|
+
|
|
43
|
+
menu.parentElement!.remove()
|
|
44
|
+
await settle()
|
|
45
|
+
expect(takeover.isTop()).toBe(true)
|
|
46
|
+
expect(stack.size).toBe(1)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('gives the top back when a layer starts its exit animation, before it leaves the DOM', async () => {
|
|
50
|
+
const takeover = stack.push()
|
|
51
|
+
const menu = openLayer(root, 'menu')
|
|
52
|
+
await settle()
|
|
53
|
+
|
|
54
|
+
menu.dataset.state = 'closed'
|
|
55
|
+
await settle()
|
|
56
|
+
expect(takeover.isTop()).toBe(true)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('takes a ticket for each focus-taking role, and none for a tooltip', async () => {
|
|
60
|
+
for (const role of ['menu', 'listbox', 'dialog', 'alertdialog']) openLayer(root, role)
|
|
61
|
+
openLayer(root, null)
|
|
62
|
+
await settle()
|
|
63
|
+
expect(stack.size).toBe(4)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('keeps open order, so a menu opened over a modal is the top layer', async () => {
|
|
67
|
+
const takeover = stack.push()
|
|
68
|
+
const modal = openLayer(root, 'dialog')
|
|
69
|
+
await settle()
|
|
70
|
+
const window = stack.push()
|
|
71
|
+
expect(window.isTop()).toBe(true)
|
|
72
|
+
|
|
73
|
+
// A menu opened inside the window goes above it, and closing the modal under both changes
|
|
74
|
+
// nothing for the window.
|
|
75
|
+
const menu = openLayer(root, 'menu')
|
|
76
|
+
await settle()
|
|
77
|
+
expect(window.isTop()).toBe(false)
|
|
78
|
+
modal.parentElement!.remove()
|
|
79
|
+
menu.parentElement!.remove()
|
|
80
|
+
await settle()
|
|
81
|
+
expect(window.isTop()).toBe(true)
|
|
82
|
+
window.release()
|
|
83
|
+
expect(takeover.isTop()).toBe(true)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('counts a layer that was already open when tracking started', () => {
|
|
87
|
+
stop()
|
|
88
|
+
openLayer(root, 'dialog')
|
|
89
|
+
stop = trackForeignLayers(root, stack)
|
|
90
|
+
expect(stack.size).toBe(1)
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
it('releases every ticket when tracking stops', async () => {
|
|
94
|
+
openLayer(root, 'menu')
|
|
95
|
+
openLayer(root, 'dialog')
|
|
96
|
+
await settle()
|
|
97
|
+
stop()
|
|
98
|
+
expect(stack.size).toBe(0)
|
|
99
|
+
})
|
|
100
|
+
})
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Nuxt UI layers on the shared overlay stack.
|
|
2
|
+
//
|
|
3
|
+
// Two layer stacks run in this app. `useModalBehavior` (`TakeoverShell`, `ResultWindowShell`, the
|
|
4
|
+
// modular overlays) keeps `sharedOverlayStack`; Reka, under every Nuxt UI menu, select, popover
|
|
5
|
+
// and modal, keeps its own. Each one only knows its own layers, so a dropdown opened inside a
|
|
6
|
+
// takeover lost Escape: the shell handles the key first, in the capture phase, and calls
|
|
7
|
+
// `preventDefault()`, and Reka then leaves a prevented Escape alone. The takeover closed and the
|
|
8
|
+
// dropdown stayed.
|
|
9
|
+
//
|
|
10
|
+
// The fix is ONE stack. While a Reka layer is open it holds a ticket, pushed in open order, so
|
|
11
|
+
// it is the top overlay and `useModalBehavior` stands down: no Escape, no Tab trap. Reka then
|
|
12
|
+
// handles its own keys. Only the stack's own API is used here (`push`, `release`); what is
|
|
13
|
+
// Reka-specific is the selector.
|
|
14
|
+
|
|
15
|
+
import type { OverlayStack, OverlayStackTicket } from '@modular-vue/core'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An open Reka layer that takes focus and owns its keys. Reka marks every layer with
|
|
19
|
+
* `data-dismissable-layer`, and the role is on the same element: `menu` (dropdown menu), `listbox`
|
|
20
|
+
* (select), `dialog` (popover, modal), `alertdialog`. A tooltip is a layer too, but it has no
|
|
21
|
+
* role, so it never takes a ticket: focus stays on its trigger, and a ticket would switch off the
|
|
22
|
+
* Tab trap under it. `data-state="closed"` is a layer playing its exit animation.
|
|
23
|
+
*/
|
|
24
|
+
export const FOREIGN_LAYER_SELECTOR =
|
|
25
|
+
'[data-dismissable-layer]:is([role="menu"],[role="listbox"],[role="dialog"],[role="alertdialog"]):not([data-state="closed"])'
|
|
26
|
+
|
|
27
|
+
const ANY_LAYER = '[data-dismissable-layer]'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Hold one `stack` ticket for each open layer under `root`, for as long as it is open. Returns the
|
|
31
|
+
* function that stops tracking and releases every ticket.
|
|
32
|
+
*
|
|
33
|
+
* What is observed is kept narrow, because `root` is `<body>` and the board re-renders under it
|
|
34
|
+
* constantly. Reka teleports each layer to `<body>`, so an opening or a closing is a change to
|
|
35
|
+
* `root`'s DIRECT children, which a non-subtree `childList` observer sees without ever being
|
|
36
|
+
* told about a board patch. A layer's own exit animation is its `data-state` flipping to
|
|
37
|
+
* `closed`, which the attribute observer sees; it is filtered to that one attribute and then to
|
|
38
|
+
* records whose target is a layer. Only those records trigger the one `sync` query.
|
|
39
|
+
*/
|
|
40
|
+
export function trackForeignLayers(root: HTMLElement, stack: OverlayStack): () => void {
|
|
41
|
+
const tickets = new Map<Element, OverlayStackTicket>()
|
|
42
|
+
|
|
43
|
+
function sync(): void {
|
|
44
|
+
const open = new Set(root.querySelectorAll(FOREIGN_LAYER_SELECTOR))
|
|
45
|
+
for (const [layer, ticket] of tickets) {
|
|
46
|
+
if (open.has(layer)) continue
|
|
47
|
+
ticket.release()
|
|
48
|
+
tickets.delete(layer)
|
|
49
|
+
}
|
|
50
|
+
// Document order is open order: Reka appends each layer's portal to the end of `<body>`.
|
|
51
|
+
for (const layer of open) {
|
|
52
|
+
if (!tickets.has(layer)) tickets.set(layer, stack.push())
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const portals = new MutationObserver(sync)
|
|
57
|
+
portals.observe(root, { childList: true })
|
|
58
|
+
|
|
59
|
+
const layerState = new MutationObserver((records) => {
|
|
60
|
+
if (records.some((r) => r.target instanceof Element && r.target.matches(ANY_LAYER))) sync()
|
|
61
|
+
})
|
|
62
|
+
layerState.observe(root, { subtree: true, attributes: true, attributeFilter: ['data-state'] })
|
|
63
|
+
sync()
|
|
64
|
+
|
|
65
|
+
return () => {
|
|
66
|
+
portals.disconnect()
|
|
67
|
+
layerState.disconnect()
|
|
68
|
+
for (const ticket of tickets.values()) ticket.release()
|
|
69
|
+
tickets.clear()
|
|
70
|
+
}
|
|
71
|
+
}
|
package/i18n/locales/de.json
CHANGED
|
@@ -3712,6 +3712,7 @@
|
|
|
3712
3712
|
},
|
|
3713
3713
|
"errors": {
|
|
3714
3714
|
"listInstallations": "GitHub-Installationen konnten nicht aufgelistet werden",
|
|
3715
|
+
"loadProjection": "Repositories, Pull Requests und Issues konnten nicht geladen werden",
|
|
3715
3716
|
"startInstall": "Die Installation der GitHub App konnte nicht gestartet werden",
|
|
3716
3717
|
"connect": "Verbindung nicht möglich"
|
|
3717
3718
|
}
|
package/i18n/locales/en.json
CHANGED
|
@@ -4720,6 +4720,7 @@
|
|
|
4720
4720
|
},
|
|
4721
4721
|
"errors": {
|
|
4722
4722
|
"listInstallations": "Could not list GitHub installations",
|
|
4723
|
+
"loadProjection": "Could not load repositories, pull requests and issues",
|
|
4723
4724
|
"startInstall": "Could not start the GitHub App install",
|
|
4724
4725
|
"connect": "Could not connect"
|
|
4725
4726
|
}
|
package/i18n/locales/es.json
CHANGED
|
@@ -4544,6 +4544,7 @@
|
|
|
4544
4544
|
},
|
|
4545
4545
|
"errors": {
|
|
4546
4546
|
"listInstallations": "No se pudieron listar las instalaciones de GitHub",
|
|
4547
|
+
"loadProjection": "No se pudieron cargar los repositorios, las pull requests y las issues",
|
|
4547
4548
|
"startInstall": "No se pudo iniciar la instalación de la GitHub App",
|
|
4548
4549
|
"connect": "No se pudo conectar"
|
|
4549
4550
|
}
|
package/i18n/locales/fr.json
CHANGED
|
@@ -4544,6 +4544,7 @@
|
|
|
4544
4544
|
},
|
|
4545
4545
|
"errors": {
|
|
4546
4546
|
"listInstallations": "Impossible de lister les installations GitHub",
|
|
4547
|
+
"loadProjection": "Impossible de charger les dépôts, les pull requests et les issues",
|
|
4547
4548
|
"startInstall": "Impossible de démarrer l'installation de la GitHub App",
|
|
4548
4549
|
"connect": "Connexion impossible"
|
|
4549
4550
|
}
|
package/i18n/locales/he.json
CHANGED
|
@@ -4544,6 +4544,7 @@
|
|
|
4544
4544
|
},
|
|
4545
4545
|
"errors": {
|
|
4546
4546
|
"listInstallations": "לא ניתן היה לרשום את התקנות GitHub",
|
|
4547
|
+
"loadProjection": "לא ניתן היה לטעון מאגרים, בקשות משיכה ובעיות",
|
|
4547
4548
|
"startInstall": "לא ניתן היה להתחיל את התקנת אפליקציית GitHub",
|
|
4548
4549
|
"connect": "לא ניתן היה להתחבר"
|
|
4549
4550
|
}
|
package/i18n/locales/it.json
CHANGED
|
@@ -3712,6 +3712,7 @@
|
|
|
3712
3712
|
},
|
|
3713
3713
|
"errors": {
|
|
3714
3714
|
"listInstallations": "Impossibile elencare le installazioni GitHub",
|
|
3715
|
+
"loadProjection": "Impossibile caricare repository, pull request e issue",
|
|
3715
3716
|
"startInstall": "Impossibile avviare l'installazione della GitHub App",
|
|
3716
3717
|
"connect": "Impossibile collegare"
|
|
3717
3718
|
}
|
package/i18n/locales/ja.json
CHANGED
package/i18n/locales/pl.json
CHANGED
|
@@ -4544,6 +4544,7 @@
|
|
|
4544
4544
|
},
|
|
4545
4545
|
"errors": {
|
|
4546
4546
|
"listInstallations": "Nie udało się wyświetlić instalacji GitHub",
|
|
4547
|
+
"loadProjection": "Nie udało się wczytać repozytoriów, pull requestów i zgłoszeń",
|
|
4547
4548
|
"startInstall": "Nie udało się rozpocząć instalacji aplikacji GitHub",
|
|
4548
4549
|
"connect": "Nie udało się połączyć"
|
|
4549
4550
|
}
|
package/i18n/locales/tr.json
CHANGED
|
@@ -4544,6 +4544,7 @@
|
|
|
4544
4544
|
},
|
|
4545
4545
|
"errors": {
|
|
4546
4546
|
"listInstallations": "GitHub yüklemeleri listelenemedi",
|
|
4547
|
+
"loadProjection": "Depolar, çekme istekleri ve sorunlar yüklenemedi",
|
|
4547
4548
|
"startInstall": "GitHub App yüklemesi başlatılamadı",
|
|
4548
4549
|
"connect": "Bağlanamadı"
|
|
4549
4550
|
}
|
package/i18n/locales/uk.json
CHANGED
|
@@ -4544,6 +4544,7 @@
|
|
|
4544
4544
|
},
|
|
4545
4545
|
"errors": {
|
|
4546
4546
|
"listInstallations": "Не вдалося отримати список встановлень GitHub",
|
|
4547
|
+
"loadProjection": "Не вдалося завантажити репозиторії, pull request-и та issue",
|
|
4547
4548
|
"startInstall": "Не вдалося розпочати встановлення застосунку GitHub",
|
|
4548
4549
|
"connect": "Не вдалося підключити"
|
|
4549
4550
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/app",
|
|
3
|
-
"version": "0.315.
|
|
3
|
+
"version": "0.315.7",
|
|
4
4
|
"description": "Reusable Nuxt layer for the Agent Architecture Board SPA (components, stores, composables, pages). Consume it from a thin deployment app via `extends: ['@cat-factory/app']` and point it at your backend with NUXT_PUBLIC_API_BASE. See deploy/frontend for an example.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|