@things-factory/ai-assistant 10.1.110 → 10.1.112

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/ai-assistant",
3
- "version": "10.1.110",
3
+ "version": "10.1.112",
4
4
  "main": "dist-server/index.js",
5
5
  "things-factory": true,
6
6
  "author": "heartyoh",
@@ -35,8 +35,8 @@
35
35
  "@operato/styles": "^10.0.0",
36
36
  "@things-factory/ai-client-base": "^10.1.81",
37
37
  "@things-factory/apptool-base": "^10.1.106",
38
- "@things-factory/attachment-base": "^10.1.107",
39
- "@things-factory/auth-base": "^10.1.107",
38
+ "@things-factory/attachment-base": "^10.1.112",
39
+ "@things-factory/auth-base": "^10.1.111",
40
40
  "@things-factory/env": "^10.1.20",
41
41
  "@things-factory/shell": "^10.1.106",
42
42
  "dompurify": "^3.0.0",
@@ -52,5 +52,5 @@
52
52
  "copyfiles": "^2.4.1",
53
53
  "rimraf": "^5.0.0"
54
54
  },
55
- "gitHead": "b68feb6eccbef44af2a6365f384bd852dd70a8f9"
55
+ "gitHead": "e300d1b60b98ccb80380afe8df6d2807b1bcff91"
56
56
  }
@@ -147,3 +147,31 @@ describe('what twin needed of the dock', () => {
147
147
  assert.match(dock, /this\.startCarried\(ask\)\.catch\(error => \{\s*notify\(\{ level: 'error'/)
148
148
  })
149
149
  })
150
+
151
+ describe('closing and opening the dock again (design/ai/shared-dock.md §2-1, §2-7)', () => {
152
+ const setup = code('../client/setup-assistant-dock.ts')
153
+ const between = (text: string, from: string, to: string) => text.slice(text.indexOf(from), text.indexOf(to, text.indexOf(from)))
154
+
155
+ it('★ the viewpart puts back one dock - a template that makes the element makes a new dock on every opening', () => {
156
+ assert.match(setup, /const dock = document\.createElement\('ox-assistant-dock'\)/)
157
+ assert.match(setup, /template: html`\$\{dock\}`/)
158
+ assert.doesNotMatch(setup, /<ox-assistant-dock[\s>]/)
159
+ })
160
+
161
+ it('★ closing keeps the conversation - no reset, no cancelled opening', () => {
162
+ const closing = between(dock, 'disconnectedCallback() {', 'super.disconnectedCallback()')
163
+ assert.doesNotMatch(closing, /controller\.clear\(\)/)
164
+ assert.doesNotMatch(closing, /this\.revision\+\+/)
165
+ })
166
+
167
+ it('★ opening again follows what moved, it does not open the conversation anew', () => {
168
+ const opening = between(dock, 'connectedCallback() {', 'disconnectedCallback() {')
169
+ assert.match(opening, /if \(!this\.openedIdentity\) return this\.follow\(true\)/)
170
+ assert.match(opening, /setOpenSession\(this\.sessionId\)\s*this\.follow\(\)/)
171
+ })
172
+
173
+ it('★ the chat put back reads its conversation again and starts its broadcast and presence again', () => {
174
+ const opening = between(chat, ' connectedCallback() {', ' private async onSubjectChanged()')
175
+ assert.match(opening, /if \(this\.hasUpdated && this\.sessionId\) \{\s*this\.loadHistory\(\)\s*this\._startPresence\(\)\s*this\._startMessageSubscription\(\)/)
176
+ })
177
+ })
@@ -107,3 +107,19 @@ describe('the pasted table chip', () => {
107
107
  expect(chat).toMatch(/@click=\$\{\(\) => this\.tableToWords\(att\.id\)\}/)
108
108
  })
109
109
  })
110
+
111
+ describe('found on the screen (office :4700, 10.1.110)', () => {
112
+ it('★ the Escape that narrows the wide box does not reach the floating dock, which closed on it', () => {
113
+ const branch = chat.slice(chat.indexOf("if (action === 'narrow')"), chat.indexOf("} else if (action === 'send')"))
114
+ expect(branch).toMatch(/e\.stopPropagation\(\)/)
115
+ })
116
+
117
+ it('★ the send shortcut stands out of the row - it took 74px of the wide box\'s width', () => {
118
+ const rule = /\n \.send-shortcut \{([^}]*)\}/.exec(chat)?.[1] ?? ''
119
+ expect(rule).toMatch(/position: absolute/)
120
+ })
121
+
122
+ it('★ a finger is not told a key it does not have - the phone showed the shortcut', () => {
123
+ expect(chat).toMatch(/@media \(pointer: coarse\) \{\s*\.send-shortcut \{\s*display: none;/)
124
+ })
125
+ })