Skip to content

Commit

Permalink
Add shortcuts to focus inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
vimtor committed Oct 25, 2024
1 parent a050950 commit 799423b
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extensions/things/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Things Changelog

## [Focus Input Fields] - 2024-10-25

- Add shortcuts to focus the input fields in both the `Add New To-Do` and `Add New Project` commands.

## [Quick ToDo Fixes] - 2024-08-19

- Quick ToDo Command: Disable Automatic Date (when & deadline), List parsing when AI is not enabled in preferences/is not available via environment.
Expand Down
44 changes: 44 additions & 0 deletions extensions/things/src/add-new-project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,50 @@ Tasks:`);
<ActionPanel>
<Action.SubmitForm title="Add New Project" onSubmit={handleSubmit} icon={Icon.Plus} />
<Action title="Generate To-Dos with AI" icon={Icon.BulletPoints} onAction={generateToDos} />
<ActionPanel.Section>
<Action
title="Focus Title"
icon={Icon.TextInput}
onAction={() => focus('title')}
shortcut={{ modifiers: ['cmd'], key: '1' }}
/>
<Action
title="Focus Title"
icon={Icon.TextInput}
onAction={() => focus('notes')}
shortcut={{ modifiers: ['cmd'], key: '2' }}
/>
<Action
title="Focus When"
icon={Icon.TextInput}
onAction={() => focus('when')}
shortcut={{ modifiers: ['cmd'], key: 's' }}
/>
<Action
title="Focus List"
icon={Icon.TextInput}
onAction={() => focus('areaId')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 'm' }}
/>
<Action
title="Focus Tags"
icon={Icon.TextInput}
onAction={() => focus('tags')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 't' }}
/>
<Action
title="Focus Checklist"
icon={Icon.TextInput}
onAction={() => focus('toDos')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 'c' }}
/>
<Action
title="Focus Deadline"
icon={Icon.TextInput}
onAction={() => focus('deadline')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 'd' }}
/>
</ActionPanel.Section>
</ActionPanel>
}
>
Expand Down
44 changes: 44 additions & 0 deletions extensions/things/src/add-new-todo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,50 @@ export function AddNewTodo({ title, commandListName, draftValues }: AddNewTodoPr
{environment.canAccess(AI) && (
<Action title="Generate Checklist with AI" icon={Icon.BulletPoints} onAction={generateChecklist} />
)}
<ActionPanel.Section>
<Action
title="Focus Title"
icon={Icon.TextInput}
onAction={() => focus('title')}
shortcut={{ modifiers: ['cmd'], key: '1' }}
/>
<Action
title="Focus Title"
icon={Icon.TextInput}
onAction={() => focus('notes')}
shortcut={{ modifiers: ['cmd'], key: '2' }}
/>
<Action
title="Focus When"
icon={Icon.TextInput}
onAction={() => focus('when')}
shortcut={{ modifiers: ['cmd'], key: 's' }}
/>
<Action
title="Focus List"
icon={Icon.TextInput}
onAction={() => focus('listId')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 'm' }}
/>
<Action
title="Focus Tags"
icon={Icon.TextInput}
onAction={() => focus('tags')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 't' }}
/>
<Action
title="Focus Checklist"
icon={Icon.TextInput}
onAction={() => focus('checklist-items')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 'c' }}
/>
<Action
title="Focus Deadline"
icon={Icon.TextInput}
onAction={() => focus('deadline')}
shortcut={{ modifiers: ['cmd', 'shift'], key: 'd' }}
/>
</ActionPanel.Section>
</ActionPanel>
}
// Don't enable drafts if coming from another list or an empty view
Expand Down

0 comments on commit 799423b

Please sign in to comment.