@corbet-labs/ccht 0.2.4 → 0.2.6
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/package.json +2 -2
- package/source/CHANGELOG.md +10 -0
- package/source/Cargo.lock +1 -1
- package/source/Cargo.toml +1 -1
- package/src/components/ChatDock.component.test.ts +11 -0
- package/src/components/ChatDock.svelte +4 -2
- package/src/components/StepConfig.component.test.ts +8 -2
- package/src/components/StepConfig.svelte +2 -1
- package/wasm/ccht_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -216,6 +216,7 @@ tools, usage updates, plans, permission requests, and errors).
|
|
|
216
216
|
Props: `kicker`, `title`, composer `composerId/Label/Placeholder`,
|
|
217
217
|
`sendLabel`, welcome `welcomeTitle/Body/Example`, `messages`,
|
|
218
218
|
`draft` (bindable), `history` + `activeHistoryId` + `showHistoryPicker`,
|
|
219
|
+
`newConversationLabel?` (default `'New conversation'`),
|
|
219
220
|
`sending`, `canSend`, `controlsLoading`, `composerDisabled`,
|
|
220
221
|
`onSend(text)`, `onStop?`, `onSelectHistory?(id)` (`''` means new),
|
|
221
222
|
`onCopy?(id, content)`, `onShowActivity?(msg)`,
|
|
@@ -249,7 +250,8 @@ Generic per-step backend/model/options form (content only; the app wraps
|
|
|
249
250
|
it in `Dock`). `StepData` carries one step's `id`, `label`,
|
|
250
251
|
`backendValue`, `backendOptions`, `backendPlaceholder`, `accountConnected`,
|
|
251
252
|
`accountBusy`, `configurationError?`, `modelValue`, `modelOptions`,
|
|
252
|
-
`
|
|
253
|
+
`refreshable` (whether the step owns a Refresh row), `extraOptions`
|
|
254
|
+
(`SessionConfigOption[]`), and `extraValues`.
|
|
253
255
|
|
|
254
256
|
Props: `steps: StepData[]`, `refreshing`, `onSelectBackend(id, value)`,
|
|
255
257
|
`onSelectModel(id, value)`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corbet-labs/ccht",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Reusable conversations for your applications, powered by the shared Rust/Wasm model",
|
|
5
5
|
"license": "LGPL-3.0-only WITH LGPL-3.0-linking-exception",
|
|
6
6
|
"type": "module",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"jsdom": "^26",
|
|
58
58
|
"vitest": "^3"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "54b834578efaac423f35f15347710e2f0a1cd57a"
|
|
61
61
|
}
|
package/source/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.6 - 2026-09-19
|
|
4
|
+
|
|
5
|
+
- `ChatDock.svelte`: new-conversation voice is product-owned via the
|
|
6
|
+
`newConversationLabel` prop (default `'New conversation'`).
|
|
7
|
+
|
|
8
|
+
## 0.2.5 - 2026-09-19
|
|
9
|
+
|
|
10
|
+
- No Rust changes. `StepConfig` steps carry `refreshable`: the Refresh row
|
|
11
|
+
renders only for steps that own refreshable controls.
|
|
12
|
+
|
|
3
13
|
## 0.2.4 - 2026-09-19
|
|
4
14
|
|
|
5
15
|
- No Rust changes; the Rust API and behavior are unchanged from 0.2.3.
|
package/source/Cargo.lock
CHANGED
package/source/Cargo.toml
CHANGED
|
@@ -210,4 +210,15 @@ describe('history', () => {
|
|
|
210
210
|
test('no picker without the flag', () => {
|
|
211
211
|
expect(openChat().queryByLabelText('Conversation')).toBeNull();
|
|
212
212
|
});
|
|
213
|
+
|
|
214
|
+
test('new-conversation voice is product-owned', () => {
|
|
215
|
+
const view = openChat({
|
|
216
|
+
newConversationLabel: 'New chat',
|
|
217
|
+
onSelectHistory: () => {},
|
|
218
|
+
messages: [{ id: 'u1', role: 'user', content: 'hi' }],
|
|
219
|
+
showHistoryPicker: true,
|
|
220
|
+
});
|
|
221
|
+
expect(view.getByRole('button', { name: 'New chat' })).toBeTruthy();
|
|
222
|
+
expect(view.getByRole('option', { name: 'New chat' })).toBeTruthy();
|
|
223
|
+
});
|
|
213
224
|
});
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
welcomeTitle,
|
|
57
57
|
welcomeBody,
|
|
58
58
|
welcomeExample,
|
|
59
|
+
newConversationLabel = 'New conversation',
|
|
59
60
|
messages,
|
|
60
61
|
draft = $bindable(''),
|
|
61
62
|
history = [],
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
welcomeTitle: string;
|
|
86
87
|
welcomeBody: string;
|
|
87
88
|
welcomeExample: string;
|
|
89
|
+
newConversationLabel?: string;
|
|
88
90
|
messages: ChatDockMessage[];
|
|
89
91
|
draft: string;
|
|
90
92
|
history?: ChatHistoryItem[];
|
|
@@ -179,7 +181,7 @@
|
|
|
179
181
|
<div class="ccht-chat-actions">
|
|
180
182
|
{#if messages.length > 0 && onSelectHistory}
|
|
181
183
|
<button type="button" class="ccht-chat-new-chat" onclick={() => invoke(() => onSelectHistory(''))}>
|
|
182
|
-
|
|
184
|
+
{newConversationLabel}
|
|
183
185
|
</button>
|
|
184
186
|
{/if}
|
|
185
187
|
{#if headerExtra}{@render headerExtra()}{/if}
|
|
@@ -198,7 +200,7 @@
|
|
|
198
200
|
value={activeHistoryId ?? ''}
|
|
199
201
|
onchange={(event) => invoke(() => onSelectHistory?.(event.currentTarget.value))}
|
|
200
202
|
>
|
|
201
|
-
<option value="">
|
|
203
|
+
<option value="">{newConversationLabel}</option>
|
|
202
204
|
{#each history as item (item.id)}
|
|
203
205
|
<option value={item.id}>{historyTitle(item)}</option>
|
|
204
206
|
{/each}
|
|
@@ -23,6 +23,7 @@ function step(overrides: Partial<StepData> = {}): StepData {
|
|
|
23
23
|
configurationError: null,
|
|
24
24
|
modelValue: 'qwen',
|
|
25
25
|
modelOptions: [{ value: 'qwen', name: 'Qwen' }],
|
|
26
|
+
refreshable: true,
|
|
26
27
|
extraOptions: [],
|
|
27
28
|
extraValues: {},
|
|
28
29
|
...overrides,
|
|
@@ -178,8 +179,13 @@ describe('refresh and errors', () => {
|
|
|
178
179
|
expect(getByText('stale options')).toBeTruthy();
|
|
179
180
|
});
|
|
180
181
|
|
|
181
|
-
test('no refresh row while disconnected', () => {
|
|
182
|
-
const { queryByRole } = openSteps([step({ accountConnected: false })]);
|
|
182
|
+
test('no refresh row while disconnected or not refreshable', () => {
|
|
183
|
+
const { queryByRole, rerender } = openSteps([step({ accountConnected: false })]);
|
|
183
184
|
expect(queryByRole('button', { name: 'Refresh models' })).toBeNull();
|
|
184
185
|
});
|
|
186
|
+
|
|
187
|
+
test('non-refreshable steps omit refresh even when connected', () => {
|
|
188
|
+
const { queryByRole } = openSteps([step({ refreshable: false })]);
|
|
189
|
+
expect(queryByRole('button', { name: /Refresh models|Loading/ })).toBeNull();
|
|
190
|
+
});
|
|
185
191
|
});
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
configurationError?: string | null;
|
|
28
28
|
modelValue: string;
|
|
29
29
|
modelOptions: StepModelOption[];
|
|
30
|
+
refreshable: boolean;
|
|
30
31
|
extraOptions: SessionConfigOption[];
|
|
31
32
|
extraValues: Record<string, string | boolean>;
|
|
32
33
|
}
|
|
@@ -168,7 +169,7 @@
|
|
|
168
169
|
/>
|
|
169
170
|
{/if}
|
|
170
171
|
{/each}
|
|
171
|
-
{#if step.accountConnected}
|
|
172
|
+
{#if step.accountConnected && step.refreshable}
|
|
172
173
|
<button
|
|
173
174
|
type="button"
|
|
174
175
|
class="ccht-step-refresh"
|
package/wasm/ccht_bg.wasm
CHANGED
|
Binary file
|