Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome1 committed Mar 28, 2024
2 parents 109c1e9 + 4276a55 commit ebbc917
Show file tree
Hide file tree
Showing 32 changed files with 171 additions and 203 deletions.
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" date="2024-03-23"/>
<release version="2.0.13-rc.2" date="2024-03-27"/>
</releases>
<url type="homepage">https://github.com/ransome1/sleek</url>
<url type="contact">https://github.com/ransome1/sleek/issues</url>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sleek",
"version": "2.0.12",
"version": "2.0.13-rc.2",
"main": "./src/main/main.tsx",
"scripts": {
"build": "concurrently \"yarn run peggy\" \"yarn run build:main\" \"yarn run build:renderer\"",
Expand Down Expand Up @@ -147,7 +147,7 @@
"webpack-merge": "^5.9.0"
},
"build": {
"buildVersion": "41",
"buildVersion": "42",
"asar": true,
"asarUnpack": "**\\*.{node,dll}",
"files": [
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",
"version": "2.0.13",
"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"
version: "2.0.13-rc.2"
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
3 changes: 3 additions & 0 deletions src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Přiblížení",
"settings.disableAnimations": "Vypnout animace",
"settings.useHumanFriendlyDates": "Používat lidsky přívětivá data",
"settings.weekStart": "První den týdne",
"settings.0": "Neděle",
"settings.1": "Pondělí",
"drawer.tabs.attributes": "Atributy",
"drawer.tabs.filters": "Filtry",
"drawer.tabs.sorting": "Řazení",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Vergrößerung",
"settings.disableAnimations": "Animationen deaktivieren",
"settings.useHumanFriendlyDates": "Benutze benutzerfreundliche Datumsangaben",
"settings.weekStart": "Erster Tag der Woche",
"settings.0": "Sonntag",
"settings.1": "Montag",
"drawer.tabs.attributes": "Attribute",
"drawer.tabs.filters": "Filter",
"drawer.tabs.sorting": "Sortierung",
Expand Down
89 changes: 0 additions & 89 deletions src/locales/en-gb.json

This file was deleted.

3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Disable animations",
"settings.useHumanFriendlyDates": "Use human friendly dates",
"settings.weekStart": "First day of the week",
"settings.0": "Sunday",
"settings.1": "Monday",
"drawer.tabs.attributes": "Attributes",
"drawer.tabs.filters": "Filters",
"drawer.tabs.sorting": "Sorting",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"settings.matomo": "Permitir análisis de Matomo",
"settings.zoom": "Zoom",
"settings.disableAnimations": "Desactivar animaciones",
"settings.useHumanFriendlyDates": "Usar fechas amigables para el usuario",
"settings.weekStart": "Primer día de la semana",
"settings.0": "Domingo",
"settings.1": "Lunes",
"drawer.tabs.attributes": "Atributos",
"drawer.tabs.filters": "Filtros",
"drawer.tabs.sorting": "Ordenación",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Désactiver les animations",
"settings.useHumanFriendlyDates": "Utiliser des dates conviviales",
"settings.weekStart": "Premier jour de la semaine",
"settings.0": "Dimanche",
"settings.1": "Lundi",
"drawer.tabs.attributes": "Attributs",
"drawer.tabs.filters": "Filtres",
"drawer.tabs.sorting": "Tri",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "ज़ूम",
"settings.disableAnimations": "एनिमेशन अक्षम करें",
"settings.useHumanFriendlyDates": "मानव-मित्रता योग्य तिथियाँ उपयोग करें",
"settings.weekStart": "सप्ताह का पहला दिन",
"settings.0": "रविवार",
"settings.1": "सोमवार",
"drawer.tabs.attributes": "गुण",
"drawer.tabs.filters": "फ़िल्टर",
"drawer.tabs.sorting": "क्रमबद्ध करना",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Nagyítás",
"settings.disableAnimations": "Animációk kikapcsolása",
"settings.useHumanFriendlyDates": "Használjon emberbarát dátumokat",
"settings.weekStart": "Hét első napja",
"settings.0": "Vasárnap",
"settings.1": "Hétfő",
"drawer.tabs.attributes": "Tulajdonságok",
"drawer.tabs.filters": "Szűrők",
"drawer.tabs.sorting": "Rendezés",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Disattiva animazioni",
"settings.useHumanFriendlyDates": "Usa date user-friendly",
"settings.weekStart": "Primo giorno della settimana",
"settings.0": "Domenica",
"settings.1": "Lunedì",
"drawer.tabs.attributes": "Attributi",
"drawer.tabs.filters": "Filtri",
"drawer.tabs.sorting": "Ordinamento",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "ズーム",
"settings.disableAnimations": "アニメーションを無効にする",
"settings.useHumanFriendlyDates": "使いやすい日付を使用する",
"settings.weekStart": "週の初日",
"settings.0": "日曜日",
"settings.1": "月曜日",
"drawer.tabs.attributes": "属性",
"drawer.tabs.filters": "フィルター",
"drawer.tabs.sorting": "ソート",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "",
"settings.disableAnimations": "애니메이션 비활성화",
"settings.useHumanFriendlyDates": "사용자 친화적인 날짜 사용",
"settings.weekStart": "주의 첫날",
"settings.0": "일요일",
"settings.1": "월요일",
"drawer.tabs.attributes": "속성",
"drawer.tabs.filters": "필터",
"drawer.tabs.sorting": "정렬",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Powiększenie",
"settings.disableAnimations": "Wyłącz animacje",
"settings.useHumanFriendlyDates": "Używaj przyjaznych dla użytkownika dat",
"settings.weekStart": "Pierwszy dzień tygodnia",
"settings.0": "Niedziela",
"settings.1": "Poniedziałek",
"drawer.tabs.attributes": "Atrybuty",
"drawer.tabs.filters": "Filtry",
"drawer.tabs.sorting": "Sortowanie",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Desativar animações",
"settings.useHumanFriendlyDates": "Usar datas amigáveis",
"settings.weekStart": "Primeiro dia da semana",
"settings.0": "Domingo",
"settings.1": "Segunda-feira",
"drawer.tabs.attributes": "Atributos",
"drawer.tabs.filters": "Filtros",
"drawer.tabs.sorting": "Ordenação",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Масштаб",
"settings.disableAnimations": "Отключить анимации",
"settings.useHumanFriendlyDates": "Использовать удобочитаемые даты",
"settings.weekStart": "Первый день недели",
"settings.0": "Воскресенье",
"settings.1": "Понедельник",
"drawer.tabs.attributes": "Атрибуты",
"drawer.tabs.filters": "Фильтры",
"drawer.tabs.sorting": "Сортировка",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Yakınlaştırma",
"settings.disableAnimations": "Animasyonları devre dışı bırak",
"settings.useHumanFriendlyDates": "İnsan dostu tarihleri kullan",
"settings.weekStart": "Haftanın ilk günü",
"settings.0": "Pazar",
"settings.1": "Pazartesi",
"drawer.tabs.attributes": "Özellikler",
"drawer.tabs.filters": "Filtreler",
"drawer.tabs.sorting": "Sıralama",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "缩放",
"settings.disableAnimations": "禁用动画",
"settings.useHumanFriendlyDates": "使用人性化日期",
"settings.weekStart": "一周的第一天",
"settings.0": "星期日",
"settings.1": "星期一",
"drawer.tabs.attributes": "属性",
"drawer.tabs.filters": "过滤器",
"drawer.tabs.sorting": "排序",
Expand Down
14 changes: 14 additions & 0 deletions src/main/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ const config: Store<Settings> = new Store<Settings>({
store.set('fileWatcherPolling', false);
store.set('fileWatcherPollingInterval', 100);
},
'2.0.13': store => {
console.log('Migrating from 2.0.12 → 2.0.13');
store.set('weekStart', 1);
store.delete('fileWatcherAtomic');
store.delete('fileWatcherPolling');
store.delete('fileWatcherPollingInterval');
store.delete('language');
store.set('chokidarOptions', {
awaitWriteFinish: {
stabilityThreshold: 100,
pollInterval: 100
}
})
},
}
});

Expand Down
12 changes: 3 additions & 9 deletions src/main/modules/File/Watcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ function createFileWatcher(files: FileObject[]): void {
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), {
atomic: fileWatcherAtomic,
usePolling: fileWatcherPolling,
interval: fileWatcherPollingInterval
});
const chokidarOptions = config.get('chokidarOptions');

watcher = chokidar.watch(files.map((file) => file.todoFilePath), chokidarOptions);

watcher
.on('add', (file) => {
Expand Down
19 changes: 7 additions & 12 deletions src/main/modules/ProcessDataRequest/ProcessTodoObjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ function handleCompletedTodoObjects(todoObjects: TodoObject[]): TodoObject[] {
const showCompleted: boolean = config.get('showCompleted');
return todoObjects.map((todoObject: TodoObject) => {
if(todoObject.complete && !showCompleted) {
todoObject.visible = false;
return false;
} else {
return todoObject;
}
return todoObject;
});
}

Expand All @@ -74,20 +75,14 @@ function handleTodoObjectsDates(todoObjects: TodoObject[]): TodoObject[] {
const thresholdDateInTheFuture: boolean = config.get('thresholdDateInTheFuture');
const dueDateInTheFuture: boolean = config.get('dueDateInTheFuture');

return todoObjects.map((todoObject: TodoObject) => {
return todoObjects.filter((todoObject: TodoObject) => {
if (!todoObject.visible) return true;

if(!todoObject.visible) return todoObject;

const thresholdDate = dayjs(todoObject?.t);
const dueDate = dayjs(todoObject?.due);

if(thresholdDate && thresholdDate.isAfter(dayjs()) && !thresholdDateInTheFuture) {
todoObject.visible = false;
} else if(dueDate && dueDate.isAfter(dayjs()) && !dueDateInTheFuture) {
todoObject.visible = false;
}

return todoObject;
return !(thresholdDate && thresholdDate.isAfter(dayjs()) && !thresholdDateInTheFuture) &&
!(dueDate && dueDate.isAfter(dayjs()) && !dueDateInTheFuture);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const App = () => {
.catch((error) => {
console.error(error);
});
}, [settings.language]);
}, [settings.language]);

useEffect(() => {
const windowHeight = window.innerHeight;
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/Dialog/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { i18n } from '../Settings/LanguageSelector';
import { DatePicker, LocalizationProvider } from '@mui/x-date-pickers';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import dayjs from 'dayjs';
import updateLocale from 'dayjs/plugin/updateLocale';
import './DatePicker.scss';
dayjs.extend(updateLocale);

interface Props extends WithTranslation {
date: string | null;
Expand All @@ -21,6 +23,9 @@ const DatePickerComponent: React.FC<Props> = ({
handleChange,
t,
}) => {
dayjs.updateLocale(settings.language, {
weekStart: settings.weekStart,
});
return (
<LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale={settings.language}>
<DatePicker
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/Drawer/Attributes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const DrawerAttributes: React.FC<DrawerAttributesProps> = memo(({
Object.keys(attributes).forEach((key) => {
if (attributes[key]) {
const count = attributes[key].count;
const formattedValues = settings.useHumanFriendlyDates && isDate ? friendlyDate(key, attributeKey, settings.language, t) : [key];
const formattedValues = settings.useHumanFriendlyDates && isDate ? friendlyDate(key, attributeKey, settings, t) : [key];

formattedValues.forEach((formattedValue) => {
if (!processedAttributes[formattedValue]) {
Expand Down
Loading

0 comments on commit ebbc917

Please sign in to comment.