Skip to content

Commit

Permalink
Added shift key to due date commands, added polling interval to file …
Browse files Browse the repository at this point in the history
…watcher
  • Loading branch information
ransome1 committed Dec 8, 2022
1 parent 1348d78 commit 05b8195
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 42 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sleek",
"productName": "sleek",
"version": "1.3.1-rc.1",
"version": "1.3.1-rc.2",
"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)",
"category": "ProjectManagement",
Expand Down Expand Up @@ -136,6 +136,7 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.1.1",
"@playwright/test": "^1.28.1",
"bulma": "^0.9.2",
"chokidar": "^3.5.1",
"electron-updater": "^5.3.0",
Expand All @@ -145,16 +146,17 @@
"jstodotxt": "^0.10.0",
"marked": "^4.0.12",
"peggy": "^2.0.1",
"playwright": "^1.28.1",
"sass": "^1.34.1",
"sugar": "^2.0.6",
"vanillajs-datepicker": "^1.1.4"
},
"devDependencies": {
"cross-env": "^7.0.3",
"electron": "18.3.7",
"electron-builder": "23.0.2",
"electron-notarize": "^1.2.2",
"electron-reloader": "^1.2.2",
"cross-env": "^7.0.3",
"eslint": "^8.6.0"
}
}
11 changes: 8 additions & 3 deletions src/js/keyboard.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export async function registerShortcuts() {

// due date plus 1

if(event.altKey && event.key === "ArrowUp") {
if(event.altKey && event.shiftKey && event.key === "ArrowUp") {
setDueDate(1).then(response => {
console.log(response);
}).catch(error => {
Expand All @@ -144,7 +144,7 @@ export async function registerShortcuts() {

// due date minus 1

if(event.altKey && event.key === "ArrowDown") {
if(event.altKey && event.shiftKey && event.key === "ArrowDown") {
setDueDate(-1).then(response => {
console.log(response);
}).catch(error => {
Expand All @@ -155,7 +155,7 @@ export async function registerShortcuts() {

// reset due date

if(event.altKey && (event.key === "ArrowRight" || event.key === "ArrowLeft")) {
if(event.altKey && event.shiftKey && (event.key === "ArrowRight" || event.key === "ArrowLeft")) {
setDueDate(0).then(response => {
console.log(response);
}).catch(error => {
Expand Down Expand Up @@ -412,6 +412,11 @@ export async function registerShortcuts() {
return false;
}

if((event.ctrlKey || event.metaKey) && event.key === "n") {
window.api.send("openOrCreateFile", ["create"]);
return false;
}

// ******************************************************
// copy file content to clipboard
// ******************************************************
Expand Down
7 changes: 5 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async function startFileWatcher(pathToFile, bookmark) {
try {

// TODO: consider doing this in store.config.js
// skip persisted files and go with ENV if set
// skip persisted files and go with the one set by ENV
if(process.env.SLEEK_CUSTOM_FILE && fs.existsSync(process.env.SLEEK_CUSTOM_FILE)) pathToFile = process.env.SLEEK_CUSTOM_FILE

// if requested file is not found on disk, this function will be aborted
Expand Down Expand Up @@ -241,7 +241,10 @@ async function startFileWatcher(pathToFile, bookmark) {
if(process.mas) stopAccessingSecurityScopedResource = app.startAccessingSecurityScopedResource(file[3])

if(fileWatcher) await fileWatcher.close().then(() => console.log("Info: Filewatcher closed"));
fileWatcher = await chokidar.watch(file[1])
fileWatcher = await chokidar.watch(file[1], {
usePolling: true,
interval: 100
})
fileWatcher
.on("add", async function(fileToLink) {

Expand Down
3 changes: 2 additions & 1 deletion test/empty_done.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ x 2022-10-29 This is a test todo that needs to be archived
x 2022-11-01 This is a test todo that needs to be archived
x 2022-11-04 This is a test todo that needs to be archived
x 2022-11-06 This is a test todo that needs to be archived
x 2022-11-28 This is a test todo that needs to be archived
x 2022-11-28 This is a test todo that needs to be archived
x 2022-12-08 This is a test todo that needs to be archived
88 changes: 54 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
resolved "https://registry.yarnpkg.com/7zip-bin/-/7zip-bin-5.1.1.tgz#9274ec7460652f9c632c59addf24efb1684ef876"
integrity sha512-sAP4LldeWNz0lNzmTird3uWfFDWWTeg6V/MsmyyLR9X1idwKBWIgt/ZvinqQldJm3LecKEs1emkbquO6PCiLVQ==

"@babel/runtime@^7.17.2":
version "7.20.1"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9"
integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==
"@babel/runtime@^7.20.6":
version "7.20.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3"
integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA==
dependencies:
regenerator-runtime "^0.13.10"
regenerator-runtime "^0.13.11"

"@develar/schema-utils@~2.6.5":
version "2.6.5"
Expand Down Expand Up @@ -128,6 +128,14 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@playwright/test@^1.28.1":
version "1.28.1"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.28.1.tgz#e5be297e024a3256610cac2baaa9347fd57c7860"
integrity sha512-xN6spdqrNlwSn9KabIhqfZR7IWjPpFK1835tFNgjrlysaSezuX8PYUwaz38V/yI8TJLG9PkAMEXoHRXYXlpTPQ==
dependencies:
"@types/node" "*"
playwright-core "1.28.1"

"@sindresorhus/is@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
Expand Down Expand Up @@ -178,14 +186,14 @@
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==

"@types/node@*":
version "18.11.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
version "18.11.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.11.tgz#1d455ac0211549a8409d3cdb371cd55cc971e8dc"
integrity sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==

"@types/node@^16.11.26":
version "16.18.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.3.tgz#d7f7ba828ad9e540270f01ce00d391c54e6e0abc"
integrity sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==
version "16.18.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.6.tgz#87846192fd51b693368fad3e99123169225621d4"
integrity sha512-vmYJF0REqDyyU0gviezF/KHq/fYaUbFhkcNbQCuPGFQj6VTbXuHZoxs/Y7mutWe73C8AC6l9fFu8mSYiBAqkGA==

"@types/plist@^3.0.1":
version "3.0.2"
Expand All @@ -211,9 +219,9 @@
integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==

"@types/yargs@^17.0.1":
version "17.0.14"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.14.tgz#0943473052c24bd8cf2d1de25f1a710259327237"
integrity sha512-9Pj7abXoW1RSTcZaL2Hk6G2XyLMlp5ECdVC/Zf2p/KBjC3srijLGgRAXOBjtFrJoIrvxdTKyKDA14bEcbxBaWw==
version "17.0.17"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.17.tgz#5672e5621f8e0fca13f433a8017aae4b7a2a03e7"
integrity sha512-72bWxFKTK6uwWJAVT+3rF6Jo6RTojiJ27FQo8Rf60AL+VZbzoVPnMFhKsUnbjR8A3BTCYQ7Mv3hnl8T0A+CX9g==
dependencies:
"@types/yargs-parser" "*"

Expand Down Expand Up @@ -1020,9 +1028,9 @@ eslint-visitor-keys@^3.3.0:
integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==

eslint@^8.6.0:
version "8.28.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.28.0.tgz#81a680732634677cc890134bcdd9fdfea8e63d6e"
integrity sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==
version "8.29.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.29.0.tgz#d74a88a20fb44d59c51851625bc4ee8d0ec43f87"
integrity sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==
dependencies:
"@eslint/eslintrc" "^1.3.3"
"@humanwhocodes/config-array" "^0.11.6"
Expand Down Expand Up @@ -1128,9 +1136,9 @@ fast-levenshtein@^2.0.6:
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==

fastq@^1.6.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c"
integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==
version "1.14.0"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.14.0.tgz#107f69d7295b11e0fccc264e1fc6389f623731ce"
integrity sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==
dependencies:
reusify "^1.0.4"

Expand Down Expand Up @@ -1428,11 +1436,11 @@ i18next-fs-backend@^2.0.0:
integrity sha512-fzeiFOXqsMiFAFUnNyC4buERI11vTAuf7JIDWqaiPgBK3R+XJQMSY1LyoXaWspBEFaAkXH/0uMbOv7nttBFztg==

i18next@^22.0.4:
version "22.0.6"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.0.6.tgz#d7029912f8aa74ff295c0d9afd1b7dea45859b49"
integrity sha512-RlreNGoPIdDP4QG+qSA9PxZKGwlzmcozbI9ObI6+OyUa/Rp0EjZZA9ubyBjw887zVNZsC+7FI3sXX8oiTzAfig==
version "22.1.4"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.1.4.tgz#907a4e710889ae23fb92f3510a0f7147823f92ff"
integrity sha512-MCDtNRyovLY22rgLoZdCzg2QIza1V1A/3Hxb99akJzTDjcqCRWEsglTpFUt0vUjOxSxz+WmxmFETLHORRS+n6Q==
dependencies:
"@babel/runtime" "^7.17.2"
"@babel/runtime" "^7.20.6"

iconv-corefoundation@^1.1.7:
version "1.1.7"
Expand Down Expand Up @@ -1750,9 +1758,9 @@ make-dir@^3.0.0:
semver "^6.0.0"

marked@^4.0.12:
version "4.2.3"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.3.tgz#bd76a5eb510ff1d8421bc6c3b2f0b93488c15bea"
integrity sha512-slWRdJkbTZ+PjkyJnE30Uid64eHwbwa1Q25INCAYfZlK4o6ylagBy/Le9eWntqJFoFT93ikUKMv47GZ4gTwHkw==
version "4.2.4"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.2.4.tgz#5a4ce6c7a1ae0c952601fce46376ee4cf1797e1c"
integrity sha512-Wcc9ikX7Q5E4BYDPvh1C6QNSxrjC9tBgz+A/vAhp59KXUgachw++uMvMKiSW8oA85nopmPZcEvBoex/YLMsiyA==

matcher@^3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -1798,9 +1806,9 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
brace-expansion "^1.1.7"

minimatch@^5.0.1:
version "5.1.0"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7"
integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==
version "5.1.1"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.1.tgz#6c9dffcf9927ff2a31e74b5af11adf8b9604b022"
integrity sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==
dependencies:
brace-expansion "^2.0.1"

Expand Down Expand Up @@ -1952,6 +1960,18 @@ pify@^3.0.0:
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==

playwright-core@1.28.1:
version "1.28.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.28.1.tgz#8400be9f4a8d1c0489abdb9e75a4cc0ffc3c00cb"
integrity sha512-3PixLnGPno0E8rSBJjtwqTwJe3Yw72QwBBBxNoukIj3lEeBNXwbNiKrNuB1oyQgTBw5QHUhNO3SteEtHaMK6ag==

playwright@^1.28.1:
version "1.28.1"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.28.1.tgz#f23247f1de466ff73d7230d94df96271e5da6583"
integrity sha512-92Sz6XBlfHlb9tK5UCDzIFAuIkHHpemA9zwUaqvo+w7sFMSmVMGmvKcbptof/eJObq63PGnMhM75x7qxhTR78Q==
dependencies:
playwright-core "1.28.1"

plist@^3.0.1, plist@^3.0.4:
version "3.0.6"
resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.6.tgz#7cfb68a856a7834bca6dbfe3218eb9c7740145d3"
Expand Down Expand Up @@ -2051,7 +2071,7 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"

regenerator-runtime@^0.13.10:
regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
Expand Down Expand Up @@ -2124,9 +2144,9 @@ run-parallel@^1.1.9:
queue-microtask "^1.2.2"

rxjs@^7.5.2:
version "7.5.7"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.7.tgz#2ec0d57fdc89ece220d2e702730ae8f1e49def39"
integrity sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==
version "7.6.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.6.0.tgz#361da5362b6ddaa691a2de0b4f2d32028f1eb5a2"
integrity sha512-DDa7d8TFNUalGC9VqXvQ1euWNN7sc63TrUCuM9J998+ViviahMIjKSOU7rfcgFOF+FCD71BhDRv4hrFz+ImDLQ==
dependencies:
tslib "^2.1.0"

Expand Down

0 comments on commit 05b8195

Please sign in to comment.