Skip to content

Commit d38cf1e

Browse files
committed
feat: add new setting of default position of new tasks
A new setting in "Misc Settings" is added to let user choose the default choice of the toggle at the new task bar, which controls where a new task is placed: either at the 'top of list', or the 'bottom of list'.
1 parent c5d5625 commit d38cf1e

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

src/app/features/config/default-global-config.const.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const DEFAULT_GLOBAL_CONFIG: GlobalConfigState = {
1818
isAutoAddWorkedOnToToday: true,
1919
isMinimizeToTray: false,
2020
isTrayShowCurrentTask: true,
21+
isAddToBottom: false,
2122
defaultProjectId: DEFAULT_PROJECT_ID,
2223
firstDayOfWeek: 1,
2324
startOfNextDay: 0,

src/app/features/config/form-cfgs/misc-settings-form.const.ts

+11
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ export const MISC_SETTINGS_FORM_CFG: ConfigFormSection<MiscConfig> = {
7474
label: T.GCF.MISC.IS_TRAY_SHOW_CURRENT_TASK,
7575
},
7676
},
77+
{
78+
key: 'isAddToBottom',
79+
type: 'select',
80+
templateOptions: {
81+
label: T.GCF.MISC.IS_ADD_TO_BOTTOM,
82+
options: [
83+
{ label: T.GCF.MISC.ADD_TO_TOP, value: false },
84+
{ label: T.GCF.MISC.ADD_TO_BOTTOM, value: true },
85+
],
86+
},
87+
},
7788
{
7889
key: 'defaultProjectId',
7990
type: 'project-select',

src/app/features/config/global-config.model.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export type MiscConfig = Readonly<{
1616
isAutoAddWorkedOnToToday: boolean;
1717
isMinimizeToTray: boolean;
1818
isTrayShowCurrentTask: boolean;
19+
isAddToBottom: boolean;
1920
// allow also false because of #569
2021
defaultProjectId: string | null | false;
2122
firstDayOfWeek: number;

src/app/features/tasks/add-task-bar/add-task-bar.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { AsyncPipe } from '@angular/common';
4747
import { TranslatePipe } from '@ngx-translate/core';
4848
import { IssueIconPipe } from '../../issue/issue-icon/issue-icon.pipe';
4949
import { TagComponent } from '../../tag/tag/tag.component';
50+
import { GlobalConfigService } from '../../config/global-config.service';
5051

5152
@Component({
5253
selector: 'add-task-bar',
@@ -78,6 +79,7 @@ export class AddTaskBarComponent implements AfterViewInit, OnDestroy {
7879
private _workContextService = inject(WorkContextService);
7980
private _store = inject(Store);
8081
private _addTaskBarService = inject(AddTaskBarService);
82+
private _globalConfigService = inject(GlobalConfigService);
8183

8284
tabindex = input<number>(0);
8385
isDoubleEnterMode = input<boolean>(false);
@@ -90,7 +92,7 @@ export class AddTaskBarComponent implements AfterViewInit, OnDestroy {
9092

9193
isLoading = signal(false);
9294
doubleEnterCount = signal(0);
93-
isAddToBottom = signal(false);
95+
isAddToBottom = signal(this._globalConfigService.cfg?.misc.isAddToBottom);
9496
isAddToBacklog = signal(false);
9597
isSearchIssueProviders = signal(false);
9698
isSearchIssueProviders$ = toObservable(this.isSearchIssueProviders);

src/app/t.const.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1453,9 +1453,12 @@ const T = {
14531453
ZH_TW: 'GCF.LANG.ZH_TW',
14541454
},
14551455
MISC: {
1456+
ADD_TO_BOTTOM: 'GCF.MISC.ADD_TO_BOTTOM',
1457+
ADD_TO_TOP: 'GCF.MISC.ADD_TO_TOP',
14561458
DEFAULT_PROJECT: 'GCF.MISC.DEFAULT_PROJECT',
14571459
FIRST_DAY_OF_WEEK: 'GCF.MISC.FIRST_DAY_OF_WEEK',
14581460
HELP: 'GCF.MISC.HELP',
1461+
IS_ADD_TO_BOTTOM: 'GCF.MISC.IS_ADD_TO_BOTTOM',
14591462
IS_AUTO_ADD_WORKED_ON_TO_TODAY: 'GCF.MISC.IS_AUTO_ADD_WORKED_ON_TO_TODAY',
14601463
IS_AUTO_MARK_PARENT_AS_DONE: 'GCF.MISC.IS_AUTO_MARK_PARENT_AS_DONE',
14611464
IS_CONFIRM_BEFORE_EXIT: 'GCF.MISC.IS_CONFIRM_BEFORE_EXIT',

src/assets/i18n/en.json

+3
Original file line numberDiff line numberDiff line change
@@ -1432,9 +1432,12 @@
14321432
"ZH_TW": "中文(繁體)"
14331433
},
14341434
"MISC": {
1435+
"ADD_TO_BOTTOM": "Bottom of list",
1436+
"ADD_TO_TOP": "Top of list",
14351437
"DEFAULT_PROJECT": "Default project to use for tasks if none is specified",
14361438
"FIRST_DAY_OF_WEEK": "First day of the week",
14371439
"HELP": "<p><strong>Not seeing Desktop Notifications?</strong> For windows you might want to check System > Notifications & actions and check if the required notifications have been enabled.</p>",
1440+
"IS_ADD_TO_BOTTOM": "Default position of new tasks",
14381441
"IS_AUTO_ADD_WORKED_ON_TO_TODAY": "Automatically add today tag to worked on tasks",
14391442
"IS_AUTO_MARK_PARENT_AS_DONE": "Mark parent task as done, when all sub tasks are done",
14401443
"IS_CONFIRM_BEFORE_EXIT": "Confirm before exiting the app",

0 commit comments

Comments
 (0)