Files
koboldcpp/tools/ui/tests/client/components/ChatFormPickersHarness.svelte
T
Aleksander Grygier 6de1b63473 allozaur/feat/chat slash commands (#26716)
* base : slash-command/misc foundation - model icon and focus-selector constants

* feat : slash-command picker and command parsing helpers

* refactor : wire command and @-mention pickers into the chat form

* ui : improve model selector keyboard navigation and load/dismiss

* feat: Unify markdown/raw-text rendering under one setting with migration

* fix: Misc fixes - tool-call subtitle, assistant wrap, progress guards

* feat: Clamp and style numeric settings inputs from registry bounds
2026-08-07 20:20:01 +02:00

52 lines
1.1 KiB
Svelte

<script lang="ts">
import {
useChatFormPickers,
type UseChatFormPickersReturn
} from '$lib/hooks/use-chat-form-pickers.svelte';
let value = $state('');
let caretOffset = $state(0);
const calls: string[] = [];
const pickers = useChatFormPickers({
getValue: () => value,
setValue: (v) => {
value = v;
calls.push(`setValue:${v}`);
},
getCaretOffset: () => caretOffset,
setCaretOffset: (o) => {
caretOffset = o;
},
focusInput: () => {},
getShowModelSelector: () => true,
hasPrompts: () => true,
hasBuiltinTools: () => true,
getCwd: () => null,
getServerHome: () => null,
openModelSelector: () => {
calls.push('openModelSelector');
},
getPickersRef: () => undefined
});
// Simulate the user typing: update the buffer and run the input flow.
export function type(text: string) {
value = text;
caretOffset = text.length;
pickers.handleInput();
}
export function getValue() {
return value;
}
export function getCalls() {
return calls;
}
export function getPickers(): UseChatFormPickersReturn {
return pickers;
}
</script>