MCPcopy Create free account
hub / github.com/Effect-TS/effect / openModal

Method openModal

packages/effect/src/chat/ChatTest.ts:1484–1495  ·  view source on GitHub ↗

A click whose handler answers with `modal`, and what the adapter did with it.

(modal: ChatInteraction.OpenModal)

Source from the content-addressed store, hash-verified

1482
1483 /** A click whose handler answers with `modal`, and what the adapter did with it. */
1484 openModal(modal: ChatInteraction.OpenModal) {
1485 return Effect.gen({ self: this }, function*() {
1486 // A modal opens from a click, on a select when there are no buttons.
1487 const element = this.has("buttons") || !this.has("selects")
1488 ? conformanceButton(this.rule)
1489 : conformanceSelect(this.rule)
1490 const posted = yield* this.post({ actions: [element] })
1491 this.recording.onClick = () => modal
1492 yield* this.click(posted.id, "conformance")
1493 return posted
1494 })
1495 }
1496
1497 has(capability: Capability) {
1498 return this.descriptor.capabilities.has(capability)

Callers 2

probeMethod · 0.95
conformanceFunction · 0.95

Calls 5

hasMethod · 0.95
postMethod · 0.95
clickMethod · 0.95
conformanceButtonFunction · 0.85
conformanceSelectFunction · 0.85

Tested by

no test coverage detected