Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome1 committed Feb 26, 2025
2 parents dbe09ba + 9b875f6 commit 1dc714b
Show file tree
Hide file tree
Showing 65 changed files with 753 additions and 340 deletions.
71 changes: 36 additions & 35 deletions .github/workflows/code-scan-update-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ on:
branches:
- '*'
jobs:
trigger-flathub_build:
name: Update commit id in Flathub repo
runs-on: ubuntu-latest
steps:
- name: Trigger Flathub build
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.TRIGGER_FLATHUB_BUILD }}
repository: ransome1/com.github.ransome1.sleek
event-type: trigger-flathub-build
client-payload: '{"commit_id": "${{ github.sha }}"}'
snyk:
runs-on: ubuntu-latest
steps:
Expand All @@ -39,29 +28,6 @@ jobs:
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
# codecov:
# needs: njsscan
# name: Codecov
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# language: ['javascript']
# steps:
# - name: Checkout code
# uses: actions/checkout@master
# - name: Set up latest available Nodejs
# uses: actions/setup-node@master
# - name: Install dependencies
# run: yarn install
# - name: Build
# run: yarn build
# - name: Run tests
# run: yarn run test
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v4
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
codeql:
needs: njsscan
name: CodeQL
Expand All @@ -83,10 +49,33 @@ jobs:
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
codecov:
needs: codeql
name: Codecov
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ['javascript']
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Set up latest available Nodejs
uses: actions/setup-node@master
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
mirror:
name: Mirror code to opencode.net
runs-on: ubuntu-latest
needs: codeql
needs: Codecov
steps:
- uses: actions/checkout@master
with:
Expand All @@ -96,3 +85,15 @@ jobs:
gitlab_url: https://www.opencode.net/ransome/sleek.git
username: ransome
gitlab_pat: ${{ secrets.GITLAB_PAT }}
trigger-flathub_build:
name: Update commit id in Flathub repo
runs-on: ubuntu-latest
needs: mirror
steps:
- name: Trigger Flathub build
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.TRIGGER_FLATHUB_BUILD }}
repository: ransome1/com.github.ransome1.sleek
event-type: trigger-flathub-build
client-payload: '{"commit_id": "${{ github.sha }}"}'
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@

All notable changes to sleek will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.17] - 2025-02-22
## [2.0.18] - 2025-02-26

### Added

* `vitest` as new testing framework
* Test cases for `Notification` module
* Configured `codecov` for testing during pipeline runs

### Enhanced

* Refactored stores
* Refactored `Notification` module
* Refactored `compact view`

## [2.0.17] - 2025-02-24

### Added

Expand Down
6 changes: 4 additions & 2 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import { resolve } from 'path'
import react from '@vitejs/plugin-react'

export default {
export default defineConfig({
main: {},
preload: {},
renderer: {
Expand All @@ -12,4 +14,4 @@ export default {
},
plugins: [react()]
}
}
})
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sleek",
"productName": "sleek",
"version": "2.0.17",
"version": "2.0.18",
"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 Expand Up @@ -40,19 +40,19 @@
"build:mas": "npm run build && electron-builder build -m mas --universal --publish never",
"build:masdev": "npm run build && electron-builder build -m mas-dev --publish never",
"postinstall": "electron-builder install-app-deps",
"peggy": "npx peggy --format es --dts --output ./src/main/modules/Filters/FilterLang.ts ./src/main/modules/Filters/FilterLang.pegjs"
"peggy": "npx peggy --format es --dts --output ./src/main/Filters/FilterLang.ts ./src/main/Filters/FilterLang.pegjs"
},
"dependencies": {
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mui/icons-material": "^6.4.5",
"@mui/material": "^6.4.5",
"@mui/system": "^6.4.0",
"@mui/x-date-pickers": "^7.27.0",
"@mui/system": "^6.4.3",
"@mui/x-date-pickers": "^7.27.1",
"chokidar": "^4.0.3",
"dayjs": "^1.11.13",
"electron-store": "^10.0.0",
"i18next": "^24.2.0",
"electron-store": "^10.0.1",
"i18next": "^24.2.2",
"jstodotxt": "1.0.0-alpha.3",
"react": "^19.0.0",
"react-autosuggest": "^10.1.0",
Expand All @@ -67,7 +67,7 @@
"@electron-toolkit/eslint-config-prettier": "^3.0.0",
"@electron-toolkit/eslint-config-ts": "^3.0.0",
"@electron-toolkit/tsconfig": "^1.0.1",
"@types/node": "^22.13.4",
"@types/node": "^22.13.5",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@vitejs/plugin-react": "^4.3.4",
Expand All @@ -78,8 +78,8 @@
"peggy": "^4.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sass": "^1.85.0",
"sass": "^1.85.1",
"typescript": "^5.7.3",
"vitest": "^3.0.6"
"vitest": "^3.0.7"
}
}
1 change: 1 addition & 0 deletions src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Přidat jako úkol",
"search.filters.create": "Vytvořit vyhledávací filtr",
"add": "Přidat",
"todoDialog.input.placeholder": "Klikněte na tlačítko nápovědy, abyste se dozvěděli, co sem napsat",
"todoDialog.footer.update": "Aktualizovat",
"cancel": "Zrušit",
"close": "Zavřít",
Expand Down
1 change: 1 addition & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Als Aufgabe hinzufügen",
"search.filters.create": "Suchfilter erstellen",
"add": "Hinzufügen",
"todoDialog.input.placeholder": "Klicken Sie auf die Hilfeschaltfläche, um zu erfahren, was Sie hier eingeben sollen",
"todoDialog.footer.update": "Aktualisieren",
"cancel": "Abbrechen",
"close": "Schließen",
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Add as todo",
"search.filters.create": "Create search filter",
"add": "Add",
"todoDialog.input.placeholder": "Click the help button to learn what to type here",
"todoDialog.footer.update": "Update",
"cancel": "Cancel",
"close": "Close",
Expand Down
1 change: 1 addition & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Agregar como tarea",
"search.filters.create": "Crear filtro de búsqueda",
"add": "Agregar",
"todoDialog.input.placeholder": "Haga clic en el botón de ayuda para saber qué escribir aquí",
"todoDialog.footer.update": "Actualizar",
"cancel": "Cancelar",
"close": "Cerrar",
Expand Down
1 change: 1 addition & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Ajouter en tant que tâche",
"search.filters.create": "Créer un filtre de recherche",
"add": "Ajouter",
"todoDialog.input.placeholder": "Cliquez sur le bouton d'aide pour savoir quoi taper ici",
"todoDialog.footer.update": "Mettre à jour",
"cancel": "Annuler",
"close": "Fermer",
Expand Down
1 change: 1 addition & 0 deletions src/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "काम के रूप में जोड़ें",
"search.filters.create": "खोज फ़िल्टर बनाएं",
"add": "जोड़ें",
"todoDialog.input.placeholder": "मदद बटन पर क्लिक करें यह जानने के लिए कि यहां क्या टाइप करना है",
"todoDialog.footer.update": "अपडेट करें",
"cancel": "रद्द करें",
"close": "बंद करें",
Expand Down
1 change: 1 addition & 0 deletions src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Hozzáadás feladatként",
"search.filters.create": "Keresési szűrő létrehozása",
"add": "Hozzáadás",
"todoDialog.input.placeholder": "Kattintson a Súgó gombra, hogy megtudja, mit írjon ide",
"todoDialog.footer.update": "Frissítés",
"cancel": "Mégse",
"close": "Bezárás",
Expand Down
1 change: 1 addition & 0 deletions src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Aggiungi come attività",
"search.filters.create": "Crea filtro di ricerca",
"add": "Aggiungi",
"todoDialog.input.placeholder": "Fai clic sul pulsante di aiuto per sapere cosa scrivere qui",
"todoDialog.footer.update": "Aggiorna",
"cancel": "Annulla",
"close": "Chiudi",
Expand Down
1 change: 1 addition & 0 deletions src/locales/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "タスクとして追加",
"search.filters.create": "検索フィルターを作成する",
"add": "追加",
"todoDialog.input.placeholder": "ヘルプボタンをクリックして、ここに何を入力するかを学びます",
"todoDialog.footer.update": "更新",
"cancel": "キャンセル",
"close": "閉じる",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "할 일로 추가",
"search.filters.create": "검색 필터 생성",
"add": "추가",
"todoDialog.input.placeholder": "도움말 버튼을 클릭하여 여기에 무엇을 입력해야 하는지 알아보세요",
"todoDialog.footer.update": "업데이트",
"cancel": "취소",
"close": "닫기",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Dodaj jako zadanie",
"search.filters.create": "Utwórz filtr wyszukiwania",
"add": "Dodaj",
"todoDialog.input.placeholder": "Kliknij przycisk pomocy, aby dowiedzieć się, co tu wpisać",
"todoDialog.footer.update": "Aktualizuj",
"cancel": "Anuluj",
"close": "Zamknij",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Adicionar como tarefa",
"search.filters.create": "Crie filtro de pesquisa",
"add": "Adicionar",
"todoDialog.input.placeholder": "Clique no botão de ajuda para saber o que digitar aqui",
"todoDialog.footer.update": "Atualização",
"close": "fechar",
"todoDialog.snackbar.emptyInput": "Por favor, insira algo no campo de texto",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Adicionar como tarefa",
"search.filters.create": "Criar filtro de pesquisa",
"add": "Adicionar",
"todoDialog.input.placeholder": "Clique no botão de ajuda para saber o que digitar aqui",
"todoDialog.footer.update": "Atualizar",
"cancel": "Cancelar",
"close": "Fechar",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Добавить как задачу",
"search.filters.create": "Создать фильтр поиска",
"add": "Добавить",
"todoDialog.input.placeholder": "Нажмите кнопку помощи, чтобы узнать, что ввести здесь",
"todoDialog.footer.update": "Обновить",
"cancel": "Отменить",
"close": "Закрыть",
Expand Down
1 change: 1 addition & 0 deletions src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "Görev olarak ekle",
"search.filters.create": "Arama filtresi oluştur",
"add": "Ekle",
"todoDialog.input.placeholder": "Yardım düğmesine tıklayın buraya ne yazacağınızı öğrenmek için",
"todoDialog.footer.update": "Güncelle",
"cancel": "İptal",
"close": "Kapat",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"search.addAsTodo": "添加为任务",
"search.filters.create": "创建搜索过滤器",
"add": "添加",
"todoDialog.input.placeholder": "点击帮助按钮以了解在此处输入什么",
"todoDialog.footer.update": "更新",
"cancel": "取消",
"close": "关闭",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import { app } from 'electron'
import { Item } from 'jstodotxt'
import { config } from '../../config'
import { handleNotification } from '../Notifications'
import { SettingsStore } from '../Stores/SettingsStore'
import { HandleNotification } from '../Notifications'
import { extractSpeakingDates } from '../Date'
import dayjs from 'dayjs'

let linesInFile: string[]
export const badge: Badge = { count: 0 }

function createTodoObject(
lineNumber: number,
string: string,
attributeType?: string,
attributeValue?: string
): TodoObject {
function createTodoObject(lineNumber: number, string: string, attributeType?: string, attributeValue?: string): TodoObject {
let content = string.replaceAll(/[\x10\r\n]/g, ' [LB] ')

const JsTodoTxtObject = new Item(content)
Expand Down Expand Up @@ -85,23 +80,21 @@ function createTodoObjects(fileContent: string | null): TodoObject[] | [] {
linesInFile = fileContent.split(/[\r\n]+/).filter((line) => line.trim() !== '')

// todo: might causes problems due to index offset created by it
const excludeLinesWithPrefix: string[] = config.get('excludeLinesWithPrefix') || []
const excludeLinesWithPrefix: string[] = SettingsStore.get('excludeLinesWithPrefix') || []

const todoObjects: TodoObject[] = linesInFile
.map((line, index) => {
if (excludeLinesWithPrefix.some((prefix) => line.startsWith(prefix))) {
return null
}
const todoObjects: TodoObject[] = linesInFile.map((line, index) => {
if (excludeLinesWithPrefix.some((prefix) => line.startsWith(prefix))) {
return null
}

const todoObject: TodoObject = createTodoObject(index, line)
const todoObject: TodoObject = createTodoObject(index, line)

if (todoObject.body && !todoObject.complete) {
handleNotification(todoObject.due, todoObject.body, badge)
}
if (SettingsStore.get('notificationsAllowed') && todoObject.body && !todoObject.complete) {
HandleNotification(dayjs(todoObject.due, 'YYYY-MM-DD'), todoObject.body, badge)
}

return todoObject
})
.filter(Boolean) as TodoObject[]
return todoObject
}).filter(Boolean) as TodoObject[]

app.setBadgeCount(badge.count)

Expand Down
Loading

0 comments on commit 1dc714b

Please sign in to comment.