Skip to content

Commit a350209

Browse files
authored
feat(settings): add toggle for prompt input panel (#47)
New setting to show/hide the prompt input box below the terminal. When hidden, the terminal occupies the full panel and auto-focuses on task activation. Defaults to shown (existing behavior). Co-authored-by: maskar <Maskar@users.noreply.github.com>
1 parent bc8a127 commit a350209

7 files changed

Lines changed: 46 additions & 2 deletions

File tree

src/components/SettingsDialog.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
setThemePreset,
1515
setAutoTrustFolders,
1616
setShowPlans,
17+
setShowPromptInput,
1718
setDesktopNotificationsEnabled,
1819
setInactiveColumnOpacity,
1920
setEditorCommand,
@@ -216,6 +217,33 @@ export function SettingsDialog(props: SettingsDialogProps) {
216217
</span>
217218
</div>
218219
</label>
220+
<label
221+
style={{
222+
display: 'flex',
223+
'align-items': 'center',
224+
gap: '10px',
225+
cursor: 'pointer',
226+
padding: '8px 12px',
227+
'border-radius': '8px',
228+
background: theme.bgInput,
229+
border: `1px solid ${theme.border}`,
230+
}}
231+
>
232+
<input
233+
type="checkbox"
234+
checked={store.showPromptInput}
235+
onChange={(e) => setShowPromptInput(e.currentTarget.checked)}
236+
style={{ 'accent-color': theme.accent, cursor: 'pointer' }}
237+
/>
238+
<div style={{ display: 'flex', 'flex-direction': 'column', gap: '2px' }}>
239+
<span style={{ 'font-size': '13px', color: theme.fg }}>
240+
Show prompt input box below terminal
241+
</span>
242+
<span style={{ 'font-size': '11px', color: theme.fgSubtle }}>
243+
When hidden, the terminal occupies the full panel and auto-focuses on activation
244+
</span>
245+
</div>
246+
</label>
219247
</div>
220248

221249
<div style={{ display: 'flex', 'flex-direction': 'column', gap: '10px' }}>

src/components/TaskPanel.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ export function TaskPanel(props: TaskPanelProps) {
8686
autoFocusTimer = setTimeout(() => {
8787
autoFocusTimer = undefined;
8888
if (!store.focusedPanel[id] && !panelRef.contains(document.activeElement)) {
89-
promptRef?.focus();
89+
if (store.showPromptInput) {
90+
promptRef?.focus();
91+
} else {
92+
setTaskFocusedPanel(id, 'ai-terminal');
93+
triggerFocus(`${id}:ai-terminal`);
94+
}
9095
}
9196
}, 0);
9297
}
@@ -243,7 +248,7 @@ export function TaskPanel(props: TaskPanelProps) {
243248
notesAndFiles(),
244249
shellSection(),
245250
aiTerminal(),
246-
promptInput(),
251+
...(store.showPromptInput ? [promptInput()] : []),
247252
]}
248253
/>
249254
<CloseTaskDialog

src/store/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const [store, setStore] = createStore<AppStore>({
3838
mergedLinesRemoved: 0,
3939
terminalFont: DEFAULT_TERMINAL_FONT,
4040
themePreset: 'minimal',
41+
showPromptInput: true,
4142
windowState: null,
4243
autoTrustFolders: false,
4344
showPlans: true,

src/store/persistence.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export async function saveState(): Promise<void> {
4848
mergedLinesRemoved: store.mergedLinesRemoved,
4949
terminalFont: store.terminalFont,
5050
themePreset: store.themePreset,
51+
showPromptInput: store.showPromptInput,
5152
windowState: store.windowState ? { ...store.windowState } : undefined,
5253
autoTrustFolders: store.autoTrustFolders,
5354
showPlans: store.showPlans,
@@ -187,6 +188,7 @@ interface LegacyPersistedState {
187188
mergedLinesRemoved?: unknown;
188189
terminalFont?: unknown;
189190
themePreset?: unknown;
191+
showPromptInput?: unknown;
190192
windowState?: unknown;
191193
autoTrustFolders?: unknown;
192194
showPlans?: unknown;
@@ -297,6 +299,7 @@ export async function loadState(): Promise<void> {
297299
? raw.terminalFont
298300
: DEFAULT_TERMINAL_FONT;
299301
s.themePreset = isLookPreset(raw.themePreset) ? raw.themePreset : 'minimal';
302+
s.showPromptInput = typeof raw.showPromptInput === 'boolean' ? raw.showPromptInput : true;
300303
s.windowState = parsePersistedWindowState(raw.windowState);
301304
s.autoTrustFolders = typeof raw.autoTrustFolders === 'boolean' ? raw.autoTrustFolders : false;
302305
s.showPlans = typeof raw.showPlans === 'boolean' ? raw.showPlans : true;

src/store/store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export {
9696
setThemePreset,
9797
setAutoTrustFolders,
9898
setShowPlans,
99+
setShowPromptInput,
99100
setDesktopNotificationsEnabled,
100101
setInactiveColumnOpacity,
101102
setEditorCommand,

src/store/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export interface PersistedState {
119119
mergedLinesRemoved?: number;
120120
terminalFont?: string;
121121
themePreset?: LookPreset;
122+
showPromptInput?: boolean;
122123
windowState?: PersistedWindowState;
123124
autoTrustFolders?: boolean;
124125
showPlans?: boolean;
@@ -183,6 +184,7 @@ export interface AppStore {
183184
mergedLinesRemoved: number;
184185
terminalFont: string;
185186
themePreset: LookPreset;
187+
showPromptInput: boolean;
186188
windowState: PersistedWindowState | null;
187189
autoTrustFolders: boolean;
188190
showPlans: boolean;

src/store/ui.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export function setShowPlans(showPlans: boolean): void {
8686
setStore('showPlans', showPlans);
8787
}
8888

89+
export function setShowPromptInput(show: boolean): void {
90+
setStore('showPromptInput', show);
91+
}
92+
8993
export function setDesktopNotificationsEnabled(enabled: boolean): void {
9094
setStore('desktopNotificationsEnabled', enabled);
9195
}

0 commit comments

Comments
 (0)