mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Replace the fixed, stop-based walkthrough with an agent-built one. Every request (Generate, Update, Regenerate, /walkthrough, the multi-run button and the agent's open_walkthrough) now spawns a separate walkthrough session. That session reads the diff through a new walkthrough_changes action, writes one self-contained HTML file into a Manager-owned directory, and calls publish_walkthrough; the panel renders the file in a sandboxed frame shared with the inline artifact card and the file browser HTML preview. Publication marks the walkthrough ready while execution is tracked separately, so Stop, the 15-minute limit, polling, refine gating and interruption when the target session is deleted follow the agent instead of the first publish. One diff copy is reused per run. Regenerate interrupts the previous session and removes its output directory. Walkthrough sessions are kept and listed, with their completion and error push notifications muted. The stop pipeline, its wire schemas and the concurrency limiter it used are removed.
44 lines
1.6 KiB
TypeScript
44 lines
1.6 KiB
TypeScript
import { useSettings } from '@/hooks/useSettings'
|
|
import { useAutosavedSetting } from '@/hooks/useAutosavedSetting'
|
|
import { Label } from '@/components/ui/label'
|
|
import { ModelCombobox } from '@/components/model/ModelCombobox'
|
|
|
|
export function WalkthroughSettings() {
|
|
const { preferences, updateSettings } = useSettings()
|
|
const storedWalkthroughModel = preferences?.walkthroughModel
|
|
|
|
const { draft: walkthroughModel, setDraft: setWalkthroughModel } = useAutosavedSetting({
|
|
stored: storedWalkthroughModel,
|
|
toDraft: (stored) => stored ?? '',
|
|
toCommitted: (draft) => draft.trim(),
|
|
isEqual: (a, b) => a === b,
|
|
save: (next) => updateSettings({ walkthroughModel: next }),
|
|
})
|
|
|
|
return (
|
|
<div className="space-y-6">
|
|
<h2 className="text-lg font-semibold text-foreground">Change walkthrough</h2>
|
|
|
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
|
|
<div className="min-w-0 space-y-0.5">
|
|
<Label htmlFor="walkthroughModel">Walkthrough model</Label>
|
|
<p className="text-sm text-muted-foreground">
|
|
Model of the walkthrough session that builds the walkthrough UI. Leave empty to use the session's model, or the OpenCode default.
|
|
</p>
|
|
</div>
|
|
<ModelCombobox
|
|
id="walkthroughModel"
|
|
ariaLabel="Walkthrough model"
|
|
value={walkthroughModel}
|
|
onChange={setWalkthroughModel}
|
|
placeholder="Session model"
|
|
allowCustomValue
|
|
showClear
|
|
emptyMeansDefault={false}
|
|
className="w-full shrink-0 sm:w-64"
|
|
/>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|