# Export Improvements Phase A — Frontend Implementation Plan > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. **Goal:** Add `next_steps` to types/UI, add "Copy for Ticket" to TreeNavigationPage, add step cutoff control to SessionDetailPage, display next_steps in session detail + completion modal. **Architecture:** Update TypeScript types to match backend schema changes. Add `next_steps` textarea to SessionOutcomeModal. Display next_steps on SessionDetailPage. Add mid-session "Copy for Ticket" button to TreeNavigationPage. Add step cutoff dropdown to SessionDetailPage export controls. **Tech Stack:** React 19, TypeScript, Tailwind CSS, Zustand, Vite **Backend dependency:** Phase A backend is complete on `feat/export-phase-a` branch. --- ## Task 1: Update TypeScript Types **Files:** - Modify: `frontend/src/types/session.ts` **Step 1: Add `next_steps` to Session interface** (line 59, after `scratchpad`) ```typescript next_steps: string ``` **Step 2: Add `next_steps` to SessionUpdate** (line 68, after `scratchpad`) ```typescript next_steps?: string ``` **Step 3: Add `next_steps` to SessionComplete** (line 83) ```typescript export interface SessionComplete { outcome: SessionOutcome outcome_notes?: string next_steps?: string } ``` **Step 4: Update SessionExport** (line 77) ```typescript export interface SessionExport { format: 'text' | 'markdown' | 'html' | 'psa' include_timestamps?: boolean include_tree_info?: boolean include_outcome_notes?: boolean include_next_steps?: boolean max_step_index?: number } ``` **Step 5: Build to verify no type errors** Run: `cd /c/Dev/Projects/patherly/frontend && npx tsc --noEmit` **Step 6: Commit** ```bash git add frontend/src/types/session.ts git commit -m "feat(frontend): add next_steps and export options to session types" ``` --- ## Task 2: Add Next Steps to Session Completion Modal **Files:** - Modify: `frontend/src/components/session/SessionOutcomeModal.tsx` - Modify: `frontend/src/pages/TreeNavigationPage.tsx` (consumer callback) **Step 1: Update the `onSubmit` prop type** (line 9) Change the data shape to include `next_steps`: ```typescript onSubmit: (data: { outcome: SessionOutcome; outcome_notes?: string; next_steps?: string }) => Promise ``` **Step 2: Update `handleSubmit`** (line 28) Add next_steps extraction from formData: ```typescript const handleSubmit = async () => { if (!formRef.current) return const formData = new FormData(formRef.current) const outcome = (formData.get('session-outcome') as SessionOutcome | null) ?? 'resolved' const outcomeNotes = ((formData.get('outcome-notes') as string | null) ?? '').trim() const nextSteps = ((formData.get('next-steps') as string | null) ?? '').trim() await onSubmit({ outcome, outcome_notes: outcomeNotes || undefined, next_steps: nextSteps || undefined, }) } ``` **Step 3: Add Next Steps textarea** after the outcome notes textarea (after line 115) Add a second textarea block right before the closing ``: ```tsx