Skip to content

Commit

Permalink
Fixed wrong portugese translation for "Notification threshold" (#677)…
Browse files Browse the repository at this point in the history
…. Added file watcher settings (#675 & #676). Fixed #670. Continued work on #609.
  • Loading branch information
ransome1 committed Mar 16, 2024
1 parent 5faba0f commit a0b46f5
Show file tree
Hide file tree
Showing 31 changed files with 824 additions and 730 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
in 15 days from now. Your efforts are greatly appreciated, and we
value your contributions to the project.
stale-issue-label: no-issue-activity
days-before-stale: 120
days-before-stale: 200
days-before-close: 15
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion flatpak/com.github.ransome1.sleek.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<developer_name>Robin Ahle</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="2.0.12-rc.2" date="2024-02-27"/>
<release version="2.0.12-rc.4" date="2024-03-16"/>
</releases>
<url type="homepage">https://github.com/ransome1/sleek</url>
<url type="contact">https://github.com/ransome1/sleek/issues</url>
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sleek",
"version": "2.0.12-rc.2",
"version": "2.0.12-rc.4",
"main": "./src/main/main.tsx",
"scripts": {
"build": "concurrently \"yarn run peggy\" \"yarn run build:main\" \"yarn run build:renderer\"",
Expand Down Expand Up @@ -72,19 +72,19 @@
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.7",
"@mui/material": "^5.15.7",
"@mui/system": "^5.15.7",
"@mui/icons-material": "^5.15.12",
"@mui/material": "^5.15.12",
"@mui/system": "^5.15.12",
"@mui/x-date-pickers": "^6.19.3",
"dayjs": "^1.11.9",
"electron-store": "^8.1.0",
"i18next": "^23.8.2",
"electron-store": "^8.2.0",
"i18next": "^23.10.1",
"jstodotxt": "^1.0.0-alpha.0",
"react": "^18.2.0",
"react-autosuggest": "^10.1.0",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18.2.0",
"react-i18next": "^14.0.0",
"react-i18next": "^14.1.0",
"react-markdown": "^9.0.1",
"react-string-replace": "^1.1.1",
"remark-gfm": "^4.0.0",
Expand All @@ -99,11 +99,11 @@
"@testing-library/jest-dom": "^6.4.1",
"@testing-library/react": "^14.2.1",
"@types/jest": "^29.5.12",
"@types/node": "20.11.17",
"@types/react": "^18.2.52",
"@types/node": "20.11.25",
"@types/react": "^18.2.64",
"@types/react-autosuggest": "^10.1.10",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-dom": "^18.2.4",
"@types/react-dom": "^18.2.21",
"@types/react-test-renderer": "^18.0.0",
"@types/webpack-bundle-analyzer": "^4.6.0",
"chalk": "^4.1.2",
Expand All @@ -113,7 +113,7 @@
"css-minimizer-webpack-plugin": "^6.0.0",
"depcheck": "^1.4.7",
"detect-port": "^1.5.1",
"electron": "28.2.4",
"electron": "^28.2.6",
"electron-builder": "^24.2.1",
"electron-devtools-installer": "^3.2.0",
"electronmon": "^2.0.2",
Expand All @@ -138,12 +138,12 @@
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.0.1",
"typescript": "^5.1.3",
"typescript": "^5.4.2",
"url-loader": "^4.1.1",
"webpack": "^5.90.1",
"webpack-bundle-analyzer": "^4.9.0",
"webpack-cli": "^5.1.1",
"webpack-dev-server": "^4.15.0",
"webpack-dev-server": "^5.0.2",
"webpack-merge": "^5.9.0"
},
"build": {
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sleek",
"version": "2.0.12-rc.3",
"version": "2.0.12-rc.4",
"description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sleek
base: core20
version: "2.0.12-rc.2"
version: "2.0.12-rc.4"
summary: todo.txt manager for Linux, free and open-source (FOSS)
description: |
sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done.
Expand Down
28 changes: 14 additions & 14 deletions src/__tests__/__mock__/recurrence.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

2024-02-27 Line 1 rec:1d due:2024-02-28
2024-02-27 Line 1 rec:w due:2024-03-05
2024-02-27 Line 1 rec:2m due:2024-04-27
2024-02-27 Line 1 rec:+1d due:2024-02-29
2024-02-27 Line 1 rec:7w due:2024-04-16
2024-02-27 Line 1 due:2023-07-24 rec:+1b
2024-02-27 taxes are due in one year t:2022-03-30 due:2022-04-30 rec:+1y
2024-02-27 Water plants @home +quick due:2024-03-05 t:2024-02-24 rec:1w
2024-02-27 Line 1 rec:+1d t:2023-09-20
2024-02-27 Line 1 rec:1d pri:A due:2024-02-28
2024-02-27 (A) Do something rec:d t:2024-02-28 @SomeContext
2024-02-27 Do something rec:0d
2024-02-27 Do something rec:0d due:2024-02-27
2024-02-27 Do something rec:0d due:2024-02-27 t:2024-02-27
2024-03-16 Line 1 rec:1d due:2024-03-17
2024-03-16 Line 1 rec:w due:2024-03-23
2024-03-16 Line 1 rec:2m due:2024-05-16
2024-03-16 Line 1 rec:+1d due:2024-03-18
2024-03-16 Line 1 rec:7w due:2024-05-04
2024-03-16 Line 1 due:2023-07-24 rec:+1b
2024-03-16 taxes are due in one year t:2022-03-30 due:2022-04-30 rec:+1y
2024-03-16 Water plants @home +quick due:2024-03-23 t:2024-03-13 rec:1w
2024-03-16 Line 1 rec:+1d t:2023-09-20
2024-03-16 Line 1 rec:1d pri:A due:2024-03-17
2024-03-16 (A) Do something rec:d t:2024-03-17 @SomeContext
2024-03-16 Do something rec:0d
2024-03-16 Do something rec:0d due:2024-03-16
2024-03-16 Do something rec:0d due:2024-03-16 t:2024-03-16
3 changes: 3 additions & 0 deletions src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "minulý týden",
"drawer.attributes.thisWeek": "tento týden",
"drawer.attributes.thisMonth": "tento měsíc",
"drawer.attributes.nextMonth": "příští měsíc",
"drawer.attributes.overdue": "pozadu",
"drawer.attributes.elapsed": "uplynulý",
"drawer.sorting.fileSorting": "Seřadit úkoly podle pořadí v souboru",
"shared.attributeMapping.t": "Termín",
"shared.attributeMapping.due": "Termín splnění",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "letzte Woche",
"drawer.attributes.thisWeek": "diese Woche",
"drawer.attributes.thisMonth": "diesen Monat",
"drawer.attributes.nextMonth": "nächster Monat",
"drawer.attributes.overdue": "überfällig",
"drawer.attributes.elapsed": "verstrichen",
"drawer.sorting.fileSorting": "Aufgaben in der Reihenfolge der Datei anordnen",
"shared.attributeMapping.t": "Schwellenwertdatum",
"shared.attributeMapping.due": "Fälligkeitsdatum",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en-gb.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "last week",
"drawer.attributes.thisWeek": "this week",
"drawer.attributes.thisMonth": "this month",
"drawer.attributes.nextMonth": "next month",
"drawer.attributes.overdue": "overdue",
"drawer.attributes.elapsed": "elapsed",
"drawer.sorting.fileSorting": "Order todos as they appear in the file",
"shared.attributeMapping.t": "Threshold date",
"shared.attributeMapping.due": "Due date",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "last week",
"drawer.attributes.thisWeek": "this week",
"drawer.attributes.thisMonth": "this month",
"drawer.attributes.nextMonth": "next month",
"drawer.attributes.overdue": "overdue",
"drawer.attributes.elapsed": "elapsed",
"drawer.sorting.fileSorting": "Order todos as they appear in the file",
"shared.attributeMapping.t": "Threshold date",
"shared.attributeMapping.due": "Due date",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"drawer.attributes.lastWeek": "la semana pasada",
"drawer.attributes.thisWeek": "esta semana",
"drawer.attributes.thisMonth": "este mes",
"drawer.attributes.nextMonth": "el próximo mes",
"drawer.attributes.overdue": "vencido",
"drawer.attributes.elapsed": "transcurrido",
"drawer.sorting.fileSorting": "Ordenar tareas como aparecen en el archivo",
"shared.attributeMapping.t": "Fecha umbral",
"shared.attributeMapping.due": "Fecha de vencimiento",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "la semaine dernière",
"drawer.attributes.thisWeek": "cette semaine",
"drawer.attributes.thisMonth": "ce mois",
"drawer.attributes.nextMonth": "le mois prochain",
"drawer.attributes.overdue": "en retard",
"drawer.attributes.elapsed": "écoulé",
"drawer.sorting.fileSorting": "Classer les tâches comme elles apparaissent dans le fichier",
"shared.attributeMapping.t": "Date limite",
"shared.attributeMapping.due": "Date d'échéance",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "पिछले हफ्ते",
"drawer.attributes.thisWeek": "इस सप्ताह",
"drawer.attributes.thisMonth": "इस महीने",
"drawer.attributes.nextMonth": "अगले महीने",
"drawer.attributes.overdue": "अतित",
"drawer.attributes.elapsed": "बीता हुआ",
"drawer.sorting.fileSorting": "वे दिखाई देते हैं जैसे कि वे फ़ाइल में हैं, कार्य क्रमबद्ध करें",
"shared.attributeMapping.t": "सीमा तिथि",
"shared.attributeMapping.due": "समापन तिथि",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "múlt hét",
"drawer.attributes.thisWeek": "ez a hét",
"drawer.attributes.thisMonth": "ez a hónap",
"drawer.attributes.nextMonth": "következő hónap",
"drawer.attributes.overdue": "késedelmes",
"drawer.attributes.elapsed": "eltelt",
"drawer.sorting.fileSorting": "Feladatok rendezése, ahogy megjelennek a fájlban",
"shared.attributeMapping.t": "Hátralévő dátum",
"shared.attributeMapping.due": "Határidő",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "la settimana scorsa",
"drawer.attributes.thisWeek": "questa settimana",
"drawer.attributes.thisMonth": "questo mese",
"drawer.attributes.nextMonth": "il prossimo mese",
"drawer.attributes.overdue": "in ritardo",
"drawer.attributes.elapsed": "trascorso",
"drawer.sorting.fileSorting": "Ordina i compiti come appaiono nel file",
"shared.attributeMapping.t": "Data di scadenza",
"shared.attributeMapping.due": "Data di scadenza",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "先週",
"drawer.attributes.thisWeek": "今週",
"drawer.attributes.thisMonth": "今月",
"drawer.attributes.nextMonth": "来月",
"drawer.attributes.overdue": "期限切れ",
"drawer.attributes.elapsed": "経過",
"drawer.sorting.fileSorting": "ファイルに表示される順にタスクを並べ替え",
"shared.attributeMapping.t": "期限日",
"shared.attributeMapping.due": "期日",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "지난 주",
"drawer.attributes.thisWeek": "이번 주",
"drawer.attributes.thisMonth": "이번 달",
"drawer.attributes.nextMonth": "다음 달",
"drawer.attributes.overdue": "연체",
"drawer.attributes.elapsed": "경과",
"drawer.sorting.fileSorting": "파일에 나타나는 대로 작업 정렬",
"shared.attributeMapping.t": "임계 날짜",
"shared.attributeMapping.due": "마감일",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "ostatni tydzień",
"drawer.attributes.thisWeek": "w tym tygodniu",
"drawer.attributes.thisMonth": "w tym miesiącu",
"drawer.attributes.nextMonth": "następny miesiąc",
"drawer.attributes.overdue": "zaległy",
"drawer.attributes.elapsed": "upłynął",
"drawer.sorting.fileSorting": "Sortuj zadania tak, jak występują w pliku",
"shared.attributeMapping.t": "Data progowa",
"shared.attributeMapping.due": "Termin",
Expand Down
5 changes: 4 additions & 1 deletion src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"settings.light": "Claro",
"settings.dark": "Escuro",
"settings.language": "Idioma",
"settings.notificationThreshold": "Prog powiadomień",
"settings.notificationThreshold": "Limiar de notificação",
"settings.bulkTodoCreation": "Texto em várias linhas cria tarefas separadas",
"settings.matomo": "Permitir análise do Matomo",
"settings.zoom": "Zoom",
Expand All @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "semana passada",
"drawer.attributes.thisWeek": "esta semana",
"drawer.attributes.thisMonth": "este mês",
"drawer.attributes.nextMonth": "próximo mês",
"drawer.attributes.overdue": "atrasado",
"drawer.attributes.elapsed": "decorrido",
"drawer.sorting.fileSorting": "Ordenar tarefas como aparecem no ficheiro",
"shared.attributeMapping.t": "Data de limite",
"shared.attributeMapping.due": "Data de vencimento",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "на прошлой неделе",
"drawer.attributes.thisWeek": "на этой неделе",
"drawer.attributes.thisMonth": "в этом месяце",
"drawer.attributes.nextMonth": "следующий месяц",
"drawer.attributes.overdue": "просроченный",
"drawer.attributes.elapsed": "прошедший",
"drawer.sorting.fileSorting": "Сортировать задачи в порядке их появления в файле",
"shared.attributeMapping.t": "Дата порога",
"shared.attributeMapping.due": "Дата выполнения",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"drawer.attributes.lastWeek": "на прошлой неделе",
"drawer.attributes.thisWeek": "bu hafta",
"drawer.attributes.thisMonth": "bu ay",
"drawer.attributes.nextMonth": "gelecek ay",
"drawer.attributes.overdue": "gecikmiş",
"drawer.attributes.elapsed": "geçmiş",
"drawer.sorting.fileSorting": "Görevleri dosyada göründükleri sıraya göre sırala",
"shared.attributeMapping.t": "Eşik tarihi",
"shared.attributeMapping.due": "Bitiş tarihi",
Expand Down
5 changes: 4 additions & 1 deletion src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
"drawer.attributes.yesterday": "昨天",
"drawer.attributes.lastWeek": "上周",
"drawer.attributes.thisWeek": "本周",
"drawer.attributes.thisMonth": "本月",
"drawer.attributes.thisMonth": "本月",
"drawer.attributes.nextMonth": "下个月",
"drawer.attributes.overdue": "过期",
"drawer.attributes.elapsed": "已过",
"drawer.sorting.fileSorting": "按照它们在文件中出现的顺序排序任务",
"shared.attributeMapping.t": "阈值日期",
"shared.attributeMapping.due": "截止日期",
Expand Down
3 changes: 3 additions & 0 deletions src/main/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ const config: Store<Settings> = new Store<Settings>({
'2.0.12': store => {
console.log('Migrating from 2.0.11 → 2.0.12');
store.set('channel', getChannel());
store.set('fileWatcherAtomic', 1000);
store.set('fileWatcherPolling', false);
store.set('fileWatcherPollingInterval', 100);
},
}
});
Expand Down
17 changes: 13 additions & 4 deletions src/main/modules/File/Watcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@ function createFileWatcher(files: FileObject[]): void {
console.log(`Destroyed old file watcher`);
}

const hasActiveEntry = files.some(file => file.active);
if (!hasActiveEntry && files.length > 0) {
files[0].active = true;
config.set('files', files)
}

const fileWatcherAtomic = config.get('fileWatcherAtomic') || 1000;
const fileWatcherPolling = config.get('fileWatcherPolling') || false;
const fileWatcherPollingInterval = config.get('fileWatcherPollingInterval') || 100;

watcher = chokidar.watch(files.map((file) => file.todoFilePath), {
awaitWriteFinish: {
stabilityThreshold: 50,
pollInterval: 50,
},
atomic: fileWatcherAtomic,
usePolling: fileWatcherPolling,
interval: fileWatcherPollingInterval
});

watcher
Expand Down
20 changes: 8 additions & 12 deletions src/renderer/Drawer/Attributes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const DrawerAttributes: React.FC<DrawerAttributesProps> = memo(({
}) => {
const firstTabbableElementRef = useRef<HTMLDivElement | null>(null);
const [hovered, setHovered] = useState<string | null>(null);

const isAttributesEmpty = useMemo(
() => !attributes || Object.values(attributes).every((attribute) => !Object.keys(attribute).length),
[attributes]
Expand All @@ -39,15 +38,12 @@ const DrawerAttributes: React.FC<DrawerAttributesProps> = memo(({
if (!attributes) {
return null;
}

const isDate = ['due', 't', 'completed', 'created'].includes(attributeKey);
const processedAttributes = {};

Object.keys(attributes).forEach((key) => {
if (attributes[key]) {
const count = attributes[key].count;
const formattedValues = settings.useHumanFriendlyDates && isDate ? friendlyDate(key, settings.language, t) : [key];

const formattedValues = settings.useHumanFriendlyDates && isDate ? friendlyDate(key, attributeKey, settings.language, t) : [key];
formattedValues.forEach((formattedValue) => {
if (!processedAttributes[formattedValue]) {
processedAttributes[formattedValue] = {
Expand All @@ -65,17 +61,17 @@ const DrawerAttributes: React.FC<DrawerAttributesProps> = memo(({
});
}
});

const sorting = [t('drawer.attributes.overdue'), t('drawer.attributes.elapsed'), t('drawer.attributes.lastWeek'), t('drawer.attributes.yesterday'), t('drawer.attributes.today'), t('drawer.attributes.tomorrow'), t('drawer.attributes.thisWeek'), t('drawer.attributes.nextWeek'), t('drawer.attributes.thisMonth'), t('drawer.attributes.nextMonth')]
const sortedAttributes = Object.fromEntries(
Object.entries(processedAttributes).sort(([, a], [, b]) => {
const lastDateA = a.aggregatedValues.length > 0 ? a.aggregatedValues[a.aggregatedValues.length - 1] : 0;
const lastDateB = b.aggregatedValues.length > 0 ? b.aggregatedValues[b.aggregatedValues.length - 1] : 0;
return new Date(lastDateA).getTime() - new Date(lastDateB).getTime();
Object.entries(processedAttributes)
.sort(([aKey, a], [bKey, b]) => {
const indexA = sorting.indexOf(a.name);
const indexB = sorting.indexOf(b.name);
return (indexA !== -1 ? indexA : Number.MAX_SAFE_INTEGER) - (indexB !== -1 ? indexB : Number.MAX_SAFE_INTEGER);
})
);

return sortedAttributes;
};
};

const handleAccordionToggle = (index: number) => {
const updatedAccordionOpenState = settings.accordionOpenState;
Expand Down
Loading

0 comments on commit a0b46f5

Please sign in to comment.