@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback, useMemo } from 'react'
22import { api , type AppConfig , type EventLogEntry } from '../api'
33import { Toggle } from '../components/Toggle'
44import { SaveIndicator } from '../components/SaveIndicator'
5- import { Section , Field , inputClass } from '../components/form'
5+ import { ConfigSection , Section , Field , inputClass } from '../components/form'
66import { useAutoSave } from '../hooks/useAutoSave'
77import { PageHeader } from '../components/PageHeader'
88
@@ -84,7 +84,7 @@ function StatusBar() {
8484 < button
8585 onClick = { handleTrigger }
8686 disabled = { triggering }
87- className = "px-3 py-1.5 text-xs rounded-md bg-purple-dim text-purple border border-purple/30 hover:bg-purple/30 transition-colors disabled:opacity-50 "
87+ className = "btn-secondary-sm "
8888 >
8989 { triggering ? 'Triggering...' : 'Trigger Now' }
9090 </ button >
@@ -98,9 +98,9 @@ function StatusBar() {
9898 )
9999}
100100
101- // ==================== Config Section ====================
101+ // ==================== Config Form ====================
102102
103- function ConfigSection ( { config } : { config : AppConfig } ) {
103+ function HeartbeatConfigForm ( { config } : { config : AppConfig } ) {
104104 const [ every , setEvery ] = useState ( config . heartbeat ?. every || '30m' )
105105 const [ ahEnabled , setAhEnabled ] = useState ( config . heartbeat ?. activeHours != null )
106106 const [ ahStart , setAhStart ] = useState ( config . heartbeat ?. activeHours ?. start || '09:00' )
@@ -120,7 +120,7 @@ function ConfigSection({ config }: { config: AppConfig }) {
120120 const { status, retry } = useAutoSave ( { data : configData , save } )
121121
122122 return (
123- < Section title = "Configuration" >
123+ < ConfigSection title = "Configuration" description = "Set how often the heartbeat runs and optionally restrict it to active hours. ">
124124 < Field label = "Interval" >
125125 < input
126126 className = { inputClass }
@@ -132,7 +132,7 @@ function ConfigSection({ config }: { config: AppConfig }) {
132132
133133 < div className = "mb-3" >
134134 < div className = "flex items-center justify-between mb-2" >
135- < label className = "text-[13px] text-text-muted " > Active Hours</ label >
135+ < label className = "text-[13px] text-text font-medium " > Active Hours</ label >
136136 < Toggle checked = { ahEnabled } onChange = { setAhEnabled } />
137137 </ div >
138138 { ahEnabled && (
@@ -180,7 +180,7 @@ function ConfigSection({ config }: { config: AppConfig }) {
180180 </ div >
181181
182182 < SaveIndicator status = { status } onRetry = { retry } />
183- </ Section >
183+ </ ConfigSection >
184184 )
185185}
186186
@@ -222,7 +222,7 @@ function PromptEditor() {
222222 }
223223
224224 return (
225- < Section title = "Prompt File" description = { filePath || undefined } >
225+ < ConfigSection title = "Prompt File" description = { filePath || 'The prompt template used for each heartbeat cycle.' } >
226226 { loading ? (
227227 < div className = "text-sm text-text-muted" > Loading...</ div >
228228 ) : (
@@ -236,7 +236,7 @@ function PromptEditor() {
236236 < button
237237 onClick = { handleSave }
238238 disabled = { saving || ! dirty }
239- className = "px-3 py-1.5 text-xs rounded-md bg-accent text-bg font-medium hover:opacity-90 transition-opacity disabled:opacity-40 "
239+ className = "btn-primary-sm "
240240 >
241241 { saving ? 'Saving...' : 'Save' }
242242 </ button >
@@ -258,7 +258,7 @@ function PromptEditor() {
258258 </ div >
259259 </ >
260260 ) }
261- </ Section >
261+ </ ConfigSection >
262262 )
263263}
264264
@@ -335,10 +335,10 @@ export function HeartbeatPage() {
335335 < div className = "flex flex-col flex-1 min-h-0" >
336336 < PageHeader title = "Heartbeat" />
337337
338- < div className = "flex-1 overflow-y-auto px-4 md:px-6 py-5" >
339- < div className = "max-w-[720px] space-y-6" >
338+ < div className = "flex-1 overflow-y-auto px-4 md:px-8 py-5" >
339+ < div className = "max-w-[880px] mx-auto space-y-6" >
340340 < StatusBar />
341- { config && < ConfigSection config = { config } /> }
341+ { config && < HeartbeatConfigForm config = { config } /> }
342342 < PromptEditor />
343343 < RecentEvents />
344344 </ div >
0 commit comments