// PromptBar.jsx — the §8.1 prompt-bar at the bottom of the center column. // // In discuss mode the contributor types to talk; in contribute mode the // model is told to lean toward concrete edits. A passage highlighted in // the editor surfaces here as a "scoped to selection" badge and travels // to the backend with the message. import { useState } from 'react' import ModelPicker from './ModelPicker.jsx' export default function PromptBar({ selection, onSubmit, disabled, models, selectedModel, onModelChange, discussMode = false, placeholder, }) { const [prompt, setPrompt] = useState('') const handleSubmit = () => { if (!prompt.trim() || disabled) return onSubmit(prompt.trim(), selection) setPrompt('') } return (
{selection && (
Scoped to selection — "{selection.slice(0, 80)}{selection.length > 80 ? '…' : ''}"
)}
{models?.length > 1 && ( )}