Files
rfc-app/frontend/src/components/PromptBar.jsx
T
Ben Stull ee6e3491e7 Drop "prototype/carryover" framing now that v1 is shipped
SPEC, DEV docs, and code comments still talked about the codebase as
a rewrite-in-progress against an external prototype. With v1 shipped
the framing reads oddly — it implies code is provisional when it's
the production thing. Recast §18 as "the technical stack," strip
"carryover from the prototype" comments across backend (api.py,
chat.py, providers.py) and frontend (DiffView, PromptBar,
SelectionTooltip, modelStyles), and rework SPEC §1 / §18 to introduce
OHM up front rather than as a follow-on to a prototype reference.

Also:
- RUNBOOK: bump Python prereq to 3.11+ to match the production VM
  (was 3.13).
- Remove IMPLEMENTATION-PROMPT.md — the original implementation brief
  is no longer load-bearing.
- Add deploy/DEPLOY-NEW-SESSION-PROMPT.md as the durable
  deploy-handoff prompt for new sessions.
2026-05-25 10:32:46 -07:00

65 lines
1.9 KiB
React

// 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 (
<div className="prompt-bar">
{selection && (
<div className="selection-badge">
<span className="selection-icon"></span>
Scoped to selection "{selection.slice(0, 80)}{selection.length > 80 ? '…' : ''}"
</div>
)}
<div className="prompt-row">
{models?.length > 1 && (
<ModelPicker models={models} selected={selectedModel} onChange={onModelChange} />
)}
<textarea
className="prompt-input"
value={prompt}
onChange={e => setPrompt(e.target.value)}
onKeyDown={e => {
if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); handleSubmit() }
}}
placeholder={
placeholder ?? (
selection ? 'Ask anything about the selected text…'
: discussMode ? 'Ask anything about this RFC…'
: 'Ask anything or propose changes…'
)
}
disabled={disabled}
rows={1}
/>
<button className="prompt-submit" onClick={handleSubmit} disabled={!prompt.trim() || disabled}>
Ask
</button>
</div>
</div>
)
}