MCPcopy Create free account
hub / github.com/anthropics/claude-code / pickerOf

Function pickerOf

mods/diff/tests/views/source-picker.test.ts:47–59  ·  view source on GitHub ↗

* What the picker offers, in the order drawn, over a fresh drawing: * inRepository answers `ui.invalidate`, so none comes by itself.

(ui: Mounted<'terminal', 'Pane'>)

Source from the content-addressed store, hash-verified

45 * inRepository answers `ui.invalidate`, so none comes by itself.
46 */
47 async function pickerOf(ui: Mounted<'terminal', 'Pane'>) {
48 await ui.redraw()
49
50 const props = (await ui.find({ key: 'source' }))?.props ?? {}
51 const options = arrayOf(props.options).filter(isRecord)
52
53 return {
54 title: props.label,
55 picked: props.value,
56 labels: options.map(option => option.label),
57 values: options.map(option => String(option.value)),
58 }
59 }
60
61 test('63 edited turns: every turn listed, nothing noted', async ($, on) => {
62 const { ui } = await openOver($, on, 63)

Callers 1

Calls 1

arrayOfFunction · 0.90

Tested by

no test coverage detected