diff options
| author | bndw <ben@bdw.to> | 2026-03-04 21:36:32 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-03-04 21:36:32 -0800 |
| commit | 73d2680b83ccbdbd8dfec2d319533e98b379b830 (patch) | |
| tree | 193eaf5157edcf12d06dde85fb44efaf3aae2004 /renderer/src/components/DocumentPane.tsx | |
| parent | b6405dd6a4ba65fc5dc6746db7be7be7d0bb29f3 (diff) | |
feat: Thread optional `phase` param into `db/sessions.ts::cre… (+7 more)
- ✅ Thread optional `phase` param into `db/sessions.ts::createSession()`
- ✅ Thread optional `phase` param into `ipc/handlers.ts` sessions:create handler
- ✅ Thread optional `phase` param into `preload.ts` createSession API
- ✅ Update Plan phase system prompt to gracefully handle missing research.md
- ✅ Update Implement phase system prompt to gracefully handle missing plan.md
- ✅ Create `renderer/src/components/NewSessionModal.tsx`
- ✅ Update `App.tsx`: add modal state, split handler, add modal JSX
- ✅ Add modal CSS to `globals.css`
Diffstat (limited to 'renderer/src/components/DocumentPane.tsx')
| -rw-r--r-- | renderer/src/components/DocumentPane.tsx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/renderer/src/components/DocumentPane.tsx b/renderer/src/components/DocumentPane.tsx index f5368b3..2ec66f6 100644 --- a/renderer/src/components/DocumentPane.tsx +++ b/renderer/src/components/DocumentPane.tsx | |||
| @@ -117,6 +117,11 @@ export function DocumentPane({ | |||
| 117 | }: DocumentPaneProps) { | 117 | }: DocumentPaneProps) { |
| 118 | const [isEditing, setIsEditing] = useState(false); | 118 | const [isEditing, setIsEditing] = useState(false); |
| 119 | 119 | ||
| 120 | // Always exit edit mode when the pane becomes read-only. | ||
| 121 | useEffect(() => { | ||
| 122 | if (disabled) setIsEditing(false); | ||
| 123 | }, [disabled]); | ||
| 124 | |||
| 120 | if (showOnboarding) { | 125 | if (showOnboarding) { |
| 121 | return ( | 126 | return ( |
| 122 | <div className="document-pane"> | 127 | <div className="document-pane"> |
| @@ -206,9 +211,13 @@ export function DocumentPane({ | |||
| 206 | <div className="document-pane"> | 211 | <div className="document-pane"> |
| 207 | <div className="document-header"> | 212 | <div className="document-header"> |
| 208 | <span>{filename}</span> | 213 | <span>{filename}</span> |
| 209 | <button onClick={() => setIsEditing(!isEditing)}> | 214 | {disabled ? ( |
| 210 | {isEditing ? "Preview" : "Edit"} | 215 | <span className="badge badge-readonly">Read-only</span> |
| 211 | </button> | 216 | ) : ( |
| 217 | <button onClick={() => setIsEditing(!isEditing)}> | ||
| 218 | {isEditing ? "Preview" : "Edit"} | ||
| 219 | </button> | ||
| 220 | )} | ||
| 212 | </div> | 221 | </div> |
| 213 | 222 | ||
| 214 | {isEditing ? ( | 223 | {isEditing ? ( |
