feat(frontend): add step cutoff control to export options
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ export function SessionDetailPage() {
|
|||||||
const [isSavingRatings, setIsSavingRatings] = useState(false)
|
const [isSavingRatings, setIsSavingRatings] = useState(false)
|
||||||
const [librarySteps, setLibrarySteps] = useState<Step[]>([])
|
const [librarySteps, setLibrarySteps] = useState<Step[]>([])
|
||||||
const [copiedStepIndex, setCopiedStepIndex] = useState<number | null>(null)
|
const [copiedStepIndex, setCopiedStepIndex] = useState<number | null>(null)
|
||||||
|
const [maxStepIndex, setMaxStepIndex] = useState<number | null>(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (id) {
|
if (id) {
|
||||||
@@ -94,6 +95,7 @@ export function SessionDetailPage() {
|
|||||||
format: exportFormat,
|
format: exportFormat,
|
||||||
include_timestamps: true,
|
include_timestamps: true,
|
||||||
include_tree_info: true,
|
include_tree_info: true,
|
||||||
|
...(maxStepIndex !== null && { max_step_index: maxStepIndex }),
|
||||||
}
|
}
|
||||||
return await sessionsApi.export(session.id, options)
|
return await sessionsApi.export(session.id, options)
|
||||||
}
|
}
|
||||||
@@ -139,6 +141,7 @@ export function SessionDetailPage() {
|
|||||||
format: 'psa',
|
format: 'psa',
|
||||||
include_timestamps: true,
|
include_timestamps: true,
|
||||||
include_tree_info: true,
|
include_tree_info: true,
|
||||||
|
...(maxStepIndex !== null && { max_step_index: maxStepIndex }),
|
||||||
}
|
}
|
||||||
const content = await sessionsApi.export(session.id, options)
|
const content = await sessionsApi.export(session.id, options)
|
||||||
if (content) {
|
if (content) {
|
||||||
@@ -385,6 +388,24 @@ export function SessionDetailPage() {
|
|||||||
<option value="html">HTML</option>
|
<option value="html">HTML</option>
|
||||||
<option value="psa">PSA / Ticket Note</option>
|
<option value="psa">PSA / Ticket Note</option>
|
||||||
</select>
|
</select>
|
||||||
|
{session.decisions.length > 1 && (
|
||||||
|
<select
|
||||||
|
value={maxStepIndex ?? ''}
|
||||||
|
onChange={(e) => setMaxStepIndex(e.target.value ? Number(e.target.value) : null)}
|
||||||
|
aria-label="Export through step"
|
||||||
|
className={cn(
|
||||||
|
'rounded-md border border-white/10 bg-black/50 px-3 py-2 text-sm text-white',
|
||||||
|
'focus:border-white/30 focus:outline-none focus:ring-1 focus:ring-white/20'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<option value="">All steps</option>
|
||||||
|
{session.decisions.map((_, idx) => (
|
||||||
|
<option key={idx + 1} value={idx + 1}>
|
||||||
|
Through step {idx + 1}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
onClick={handleCopy}
|
onClick={handleCopy}
|
||||||
disabled={isExporting}
|
disabled={isExporting}
|
||||||
|
|||||||
Reference in New Issue
Block a user