From 04c63d4ef601876186e5d7fab980d76575c494ec Mon Sep 17 00:00:00 2001
From: bndw <ben@bdw.to>
Date: Sat, 28 Feb 2026 21:08:40 -0800
Subject: feat: **1. `src/main/db/schema.ts`** — add `settings` table … (+10
 more)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- ✅ **1. `src/main/db/schema.ts`** — add `settings` table to `initSchema`
- ✅ **2. `src/main/db/settings.ts`** — create file with `getSetting`, `getSettings`, `setSetting`, `deleteSetting`
- ✅ **3. `src/main/claude/phases.ts`** — add `customSystemPrompt?` param to `getPhaseConfig`; add `getDefaultSystemPromptTemplate` export
- ✅ **4. `src/main/claude/index.ts`** — import `getSetting`; load custom prompt in `sendMessage`; pass to `getPhaseConfig`
- ✅ **5. `src/main/ipc/handlers.ts`** — import `settingsDb` + `getDefaultSystemPromptTemplate`; register `settings:get`, `settings:set`, `settings:delete`, `settings:getDefaultPrompts`
- ✅ **6. `src/main/preload.ts`** — add `getSettings`, `setSetting`, `deleteSetting`, `getDefaultSystemPrompts` to interface + api object
- ✅ **7. `renderer/src/styles/globals.css`** — append all new CSS rules
- ✅ **8. `renderer/src/components/settings/SystemPromptsSettings.tsx`** — create file (new directory)
- ✅ **9. `renderer/src/components/SettingsPage.tsx`** — create file
- ✅ **10. `renderer/src/components/Header.tsx`** — add `onOpenSettings` prop + ⚙ button
- ✅ **11. `renderer/src/App.tsx`** — add `showSettings` state; import + render `<SettingsPage>`; pass `onOpenSettings` to Header
---
 renderer/src/App.tsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'renderer/src/App.tsx')

diff --git a/renderer/src/App.tsx b/renderer/src/App.tsx
index 74b1f91..7d75196 100644
--- a/renderer/src/App.tsx
+++ b/renderer/src/App.tsx
@@ -3,6 +3,7 @@ import { Header } from "./components/Header";
 import { DocumentPane } from "./components/DocumentPane";
 import { ChatPane } from "./components/ChatPane";
 import { ActionBar } from "./components/ActionBar";
+import { SettingsPage } from "./components/SettingsPage";
 import type { Project, Session, Message, Phase, TokenUsage } from "./types";
 import "./styles/globals.css";
 
@@ -56,6 +57,7 @@ export function App() {
     outputTokens: 0,
   });
   const [error, setError] = useState<string | null>(null);
+  const [showSettings, setShowSettings] = useState(false);
 
   const [theme, setTheme] = useState<Theme>(
     () => (localStorage.getItem("cf-theme") as Theme) ?? "dark"
@@ -365,6 +367,7 @@ export function App() {
         theme={theme}
         onToggleTheme={handleToggleTheme}
         gitBranch={selectedSession?.git_branch ?? null}
+        onOpenSettings={() => setShowSettings(true)}
       />
 
       <div className="main-content">
@@ -413,6 +416,10 @@ export function App() {
         }}
         disabled={!selectedSession}
       />
+
+      {showSettings && (
+        <SettingsPage onClose={() => setShowSettings(false)} />
+      )}
     </div>
   );
 }
-- 
cgit v1.2.3

