compaction: the surface — settings row, two ruled dividers, summary dialog, send gate (round 14 slice 3)
- settings: compaction.thresholdTokens row on the Agent tab (owner pick)
in a Context group — CommitInput mirroring the graph budget row, hint
resolved through the SAME core resolver the trigger reads; PUT rejects
below the 32k floor with the anti-churn rationale; own section
(compaction) in SETTINGS_SECTIONS + the settings-signal union
- view fold: one marker → two dividers — the minimal MOMENT divider at
the marker (retrying-message register, no rule lines) and the longer
CUT divider emitted immediately before the first kept message
(phase-divider geometry, chip carries '· Nk tok'); both carry the full
summary payload; full history stays visible to the user
- components/compaction-divider.tsx: the dividers + summary dialog
(pure exported body for SSR pins, the delete-dialog pattern; Esc +
Close dismiss, backdrop does not)
- chat.tsx: compaction-changed SSE flips the running state — composer
canSend, onSend/doSend/doSteerOrSend, and both docks' submit + hint
('compacting session…') gate on it (the server's registry mutex is the
structural gate; this is the affordance); dialog mounts beside the
abort dialog
- pins: settings-body (4), view fold (2), divider SSR (4)
This commit is contained in:
@@ -41,9 +41,14 @@ export interface PracticeDockProps {
|
||||
onSubmit: (text: string) => void;
|
||||
/** Escape in the thinking field stops dictation (threaded from the page). */
|
||||
onEscape?: () => void;
|
||||
/** Compaction is running for this chat (owner round 14): the thinking
|
||||
* POST would block on the server's compaction gate — disable submit
|
||||
* and say so in the hint row. The server registry is the real gate;
|
||||
* this is the affordance. */
|
||||
compactionRunning?: boolean;
|
||||
}
|
||||
|
||||
export function PracticeDock({ problemCallId, input, expanded, onExpand, onSubmit, onEscape }: PracticeDockProps) {
|
||||
export function PracticeDock({ problemCallId, input, expanded, onExpand, onSubmit, onEscape, compactionRunning = false }: PracticeDockProps) {
|
||||
const [thinking, setThinking] = useState("");
|
||||
// Ref MIRRORS the field ("nothing gets lost", the question-dock
|
||||
// discipline): a submit resuming after `await finishDictation()` reads
|
||||
@@ -63,6 +68,7 @@ export function PracticeDock({ problemCallId, input, expanded, onExpand, onSubmi
|
||||
);
|
||||
|
||||
const submit = () => {
|
||||
if (compactionRunning) return;
|
||||
const text = thinkingRef.current.trim();
|
||||
if (text.length === 0) return;
|
||||
thinkingRef.current = "";
|
||||
@@ -149,12 +155,12 @@ export function PracticeDock({ problemCallId, input, expanded, onExpand, onSubmi
|
||||
field 10 − p-1 (4) = button 6. */}
|
||||
<div className="flex items-center justify-between gap-2 p-1">
|
||||
<span aria-hidden className="pl-1.5 text-xs text-muted-foreground">
|
||||
↵ submits · ⇧↵ newline
|
||||
{compactionRunning ? "compacting session…" : "↵ submits · ⇧↵ newline"}
|
||||
</span>
|
||||
<Button
|
||||
type="button"
|
||||
data-testid="practice-send"
|
||||
disabled={thinking.trim().length === 0}
|
||||
disabled={thinking.trim().length === 0 || compactionRunning}
|
||||
onClick={() => submit()}
|
||||
className="ml-auto h-9 rounded-[6px] px-3.5 text-sm font-medium"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user