diff --git a/.github/labeler.yml b/.github/labeler.yml index 4e7764f0d..d2aa29b1c 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -41,7 +41,6 @@ labels: matcher: title: '^deps(\(\w+\))?: .*' branch: '^renovate/.*' - files: ['pnpm-lock.yaml'] checks: - context: 'Semantic Pull Request' diff --git a/.github/workflows/pr-triage.yml b/.github/workflows/pr-triage.yml index 5b2dc505c..03f130e1c 100644 --- a/.github/workflows/pr-triage.yml +++ b/.github/workflows/pr-triage.yml @@ -3,7 +3,7 @@ name: Triage PR on: pull_request: types: [opened, edited, synchronize, ready_for_review] - branches: [main] + branches: [master, main] permissions: contents: read # the config file diff --git a/.nvmrc b/.nvmrc index 593cb75bc..119f15a0a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20.16.0 \ No newline at end of file +20.15.1 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b2f7a05b1..f16acdf91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,7 @@ The release process is automated. Follow the steps below. * due date: date of release * close milestone 9. Create a [New Milestone][github-new-milestone] for upcoming release. -10. A new homebrew cask will be [automatically published][homebrew-cask-autobump-workflow] (workflow runs ~3 hours) +10. A new homebrew cask will be automatically published (workflow runs ~3 hours) ### Project Philosophy @@ -88,6 +88,5 @@ This project is a tool for monitoring new notifications from Github. It's not me [github-milestones]: https://github.com/gitify-app/gitify/milestones [github-new-milestone]: https://github.com/gitify-app/gitify/milestones/new [github-new-release]: https://github.com/gitify-app/gitify/releases/new -[homebrew-cask-autobump-workflow]: https://github.com/Homebrew/homebrew-cask/actions/workflows/autobump.yml [jest-website]: https://jestjs.io/ diff --git a/package.json b/package.json index a557c0e3a..e565aa9b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gitify", - "version": "5.11.0", + "version": "5.10.0", "description": "GitHub Notifications on your menu bar.", "main": "src/electron/main.js", "scripts": { @@ -106,34 +106,33 @@ "class-variance-authority": "0.7.0", "clsx": "2.1.1", "date-fns": "3.6.0", - "electron-log": "5.1.7", - "electron-updater": "6.3.1", + "electron-updater": "6.2.1", "final-form": "4.20.10", "menubar": "9.5.0", "nprogress": "0.2.0", "react": "18.3.1", "react-dom": "18.3.1", "react-final-form": "6.5.9", - "react-router-dom": "6.25.1", + "react-router-dom": "6.24.1", "tailwind-merge": "2.4.0", "ts-loader": "9.5.1", - "typescript": "5.5.4" + "typescript": "5.5.3" }, "devDependencies": { "@biomejs/biome": "1.8.3", "@electron/notarize": "2.3.2", "@testing-library/react": "16.0.0", "@types/jest": "29.5.12", - "@types/node": "20.14.12", + "@types/node": "20.14.10", "@types/nprogress": "0.2.3", "@types/react": "18.3.3", "@types/react-router-dom": "5.3.3", "autoprefixer": "10.4.19", "css-loader": "7.1.2", - "electron": "31.2.1", + "electron": "31.2.0", "electron-builder": "24.13.3", "graphql-tag": "2.12.6", - "husky": "9.1.1", + "husky": "9.0.11", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "nock": "13.5.4", @@ -142,14 +141,14 @@ "resize-observer-polyfill": "1.5.1", "rimraf": "6.0.1", "style-loader": "4.0.0", - "tailwindcss": "3.4.6", - "ts-jest": "29.2.3", + "tailwindcss": "3.4.4", + "ts-jest": "29.2.2", "ts-node": "10.9.2", "webpack": "5.93.0", "webpack-cli": "5.1.4", "webpack-merge": "6.0.1" }, - "packageManager": "pnpm@9.6.0", + "packageManager": "pnpm@9.5.0", "lint-staged": { "*": "biome check --fix --no-errors-on-unmatched", "*.{js,ts,tsx}": "pnpm test -- --findRelatedTests -u --passWithNoTests" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce634c322..4c4080212 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@electron/remote': specifier: 2.1.2 - version: 2.1.2(electron@31.2.1) + version: 2.1.2(electron@31.2.0) '@primer/octicons-react': specifier: 19.11.0 version: 19.11.0(react@18.3.1) @@ -26,18 +26,15 @@ importers: date-fns: specifier: 3.6.0 version: 3.6.0 - electron-log: - specifier: 5.1.7 - version: 5.1.7 electron-updater: - specifier: 6.3.1 - version: 6.3.1 + specifier: 6.2.1 + version: 6.2.1 final-form: specifier: 4.20.10 version: 4.20.10 menubar: specifier: 9.5.0 - version: 9.5.0(electron@31.2.1) + version: 9.5.0(electron@31.2.0) nprogress: specifier: 0.2.0 version: 0.2.0 @@ -51,17 +48,17 @@ importers: specifier: 6.5.9 version: 6.5.9(final-form@4.20.10)(react@18.3.1) react-router-dom: - specifier: 6.25.1 - version: 6.25.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 6.24.1 + version: 6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) tailwind-merge: specifier: 2.4.0 version: 2.4.0 ts-loader: specifier: 9.5.1 - version: 9.5.1(typescript@5.5.4)(webpack@5.93.0(webpack-cli@5.1.4)) + version: 9.5.1(typescript@5.5.3)(webpack@5.93.0(webpack-cli@5.1.4)) typescript: - specifier: 5.5.4 - version: 5.5.4 + specifier: 5.5.3 + version: 5.5.3 devDependencies: '@biomejs/biome': specifier: 1.8.3 @@ -76,8 +73,8 @@ importers: specifier: 29.5.12 version: 29.5.12 '@types/node': - specifier: 20.14.12 - version: 20.14.12 + specifier: 20.14.10 + version: 20.14.10 '@types/nprogress': specifier: 0.2.3 version: 0.2.3 @@ -94,8 +91,8 @@ importers: specifier: 7.1.2 version: 7.1.2(webpack@5.93.0(webpack-cli@5.1.4)) electron: - specifier: 31.2.1 - version: 31.2.1 + specifier: 31.2.0 + version: 31.2.0 electron-builder: specifier: 24.13.3 version: 24.13.3(electron-builder-squirrel-windows@24.13.3(dmg-builder@24.13.3)) @@ -103,11 +100,11 @@ importers: specifier: 2.12.6 version: 2.12.6(graphql@16.8.1) husky: - specifier: 9.1.1 - version: 9.1.1 + specifier: 9.0.11 + version: 9.0.11 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + version: 29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) jest-environment-jsdom: specifier: 29.7.0 version: 29.7.0 @@ -119,7 +116,7 @@ importers: version: 8.4.39 postcss-loader: specifier: 8.1.1 - version: 8.1.1(postcss@8.4.39)(typescript@5.5.4)(webpack@5.93.0(webpack-cli@5.1.4)) + version: 8.1.1(postcss@8.4.39)(typescript@5.5.3)(webpack@5.93.0(webpack-cli@5.1.4)) resize-observer-polyfill: specifier: 1.5.1 version: 1.5.1 @@ -130,14 +127,14 @@ importers: specifier: 4.0.0 version: 4.0.0(webpack@5.93.0(webpack-cli@5.1.4)) tailwindcss: - specifier: 3.4.6 - version: 3.4.6(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + specifier: 3.4.4 + version: 3.4.4(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) ts-jest: - specifier: 29.2.3 - version: 29.2.3(@babel/core@7.24.3)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.3))(jest@29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)))(typescript@5.5.4) + specifier: 29.2.2 + version: 29.2.2(@babel/core@7.24.3)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.3))(jest@29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(typescript@5.5.3) ts-node: specifier: 10.9.2 - version: 10.9.2(@types/node@20.14.12)(typescript@5.5.4) + version: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) webpack: specifier: 5.93.0 version: 5.93.0(webpack-cli@5.1.4) @@ -560,8 +557,8 @@ packages: peerDependencies: react: '>=16.3' - '@remix-run/router@1.18.0': - resolution: {integrity: sha512-L3jkqmqoSVBVKHfpGZmLrex0lxR5SucGA0sUfFzGctehw+S/ggL9L/0NnC5mw6P8HUWpFZ3nQw3cRApjjWx9Sw==} + '@remix-run/router@1.17.1': + resolution: {integrity: sha512-mCOMec4BKd6BRGBZeSnGiIgwsbLGp3yhVqAD8H+PxiRNEHgDpZb8J1TnrSDlg97t0ySKMQJTHCWBCmBpSmkF6Q==} engines: {node: '>=14.0.0'} '@sinclair/typebox@0.27.8': @@ -682,8 +679,8 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/node@20.14.12': - resolution: {integrity: sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==} + '@types/node@20.14.10': + resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==} '@types/nprogress@0.2.3': resolution: {integrity: sha512-k7kRA033QNtC+gLc4VPlfnue58CM1iQLgn1IMAU8VPHGOj7oIHPp9UlhedEnD/Gl8evoCjwkZjlBORtZ3JByUA==} @@ -1030,10 +1027,6 @@ packages: resolution: {integrity: sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==} engines: {node: '>=12.0.0'} - builder-util-runtime@9.2.5: - resolution: {integrity: sha512-HjIDfhvqx/8B3TDN4GbABQcgpewTU4LMRTQPkVpKYV3lsuxEJoIfvg09GyWTNmfVNSUAYf+fbTN//JX4TH20pg==} - engines: {node: '>=12.0.0'} - builder-util@24.13.1: resolution: {integrity: sha512-NhbCSIntruNDTOVI9fdXz0dihaqX2YuE1D6zZMrwiErzH4ELZHE6mdiB40wEgZNprDia+FghRFgKoAqMZRRjSA==} @@ -1358,11 +1351,6 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - ejs@3.1.10: - resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} - engines: {node: '>=0.10.0'} - hasBin: true - ejs@3.1.9: resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==} engines: {node: '>=0.10.0'} @@ -1376,10 +1364,6 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - electron-log@5.1.7: - resolution: {integrity: sha512-/PjrS9zGkrZCDTHt6IgNE3FeciBbi4wd7U76NG9jAoNXF99E9IJdvBkqvaUJ1NjLojYDKs0kTvn9YhKy1/Zi+Q==} - engines: {node: '>= 14'} - electron-positioner@4.1.0: resolution: {integrity: sha512-726DfbI9ZNoCg+Fcu6XLuTKTnzf+6nFqv7h+K/V6Ug7IbaPMI7s9S8URnGtWFCy5N5PL4HSzRFF2mXuinftDdg==} @@ -1389,11 +1373,11 @@ packages: electron-to-chromium@1.4.719: resolution: {integrity: sha512-FbWy2Q2YgdFzkFUW/W5jBjE9dj+804+98E4Pup78JBPnbdb3pv6IneY2JCPKdeKLh3AOKHQeYf+KwLr7mxGh6Q==} - electron-updater@6.3.1: - resolution: {integrity: sha512-Et9t9LcH42q/A73yu398YGHR7cbdTnHbIyFN/p0FNZIJi10XxGshZBVVE6FsClMuoggw7FVhn1+kMUVMCqS7MA==} + electron-updater@6.2.1: + resolution: {integrity: sha512-83eKIPW14qwZqUUM6wdsIRwVKZyjmHxQ4/8G+1C6iS5PdDt7b1umYQyj1/qPpH510GmHEQe4q0kCPe3qmb3a0Q==} - electron@31.2.1: - resolution: {integrity: sha512-g3CLKjl4yuXt6VWm/KpgEjYYhFiCl19RgUn8lOC8zV/56ZXAS3+mqV4wWzicE/7vSYXs6GRO7vkYRwrwhX3Gaw==} + electron@31.2.0: + resolution: {integrity: sha512-5w+kjOsGiTXytPSErBPNp/3znnuEMKc42RD41MqRoQkiYaR8x/Le2+qWk1cL60UwE/67oeKnOHnnol8xEuldGg==} engines: {node: '>= 12.20.55'} hasBin: true @@ -1748,8 +1732,8 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - husky@9.1.1: - resolution: {integrity: sha512-fCqlqLXcBnXa/TJXmT93/A36tJsjdJkibQ1MuIiFyCCYUlpYpIaj2mv1w+3KR6Rzu1IC3slFTje5f6DUp2A2rg==} + husky@9.0.11: + resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} engines: {node: '>=18'} hasBin: true @@ -2586,15 +2570,15 @@ packages: react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - react-router-dom@6.25.1: - resolution: {integrity: sha512-0tUDpbFvk35iv+N89dWNrJp+afLgd+y4VtorJZuOCXK0kkCWjEvb3vTJM++SYvMEpbVwXKf3FjeVveVEb6JpDQ==} + react-router-dom@6.24.1: + resolution: {integrity: sha512-U19KtXqooqw967Vw0Qcn5cOvrX5Ejo9ORmOtJMzYWtCT4/WOfFLIZGGsVLxcd9UkBO0mSTZtXqhZBsWlHr7+Sg==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' - react-router@6.25.1: - resolution: {integrity: sha512-u8ELFr5Z6g02nUtpPAggP73Jigj1mRePSwhS/2nkTrlPU5yEkH1vYzWNyvSnSzeeE2DNqWdH+P8OhIh9wuXhTw==} + react-router@6.24.1: + resolution: {integrity: sha512-PTXFXGK2pyXpHzVo3rR9H7ip4lSPZZc0bHG5CARmj65fTT6qG7sTngmb6lcYu1gf3y/8KxORoy9yn59pGpCnpg==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' @@ -2877,8 +2861,8 @@ packages: tailwind-merge@2.4.0: resolution: {integrity: sha512-49AwoOQNKdqKPd9CViyH5wJoSKsCDjUlzL8DxuGp3P1FsGY36NJDAa18jLZcaHAUUuTj+JB8IAo8zWgBNvBF7A==} - tailwindcss@3.4.6: - resolution: {integrity: sha512-1uRHzPB+Vzu57ocybfZ4jh5Q3SdlH7XW23J5sQoM9LhE9eIOlzxer/3XPSsycvih3rboRsvt0QCmzSrqyOYUIA==} + tailwindcss@3.4.4: + resolution: {integrity: sha512-ZoyXOdJjISB7/BcLTR6SEsLgKtDStYyYZVLsUtWChO4Ps20CBad7lfJKVDiejocV4ME1hLmyY0WJE3hSDcmQ2A==} engines: {node: '>=14.0.0'} hasBin: true @@ -2964,8 +2948,8 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - ts-jest@29.2.3: - resolution: {integrity: sha512-yCcfVdiBFngVz9/keHin9EnsrQtQtEu3nRykNy9RVp+FiPFFbPJ3Sg6Qg4+TkmH0vMP5qsTKgXSsk80HRwvdgQ==} + ts-jest@29.2.2: + resolution: {integrity: sha512-sSW7OooaKT34AAngP6k1VS669a0HdLxkQZnlC7T76sckGCokXFnvJ3yRlQZGRTAoV5K19HfSgCiSwWOSIfcYlg==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -3024,8 +3008,8 @@ packages: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} - typescript@5.5.4: - resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + typescript@5.5.3: + resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} engines: {node: '>=14.17'} hasBin: true @@ -3237,7 +3221,7 @@ snapshots: '@babel/code-frame@7.24.2': dependencies: '@babel/highlight': 7.24.2 - picocolors: 1.0.1 + picocolors: 1.0.0 '@babel/compat-data@7.24.1': {} @@ -3329,7 +3313,7 @@ snapshots: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.1 + picocolors: 1.0.0 '@babel/parser@7.24.1': dependencies: @@ -3531,9 +3515,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@electron/remote@2.1.2(electron@31.2.1)': + '@electron/remote@2.1.2(electron@31.2.0)': dependencies: - electron: 31.2.1 + electron: 31.2.0 '@electron/universal@1.5.1': dependencies: @@ -3569,27 +3553,27 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4))': + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + jest-config: 29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -3614,7 +3598,7 @@ snapshots: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -3632,7 +3616,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.14.12 + '@types/node': 20.14.10 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -3654,7 +3638,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.14.12 + '@types/node': 20.14.10 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -3724,7 +3708,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.14.12 + '@types/node': 20.14.10 '@types/yargs': 17.0.32 chalk: 4.1.2 @@ -3787,7 +3771,7 @@ snapshots: dependencies: react: 18.3.1 - '@remix-run/router@1.18.0': {} + '@remix-run/router@1.17.1': {} '@sinclair/typebox@0.27.8': {} @@ -3863,7 +3847,7 @@ snapshots: dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 20.14.12 + '@types/node': 20.14.10 '@types/responselike': 1.0.3 '@types/debug@4.1.12': @@ -3884,11 +3868,11 @@ snapshots: '@types/fs-extra@9.0.13': dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 '@types/history@4.7.11': {} @@ -3911,7 +3895,7 @@ snapshots: '@types/jsdom@20.0.1': dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 '@types/tough-cookie': 4.0.5 parse5: 7.1.2 @@ -3919,11 +3903,11 @@ snapshots: '@types/keyv@3.1.4': dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 '@types/ms@0.7.34': {} - '@types/node@20.14.12': + '@types/node@20.14.10': dependencies: undici-types: 5.26.5 @@ -3931,7 +3915,7 @@ snapshots: '@types/plist@3.0.5': dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 xmlbuilder: 15.1.1 optional: true @@ -3960,7 +3944,7 @@ snapshots: '@types/responselike@1.0.3': dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 '@types/stack-utils@2.0.3': {} @@ -3977,7 +3961,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 optional: true '@webassemblyjs/ast@1.12.1': @@ -4373,13 +4357,6 @@ snapshots: transitivePeerDependencies: - supports-color - builder-util-runtime@9.2.5: - dependencies: - debug: 4.3.4 - sax: 1.3.0 - transitivePeerDependencies: - - supports-color - builder-util@24.13.1: dependencies: 7zip-bin: 5.2.0 @@ -4532,7 +4509,7 @@ snapshots: config-file-ts@0.2.6: dependencies: glob: 10.3.10 - typescript: 5.5.4 + typescript: 5.5.3 convert-source-map@2.0.0: {} @@ -4541,14 +4518,14 @@ snapshots: core-util-is@1.0.3: {} - cosmiconfig@9.0.0(typescript@5.5.4): + cosmiconfig@9.0.0(typescript@5.5.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.5.4 + typescript: 5.5.3 crc-32@1.2.2: {} @@ -4562,13 +4539,13 @@ snapshots: buffer: 5.7.1 optional: true - create-jest@29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)): + create-jest@29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + jest-config: 29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -4708,10 +4685,6 @@ snapshots: eastasianwidth@0.2.0: {} - ejs@3.1.10: - dependencies: - jake: 10.8.7 - ejs@3.1.9: dependencies: jake: 10.8.7 @@ -4743,8 +4716,6 @@ snapshots: - electron-builder-squirrel-windows - supports-color - electron-log@5.1.7: {} - electron-positioner@4.1.0: {} electron-publish@24.13.1: @@ -4761,9 +4732,9 @@ snapshots: electron-to-chromium@1.4.719: {} - electron-updater@6.3.1: + electron-updater@6.2.1: dependencies: - builder-util-runtime: 9.2.5 + builder-util-runtime: 9.2.4 fs-extra: 10.1.0 js-yaml: 4.1.0 lazy-val: 1.0.5 @@ -4774,10 +4745,10 @@ snapshots: transitivePeerDependencies: - supports-color - electron@31.2.1: + electron@31.2.0: dependencies: '@electron/get': 2.0.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 extract-zip: 2.0.1 transitivePeerDependencies: - supports-color @@ -5145,7 +5116,7 @@ snapshots: human-signals@2.1.0: {} - husky@9.1.1: {} + husky@9.0.11: {} iconv-corefoundation@1.1.7: dependencies: @@ -5300,7 +5271,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 @@ -5320,16 +5291,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)): + jest-cli@29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + create-jest: 29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + jest-config: 29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -5339,7 +5310,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)): + jest-config@29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): dependencies: '@babel/core': 7.24.3 '@jest/test-sequencer': 29.7.0 @@ -5364,8 +5335,8 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - '@types/node': 20.14.12 - ts-node: 10.9.2(@types/node@20.14.12)(typescript@5.5.4) + '@types/node': 20.14.10 + ts-node: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -5395,7 +5366,7 @@ snapshots: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 - '@types/node': 20.14.12 + '@types/node': 20.14.10 jest-mock: 29.7.0 jest-util: 29.7.0 jsdom: 20.0.3 @@ -5409,7 +5380,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -5419,7 +5390,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 20.14.12 + '@types/node': 20.14.10 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -5458,7 +5429,7 @@ snapshots: jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -5493,7 +5464,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -5521,7 +5492,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 @@ -5567,7 +5538,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -5586,7 +5557,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.12 + '@types/node': 20.14.10 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -5595,23 +5566,23 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 merge-stream: 2.0.0 supports-color: 8.1.1 jest-worker@29.7.0: dependencies: - '@types/node': 20.14.12 + '@types/node': 20.14.10 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)): + jest@29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + jest-cli: 29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -5767,9 +5738,9 @@ snapshots: escape-string-regexp: 4.0.0 optional: true - menubar@9.5.0(electron@31.2.1): + menubar@9.5.0(electron@31.2.0): dependencies: - electron: 31.2.1 + electron: 31.2.0 electron-positioner: 4.1.0 merge-stream@2.0.0: {} @@ -5971,17 +5942,17 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.39 - postcss-load-config@4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)): + postcss-load-config@4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): dependencies: lilconfig: 3.1.1 yaml: 2.4.1 optionalDependencies: postcss: 8.4.39 - ts-node: 10.9.2(@types/node@20.14.12)(typescript@5.5.4) + ts-node: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) - postcss-loader@8.1.1(postcss@8.4.39)(typescript@5.5.4)(webpack@5.93.0(webpack-cli@5.1.4)): + postcss-loader@8.1.1(postcss@8.4.39)(typescript@5.5.3)(webpack@5.93.0(webpack-cli@5.1.4)): dependencies: - cosmiconfig: 9.0.0(typescript@5.5.4) + cosmiconfig: 9.0.0(typescript@5.5.3) jiti: 1.21.0 postcss: 8.4.39 semver: 7.6.0 @@ -6096,16 +6067,16 @@ snapshots: react-is@18.2.0: {} - react-router-dom@6.25.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + react-router-dom@6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@remix-run/router': 1.18.0 + '@remix-run/router': 1.17.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-router: 6.25.1(react@18.3.1) + react-router: 6.24.1(react@18.3.1) - react-router@6.25.1(react@18.3.1): + react-router@6.24.1(react@18.3.1): dependencies: - '@remix-run/router': 1.18.0 + '@remix-run/router': 1.17.1 react: 18.3.1 react@18.3.1: @@ -6386,7 +6357,7 @@ snapshots: tailwind-merge@2.4.0: {} - tailwindcss@3.4.6(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)): + tailwindcss@3.4.4(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -6401,11 +6372,11 @@ snapshots: micromatch: 4.0.5 normalize-path: 3.0.0 object-hash: 3.0.0 - picocolors: 1.0.1 + picocolors: 1.0.0 postcss: 8.4.39 postcss-import: 15.1.0(postcss@8.4.39) postcss-js: 4.0.1(postcss@8.4.39) - postcss-load-config: 4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + postcss-load-config: 4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) postcss-nested: 6.0.1(postcss@8.4.39) postcss-selector-parser: 6.0.16 resolve: 1.22.8 @@ -6500,18 +6471,18 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.3(@babel/core@7.24.3)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.3))(jest@29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)))(typescript@5.5.4): + ts-jest@29.2.2(@babel/core@7.24.3)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.3))(jest@29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)))(typescript@5.5.3): dependencies: bs-logger: 0.2.6 - ejs: 3.1.10 + ejs: 3.1.9 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.14.12)(ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4)) + jest: 29.7.0(@types/node@20.14.10)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.6.0 - typescript: 5.5.4 + typescript: 5.5.3 yargs-parser: 21.1.1 optionalDependencies: '@babel/core': 7.24.3 @@ -6519,31 +6490,31 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.24.3) - ts-loader@9.5.1(typescript@5.5.4)(webpack@5.93.0(webpack-cli@5.1.4)): + ts-loader@9.5.1(typescript@5.5.3)(webpack@5.93.0(webpack-cli@5.1.4)): dependencies: chalk: 4.1.2 enhanced-resolve: 5.16.0 micromatch: 4.0.5 semver: 7.6.0 source-map: 0.7.4 - typescript: 5.5.4 + typescript: 5.5.3 webpack: 5.93.0(webpack-cli@5.1.4) - ts-node@10.9.2(@types/node@20.14.12)(typescript@5.5.4): + ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.14.12 + '@types/node': 20.14.10 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.5.4 + typescript: 5.5.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -6556,7 +6527,7 @@ snapshots: type-fest@0.21.3: {} - typescript@5.5.4: {} + typescript@5.5.3: {} undici-types@5.26.5: {} diff --git a/src/components/AccountNotifications.test.tsx b/src/components/AccountNotifications.test.tsx index 3b970f4b0..4c37fcd70 100644 --- a/src/components/AccountNotifications.test.tsx +++ b/src/components/AccountNotifications.test.tsx @@ -61,8 +61,8 @@ describe('components/AccountNotifications.tsx', () => { }); it('should open profile when clicked', async () => { - const openAccountProfileMock = jest - .spyOn(links, 'openAccountProfile') + const mockAccountProfileURL = jest + .spyOn(links, 'accountProfileURL') .mockImplementation(); const props = { @@ -81,8 +81,8 @@ describe('components/AccountNotifications.tsx', () => { fireEvent.click(screen.getByTitle('Open Profile')); - expect(openAccountProfileMock).toHaveBeenCalledTimes(1); - expect(openAccountProfileMock).toHaveBeenCalledWith(mockGitHubCloudAccount); + expect(mockAccountProfileURL).toHaveBeenCalledTimes(1); + expect(mockAccountProfileURL).toHaveBeenCalledWith(mockGitHubCloudAccount); }); it('should toggle account notifications visibility', async () => { diff --git a/src/components/AccountNotifications.tsx b/src/components/AccountNotifications.tsx index 5d9f1552a..46f6d2b4d 100644 --- a/src/components/AccountNotifications.tsx +++ b/src/components/AccountNotifications.tsx @@ -3,12 +3,12 @@ import { ChevronLeftIcon, ChevronUpIcon, } from '@primer/octicons-react'; -import { type FC, type MouseEvent, useContext, useState } from 'react'; +import { type FC, useContext, useState } from 'react'; import { AppContext } from '../context/App'; import { type Account, Opacity, Size } from '../types'; import type { Notification } from '../typesGitHub'; import { cn } from '../utils/cn'; -import { openAccountProfile } from '../utils/links'; +import { accountProfileURL } from '../utils/links'; import { HoverGroup } from './HoverGroup'; import { NotificationRow } from './NotificationRow'; import { RepositoryNotifications } from './RepositoryNotifications'; @@ -78,17 +78,11 @@ export const AccountNotifications: FC = (
- + + + { describe('notification interactions', () => { it('should open a notification in the browser - click', () => { - const markNotificationRead = jest.fn(); + const removeNotificationFromState = jest.fn(); const props = { notification: mockSingleNotification, @@ -93,7 +93,7 @@ describe('components/NotificationRow.tsx', () => { @@ -103,11 +103,11 @@ describe('components/NotificationRow.tsx', () => { fireEvent.click(screen.getByRole('main')); expect(links.openNotification).toHaveBeenCalledTimes(1); - expect(markNotificationRead).toHaveBeenCalledTimes(1); + expect(removeNotificationFromState).toHaveBeenCalledTimes(1); }); it('should open a notification in the browser - delay notification setting enabled', () => { - const markNotificationRead = jest.fn(); + const removeNotificationFromState = jest.fn(); const props = { notification: mockSingleNotification, @@ -122,7 +122,7 @@ describe('components/NotificationRow.tsx', () => { markAsDoneOnOpen: false, delayNotificationState: true, }, - markNotificationRead, + removeNotificationFromState, auth: mockAuth, }} > @@ -132,11 +132,11 @@ describe('components/NotificationRow.tsx', () => { fireEvent.click(screen.getByRole('main')); expect(links.openNotification).toHaveBeenCalledTimes(1); - expect(markNotificationRead).toHaveBeenCalledTimes(1); + expect(removeNotificationFromState).toHaveBeenCalledTimes(1); }); it('should open a notification in the browser - key down', () => { - const markNotificationRead = jest.fn(); + const removeNotificationFromState = jest.fn(); const props = { notification: mockSingleNotification, @@ -147,7 +147,7 @@ describe('components/NotificationRow.tsx', () => { @@ -157,7 +157,7 @@ describe('components/NotificationRow.tsx', () => { fireEvent.click(screen.getByRole('main')); expect(links.openNotification).toHaveBeenCalledTimes(1); - expect(markNotificationRead).toHaveBeenCalledTimes(1); + expect(removeNotificationFromState).toHaveBeenCalledTimes(1); }); it('should open a notification in browser & mark it as done', () => { diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index 54bac2ab7..31c0e8e3c 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -7,7 +7,7 @@ import { useState, } from 'react'; import { AppContext } from '../context/App'; -import { Opacity, Size } from '../types'; +import { Opacity, OpenPreference, Size } from '../types'; import type { Notification } from '../typesGitHub'; import { cn } from '../utils/cn'; import { formatForDisplay } from '../utils/helpers'; @@ -15,7 +15,7 @@ import { getNotificationTypeIcon, getNotificationTypeIconColor, } from '../utils/icons'; -import { openNotification } from '../utils/links'; +import { isCtrlOrMetaKey, openNotification } from '../utils/links'; import { HoverGroup } from './HoverGroup'; import { InteractionButton } from './buttons/InteractionButton'; import { NotificationFooter } from './notification/NotificationFooter'; @@ -23,17 +23,16 @@ import { NotificationHeader } from './notification/NotificationHeader'; interface INotificationRow { notification: Notification; - isAnimated?: boolean; isRead?: boolean; } export const NotificationRow: FC = ({ notification, - isAnimated = false, isRead = false, }: INotificationRow) => { const { settings, + removeNotificationFromState, markNotificationRead, markNotificationDone, unsubscribeNotification, @@ -41,18 +40,29 @@ export const NotificationRow: FC = ({ const [animateExit, setAnimateExit] = useState(false); const [showAsRead, setShowAsRead] = useState(false); - const handleNotification = useCallback(() => { - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - - openNotification(notification); - - if (settings.markAsDoneOnOpen) { - markNotificationDone(notification); - } else { - markNotificationRead(notification); - } - }, [notification, markNotificationDone, markNotificationRead, settings]); + const handleNotification = useCallback( + (event) => { + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + + const openLinkUserForeground = !isCtrlOrMetaKey(event); + const openLinkPreferenceForeground = + settings.openLinks === OpenPreference.FOREGROUND; + + openNotification( + notification, + openLinkUserForeground && openLinkPreferenceForeground, + ); + + if (settings.markAsDoneOnOpen) { + markNotificationDone(notification); + } else { + // no need to mark as read, github does it by default when opening it + removeNotificationFromState(settings, notification); + } + }, + [notification, markNotificationDone, removeNotificationFromState, settings], + ); const unsubscribeFromThread = (event: MouseEvent) => { // Don't trigger onClick of parent element. @@ -83,9 +93,10 @@ export const NotificationRow: FC = ({ id={notification.id} className={cn( 'group flex border-b border-gray-100 bg-white px-3 py-2 hover:bg-gray-100 dark:border-gray-darker dark:bg-gray-dark dark:text-white dark:hover:bg-gray-darker', - (isAnimated || animateExit) && + animateExit && 'translate-x-full opacity-0 transition duration-[350ms] ease-in-out', - (isRead || showAsRead) && Opacity.READ, + showAsRead && Opacity.READ, + isRead && Opacity.READ, )} >
= ({
handleNotification()} + onClick={(event) => handleNotification(event)} > diff --git a/src/components/RepositoryNotifications.tsx b/src/components/RepositoryNotifications.tsx index 65a229397..4c78d1844 100644 --- a/src/components/RepositoryNotifications.tsx +++ b/src/components/RepositoryNotifications.tsx @@ -10,7 +10,7 @@ import { AppContext } from '../context/App'; import { Opacity, Size } from '../types'; import type { Notification } from '../typesGitHub'; import { cn } from '../utils/cn'; -import { openRepository } from '../utils/links'; +import { repositoryURL } from '../utils/links'; import { HoverGroup } from './HoverGroup'; import { NotificationRow } from './NotificationRow'; import { InteractionButton } from './buttons/InteractionButton'; @@ -66,16 +66,9 @@ export const RepositoryNotifications: FC = ({ size={Size.XSMALL} defaultIcon={MarkGithubIcon} /> - ) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - openRepository(repoNotifications[0].repository); - }} - > - {repoName} - + + {repoName} +
@@ -117,7 +110,6 @@ export const RepositoryNotifications: FC = ({ ))} diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index e5c007f45..68e624d8a 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -14,10 +14,10 @@ import { Size } from '../types'; import { quitApp } from '../utils/comms'; import { getFilterCount } from '../utils/helpers'; import { - openGitHubIssues, - openGitHubNotifications, - openGitHubPulls, - openGitifyRepository, + gitHubIssuesURL, + gitHubNotificationsURL, + gitHubPullsURL, + gitifyRepositoryURL, } from '../utils/links'; import { getNotificationCount } from '../utils/notifications'; import { SidebarButton } from './buttons/SidebarButton'; @@ -63,33 +63,34 @@ export const Sidebar: FC = () => { return (
- + + + openGitHubNotifications()} + href={gitHubNotificationsURL()} /> openGitHubIssues()} + href={gitHubIssuesURL()} /> openGitHubPulls()} + href={gitHubPullsURL()} />
diff --git a/src/components/__snapshots__/AccountNotifications.test.tsx.snap b/src/components/__snapshots__/AccountNotifications.test.tsx.snap index a466615a7..6a7c011a9 100644 --- a/src/components/__snapshots__/AccountNotifications.test.tsx.snap +++ b/src/components/__snapshots__/AccountNotifications.test.tsx.snap @@ -34,13 +34,17 @@ exports[`components/AccountNotifications.tsx should render itself (github.com wi
- + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- + +
@@ -311,12 +323,16 @@ exports[`components/AccountNotifications.tsx should render itself (github.com wi src="https://avatars.githubusercontent.com/u/133795385?s=200&v=4" /> - - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- + +
@@ -743,12 +771,16 @@ exports[`components/AccountNotifications.tsx should render itself (github.com wi src="https://avatars.githubusercontent.com/u/133795385?s=200&v=4" /> - - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- + +
- + +
- + +
- + +
- + + +
- + + +
- + + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- + +
@@ -251,12 +259,16 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr src="https://avatars.githubusercontent.com/u/133795385?s=200&v=4" /> - - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- + +
@@ -521,17 +537,21 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr
- + +
@@ -710,17 +730,21 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr
- + +
@@ -956,17 +980,21 @@ exports[`components/NotificationRow.tsx should render itself & its children - hi
- + +
@@ -1145,17 +1173,21 @@ exports[`components/NotificationRow.tsx should render itself & its children - hi
- + +
diff --git a/src/components/__snapshots__/RepositoryNotifications.test.tsx.snap b/src/components/__snapshots__/RepositoryNotifications.test.tsx.snap index 34fac98d9..6bec9feef 100644 --- a/src/components/__snapshots__/RepositoryNotifications.test.tsx.snap +++ b/src/components/__snapshots__/RepositoryNotifications.test.tsx.snap @@ -16,11 +16,15 @@ exports[`components/Repository.tsx should render itself & its children 1`] = ` class="rounded-full object-cover size-4" src="https://avatars.githubusercontent.com/u/133795385?s=200&v=4" /> - - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
- - gitify-app/notifications-test - + + gitify-app/notifications-test + +
+
+ , + "container": - , - "container":
- @@ -375,6 +411,181 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out) > +
+ +
+
+
+ , + "container": - , - "container":
- diff --git a/src/components/buttons/Button.tsx b/src/components/buttons/Button.tsx index 0b7e0054a..f2de00873 100644 --- a/src/components/buttons/Button.tsx +++ b/src/components/buttons/Button.tsx @@ -1,9 +1,8 @@ import type { Icon } from '@primer/octicons-react'; import { type VariantProps, cva } from 'class-variance-authority'; import { type ButtonHTMLAttributes, forwardRef } from 'react'; -import { type Link, Size } from '../../types'; +import { Size } from '../../types'; import { cn } from '../../utils/cn'; -import { openExternalLink } from '../../utils/comms'; const buttonVariants = cva( 'ring-offset-background focus-visible:ring-ring inline-flex w-fit items-center justify-center whitespace-nowrap rounded text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', @@ -37,7 +36,7 @@ export interface IButton extends ButtonHTMLAttributes, VariantProps { icon?: { icon: Icon; size?: Size }; - url?: Link; + url?: string; onClick?: () => void; label: string; } @@ -45,29 +44,27 @@ export interface IButton const Button = forwardRef( ({ className, variant, size, label, url, onClick, ...props }, ref) => { return ( - + + + ); }, ); diff --git a/src/components/buttons/SidebarButton.tsx b/src/components/buttons/SidebarButton.tsx index ea9c11398..1dada8f20 100644 --- a/src/components/buttons/SidebarButton.tsx +++ b/src/components/buttons/SidebarButton.tsx @@ -8,6 +8,7 @@ export interface ISidebarButton { metric?: number; icon: Icon; onClick?: () => void; + href?: string; size?: Size; loading?: boolean; disabled?: boolean; @@ -27,11 +28,13 @@ export const SidebarButton: FC = (props: ISidebarButton) => { props.loading ? 'animate-spin' : undefined, props.size ? 'py-2' : 'py-1', )} - onClick={() => props.onClick()} + onClick={() => props.onClick?.()} title={props.title} disabled={props.disabled} > - + + + {hasMetric && props.metric} ); diff --git a/src/components/buttons/__snapshots__/Button.test.tsx.snap b/src/components/buttons/__snapshots__/Button.test.tsx.snap index e1fb0dfd3..49687cec4 100644 --- a/src/components/buttons/__snapshots__/Button.test.tsx.snap +++ b/src/components/buttons/__snapshots__/Button.test.tsx.snap @@ -5,6 +5,33 @@ exports[`components/buttons/Button.tsx should render with icon 1`] = ` "asFragment": [Function], "baseElement": + , + "container": - , - "container": , "debug": [Function], "findAllByAltText": [Function], @@ -110,21 +114,25 @@ exports[`components/buttons/Button.tsx should render without icon 1`] = ` "asFragment": [Function], "baseElement": + , + "container": - , - "container": , "debug": [Function], "findAllByAltText": [Function], diff --git a/src/components/buttons/__snapshots__/SidebarButton.test.tsx.snap b/src/components/buttons/__snapshots__/SidebarButton.test.tsx.snap index c4c6cf409..3095b7863 100644 --- a/src/components/buttons/__snapshots__/SidebarButton.test.tsx.snap +++ b/src/components/buttons/__snapshots__/SidebarButton.test.tsx.snap @@ -10,6 +10,33 @@ exports[`components/buttons/SidebarButton.tsx should render - with specific size title="Mock Sidebar Button" type="button" > + + + + + + +
+ , + "container": - , - "container": , "debug": [Function], @@ -115,6 +119,34 @@ exports[`components/buttons/SidebarButton.tsx should render with metric 1`] = ` title="Mock Sidebar Button" type="button" > + + + + + + 1 + +
+ , + "container": - , - "container": , @@ -222,6 +230,33 @@ exports[`components/buttons/SidebarButton.tsx should render without metric 1`] = title="Mock Sidebar Button" type="button" > + + + + + + +
+ , + "container": - , - "container": , "debug": [Function], diff --git a/src/components/notification/NotificationFooter.tsx b/src/components/notification/NotificationFooter.tsx index ae075d473..25b21db9f 100644 --- a/src/components/notification/NotificationFooter.tsx +++ b/src/components/notification/NotificationFooter.tsx @@ -1,10 +1,10 @@ import { FeedPersonIcon, MarkGithubIcon } from '@primer/octicons-react'; -import type { FC, MouseEvent } from 'react'; +import type { FC } from 'react'; import { IconColor, Opacity, Size } from '../../types'; import type { Notification } from '../../typesGitHub'; import { cn } from '../../utils/cn'; import { formatNotificationUpdatedAt } from '../../utils/helpers'; -import { openUserProfile } from '../../utils/links'; +import { userProfileURL } from '../../utils/links'; import { formatReason } from '../../utils/reason'; import { AvatarIcon } from '../icons/AvatarIcon'; import { Pills } from './Pills'; @@ -31,23 +31,20 @@ export const NotificationFooter: FC = ({ )} > {notification.subject.user ? ( - + + + ) : (
{notification.subject.type === 'RepositoryDependabotAlertsThread' || diff --git a/src/components/notification/NotificationHeader.tsx b/src/components/notification/NotificationHeader.tsx index a4c9dd1ff..f37d5809b 100644 --- a/src/components/notification/NotificationHeader.tsx +++ b/src/components/notification/NotificationHeader.tsx @@ -1,10 +1,10 @@ import { MarkGithubIcon } from '@primer/octicons-react'; -import { type FC, type MouseEvent, useContext } from 'react'; +import { type FC, useContext } from 'react'; import { AppContext } from '../../context/App'; import { Opacity, Size } from '../../types'; import type { Notification } from '../../typesGitHub'; import { cn } from '../../utils/cn'; -import { openRepository } from '../../utils/links'; +import { repositoryURL } from '../../utils/links'; import { AvatarIcon } from '../icons/AvatarIcon'; interface INotificationHeader { @@ -37,17 +37,11 @@ export const NotificationHeader: FC = ({ defaultIcon={MarkGithubIcon} /> - ) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - openRepository(notification.repository); - }} - > - {repoSlug} - + + + {repoSlug} + +
) ); diff --git a/src/components/notification/__snapshots__/NotificationFooter.test.tsx.snap b/src/components/notification/__snapshots__/NotificationFooter.test.tsx.snap index 7d462c36c..776089bc7 100644 --- a/src/components/notification/__snapshots__/NotificationFooter.test.tsx.snap +++ b/src/components/notification/__snapshots__/NotificationFooter.test.tsx.snap @@ -8,17 +8,21 @@ exports[`components/notification/NotificationFooter.tsx security alerts should u
- + +
@@ -84,17 +88,21 @@ exports[`components/notification/NotificationFooter.tsx security alerts should u
- + +
@@ -217,17 +225,21 @@ exports[`components/notification/NotificationFooter.tsx security alerts should u
- + +
@@ -293,17 +305,21 @@ exports[`components/notification/NotificationFooter.tsx security alerts should u
- + +
@@ -645,17 +661,21 @@ exports[`components/notification/NotificationFooter.tsx should render itself & i
- + +
@@ -721,17 +741,21 @@ exports[`components/notification/NotificationFooter.tsx should render itself & i
- + +
@@ -854,17 +878,21 @@ exports[`components/notification/NotificationFooter.tsx should render itself & i
- + +
@@ -930,17 +958,21 @@ exports[`components/notification/NotificationFooter.tsx should render itself & i
- + +
diff --git a/src/components/notification/__snapshots__/NotificationHeader.test.tsx.snap b/src/components/notification/__snapshots__/NotificationHeader.test.tsx.snap index be3a6711b..a0acdedd5 100644 --- a/src/components/notification/__snapshots__/NotificationHeader.test.tsx.snap +++ b/src/components/notification/__snapshots__/NotificationHeader.test.tsx.snap @@ -15,12 +15,16 @@ exports[`components/notification/NotificationHeader.tsx should render itself & i src="https://avatars.githubusercontent.com/u/133795385?s=200&v=4" /> - - gitify-app/notifications-test - + + gitify-app/notifications-test + +
, @@ -35,12 +39,16 @@ exports[`components/notification/NotificationHeader.tsx should render itself & i src="https://avatars.githubusercontent.com/u/133795385?s=200&v=4" /> - - gitify-app/notifications-test - + + gitify-app/notifications-test + +
, "debug": [Function], diff --git a/src/components/settings/NotificationSettings.tsx b/src/components/settings/NotificationSettings.tsx index f9fac93e5..73121a827 100644 --- a/src/components/settings/NotificationSettings.tsx +++ b/src/components/settings/NotificationSettings.tsx @@ -1,8 +1,8 @@ import { BellIcon } from '@primer/octicons-react'; -import { type FC, type MouseEvent, useContext } from 'react'; +import { type FC, useContext } from 'react'; import { AppContext } from '../../context/App'; import { GroupBy } from '../../types'; -import { openGitHubParticipatingDocs } from '../../utils/links'; +import { gitHubParticipatingDocsURL } from '../../utils/links'; import { Checkbox } from '../fields/Checkbox'; import { RadioGroup } from '../fields/RadioGroup'; import { Legend } from './Legend'; @@ -33,18 +33,15 @@ export const NotificationSettings: FC = () => { tooltip={
See - + + + for more details.
} diff --git a/src/components/settings/SettingsFooter.tsx b/src/components/settings/SettingsFooter.tsx index 54d4c4708..7a263cfff 100644 --- a/src/components/settings/SettingsFooter.tsx +++ b/src/components/settings/SettingsFooter.tsx @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'; import { BUTTON_CLASS_NAME } from '../../styles/gitify'; import { Size } from '../../types'; import { getAppVersion, quitApp } from '../../utils/comms'; -import { openGitifyReleaseNotes } from '../../utils/links'; +import { gitifyReleaseNotesURL } from '../../utils/links'; export const SettingsFooter: FC = () => { const [appVersion, setAppVersion] = useState(null); @@ -23,14 +23,15 @@ export const SettingsFooter: FC = () => { return (
- + + +
+ ); + }; + + const { getByText } = customRender(); + + act(() => { + fireEvent.click(getByText('Test Case')); + }); + + expect(clearStateMock).toHaveBeenCalledTimes(1); + }); + describe('settings methods', () => { const fetchNotificationsMock = jest.fn(); diff --git a/src/context/App.tsx b/src/context/App.tsx index 4b57a36ce..e20760b70 100644 --- a/src/context/App.tsx +++ b/src/context/App.tsx @@ -1,4 +1,4 @@ -import { ipcRenderer, webFrame } from 'electron'; +import { webFrame } from 'electron'; import { type ReactNode, createContext, @@ -41,6 +41,7 @@ import { updateTrayTitle, } from '../utils/comms'; import Constants from '../utils/constants'; +import { globalClickHandler } from '../utils/links'; import { getNotificationCount } from '../utils/notifications'; import { clearState, loadState, saveState } from '../utils/storage'; import { setTheme } from '../utils/theme'; @@ -97,10 +98,15 @@ interface AppContextState { loginWithOAuthApp: (data: LoginOAuthAppOptions) => void; loginWithPersonalAccessToken: (data: LoginPersonalAccessTokenOptions) => void; logoutFromAccount: (account: Account) => void; + logout: () => void; notifications: AccountNotifications[]; status: Status; errorDetails: GitifyError; + removeNotificationFromState: ( + settings: SettingsState, + notification: Notification, + ) => void; fetchNotifications: () => Promise; markNotificationRead: (notification: Notification) => Promise; markNotificationDone: (notification: Notification) => Promise; @@ -124,6 +130,7 @@ export const AppProvider = ({ children }: { children: ReactNode }) => { notifications, errorDetails, status, + removeNotificationFromState, markNotificationRead, markNotificationDone, unsubscribeNotification, @@ -163,10 +170,11 @@ export const AppProvider = ({ children }: { children: ReactNode }) => { }, [settings.keyboardShortcut]); useEffect(() => { - ipcRenderer.on('gitify:reset-app', () => { - setAuth(defaultAuth); - clearState(); - }); + document.addEventListener('click', globalClickHandler, true); + + return () => { + document.removeEventListener('click', globalClickHandler, true); + }; }, []); const clearFilters = useCallback(() => { @@ -245,6 +253,11 @@ export const AppProvider = ({ children }: { children: ReactNode }) => { [auth, settings], ); + const logout = useCallback(() => { + setAuth(defaultAuth); + clearState(); + }, []); + const restoreSettings = useCallback(async () => { await migrateAuthenticatedAccounts(); @@ -308,10 +321,12 @@ export const AppProvider = ({ children }: { children: ReactNode }) => { loginWithOAuthApp, loginWithPersonalAccessToken, logoutFromAccount, + logout, notifications, status, errorDetails, + removeNotificationFromState, fetchNotifications: fetchNotificationsWithAccounts, markNotificationRead: markNotificationReadWithAccounts, markNotificationDone: markNotificationDoneWithAccounts, diff --git a/src/electron/first-run.js b/src/electron/first-run.js index d5381d7d6..c81ff2b71 100644 --- a/src/electron/first-run.js +++ b/src/electron/first-run.js @@ -1,7 +1,7 @@ const { app, dialog } = require('electron'); + const fs = require('node:fs'); const path = require('node:path'); -const log = require('electron-log'); async function onFirstRunMaybe() { if (isFirstRun()) { @@ -49,7 +49,7 @@ function isFirstRun() { fs.writeFileSync(configPath, ''); } catch (error) { - log.error('First run: Unable to write firstRun file', error); + console.warn('First run: Unable to write firstRun file', error); } return true; diff --git a/src/electron/main.js b/src/electron/main.js index 334112cdf..8a290881c 100644 --- a/src/electron/main.js +++ b/src/electron/main.js @@ -4,16 +4,11 @@ const { nativeTheme, globalShortcut, Menu, - dialog, } = require('electron/main'); const { menubar } = require('menubar'); const { autoUpdater } = require('electron-updater'); const { onFirstRunMaybe } = require('./first-run'); const path = require('node:path'); -const log = require('electron-log'); - -log.initialize(); -autoUpdater.logger = log; // TODO: Remove @electron/remote use - see #650 require('@electron/remote/main').initialize(); @@ -40,53 +35,37 @@ const browserWindowOpts = { const contextMenu = Menu.buildFromTemplate([ { - label: 'Developer', - submenu: [ - { - role: 'reload', - accelerator: 'CommandOrControl+R', - }, - { - role: 'toggleDevTools', - accelerator: - process.platform === 'darwin' ? 'Alt+Cmd+I' : 'Ctrl+Shift+I', - }, - { - label: 'Reset App', - click: () => { - resetApp(); - }, - }, - ], + role: 'reload', + }, + { + role: 'toggleDevTools', }, { type: 'separator' }, { - label: 'Quit Gitify', - accelerator: 'CommandOrControl+Q', + label: 'Quit', click: () => { app.quit(); }, }, ]); -const mb = menubar({ - icon: idleIcon, - index: `file://${__dirname}/index.html`, - browserWindow: browserWindowOpts, - preloadWindow: true, - showDockIcon: false, -}); - app.whenReady().then(async () => { await onFirstRunMaybe(); + const mb = menubar({ + icon: idleIcon, + index: `file://${__dirname}/index.html`, + browserWindow: browserWindowOpts, + preloadWindow: true, + showDockIcon: false, + }); + mb.on('ready', () => { autoUpdater.checkForUpdatesAndNotify(); mb.app.setAppUserModelId('com.electron.gitify'); // Tray configuration - mb.tray.setToolTip('Gitify'); mb.tray.setIgnoreDoubleClickEvents(true); mb.tray.on('right-click', (_event, bounds) => { mb.tray.popUpContextMenu(contextMenu, { x: bounds.x, y: bounds.y }); @@ -175,24 +154,3 @@ app.whenReady().then(async () => { app.setLoginItemSettings(settings); }); }); - -function resetApp() { - const cancelButtonId = 0; - - const response = dialog.showMessageBoxSync(mb.window, { - type: 'warning', - title: 'Reset Gitify', - message: - 'Are you sure you want to reset Gitify? You will be logged out of all accounts', - buttons: ['Cancel', 'Reset'], - defaultId: cancelButtonId, - cancelId: cancelButtonId, - }); - - if (response === cancelButtonId) { - return; - } - - mb.window.webContents.send('gitify:reset-app'); - mb.app.quit(); -} diff --git a/src/hooks/useNotifications.test.ts b/src/hooks/useNotifications.test.ts index e4b3af7cc..c76ab45da 100644 --- a/src/hooks/useNotifications.test.ts +++ b/src/hooks/useNotifications.test.ts @@ -297,6 +297,45 @@ describe('hooks/useNotifications.ts', () => { }); }); + describe('removeNotificationFromState', () => { + it('should remove a notification from state', async () => { + const notifications = [ + { id: 1, title: 'This is a notification.' }, + { id: 2, title: 'This is another one.' }, + ]; + + nock('https://api.github.com') + .get('/notifications?participating=false') + .reply(200, notifications); + + nock('https://github.gitify.io/api/v3') + .get('/notifications?participating=false') + .reply(200, notifications); + + const { result } = renderHook(() => useNotifications()); + + act(() => { + result.current.fetchNotifications({ + ...mockState, + settings: { ...mockSettings, detailedNotifications: false }, + }); + }); + + await waitFor(() => { + expect(result.current.status).toBe('success'); + }); + + act(() => { + result.current.removeNotificationFromState( + mockSettings, + result.current.notifications[0].notifications[0], + ); + }); + + expect(result.current.notifications[0].notifications.length).toBe(1); + }); + }); + describe('markNotificationRead', () => { it('should mark a notification as read with success', async () => { nock('https://api.github.com/') diff --git a/src/hooks/useNotifications.ts b/src/hooks/useNotifications.ts index b8fb28499..ece638730 100644 --- a/src/hooks/useNotifications.ts +++ b/src/hooks/useNotifications.ts @@ -3,6 +3,7 @@ import type { AccountNotifications, GitifyError, GitifyState, + SettingsState, Status, } from '../types'; import type { Notification } from '../typesGitHub'; @@ -24,6 +25,10 @@ import { removeNotifications } from '../utils/remove-notifications'; interface NotificationsState { notifications: AccountNotifications[]; + removeNotificationFromState: ( + settings: SettingsState, + notification: Notification, + ) => void; fetchNotifications: (state: GitifyState) => Promise; markNotificationRead: ( state: GitifyState, @@ -221,11 +226,26 @@ export const useNotifications = (): NotificationsState => { [notifications, markNotificationDone], ); + const removeNotificationFromState = useCallback( + (settings: SettingsState, notification: Notification) => { + const updatedNotifications = removeNotification( + settings, + notification, + notifications, + ); + + setNotifications(updatedNotifications); + setTrayIconColor(updatedNotifications); + }, + [notifications], + ); + return { status, errorDetails, notifications, + removeNotificationFromState, fetchNotifications, markNotificationRead, markNotificationDone, diff --git a/src/routes/Accounts.test.tsx b/src/routes/Accounts.test.tsx index 3b4e84624..0ef056ea7 100644 --- a/src/routes/Accounts.test.tsx +++ b/src/routes/Accounts.test.tsx @@ -73,8 +73,8 @@ describe('routes/Accounts.tsx', () => { describe('Account interactions', () => { it('open profile in external browser', async () => { - const openAccountProfileMock = jest - .spyOn(links, 'openAccountProfile') + const accountProfileURLMock = jest + .spyOn(links, 'accountProfileURL') .mockImplementation(); await act(async () => { @@ -96,8 +96,8 @@ describe('routes/Accounts.tsx', () => { fireEvent.click(screen.getByTitle('Open Profile')); - expect(openAccountProfileMock).toHaveBeenCalledTimes(1); - expect(openAccountProfileMock).toHaveBeenCalledWith( + expect(accountProfileURLMock).toHaveBeenCalledTimes(1); + expect(accountProfileURLMock).toHaveBeenCalledWith( mockPersonalAccessTokenAccount, ); }); diff --git a/src/routes/Accounts.tsx b/src/routes/Accounts.tsx index 60e77c572..08c8d1834 100644 --- a/src/routes/Accounts.tsx +++ b/src/routes/Accounts.tsx @@ -16,9 +16,9 @@ import { type Account, Size } from '../types'; import { getAccountUUID } from '../utils/auth/utils'; import { updateTrayIcon, updateTrayTitle } from '../utils/comms'; import { - openAccountProfile, - openDeveloperSettings, - openHost, + accountProfileURL, + developerSettingsURL, + hostURL, } from '../utils/links'; export const AccountsRoute: FC = () => { @@ -55,42 +55,51 @@ export const AccountsRoute: FC = () => { >
- + @{account.user.login} + + +
- + + +
- + + +
diff --git a/src/routes/__snapshots__/Accounts.test.tsx.snap b/src/routes/__snapshots__/Accounts.test.tsx.snap index da96fff28..dbbdaaec7 100644 --- a/src/routes/__snapshots__/Accounts.test.tsx.snap +++ b/src/routes/__snapshots__/Accounts.test.tsx.snap @@ -67,78 +67,90 @@ exports[`routes/Accounts.tsx General should render itself & its children 1`] = ` class="ml-2 text-xs" >
- + @ + octocat + + - + Mona Lisa Octocat + + +
- + + + GitHub Cloud + - + github.com + +
- + + + Personal Access Token + +
@@ -172,78 +184,90 @@ exports[`routes/Accounts.tsx General should render itself & its children 1`] = ` class="ml-2 text-xs" >
- + @ + octocat + + - + Mona Lisa Octocat + + +
- + + + GitHub Enterprise Server + - + github.gitify.io + +
- + + + OAuth App + +
@@ -277,78 +301,90 @@ exports[`routes/Accounts.tsx General should render itself & its children 1`] = ` class="ml-2 text-xs" >
- + @ + octocat + + - + Mona Lisa Octocat + + +
- + + + GitHub Cloud + - + github.com + +
- + + + GitHub App + +
diff --git a/src/routes/__snapshots__/Login.test.tsx.snap b/src/routes/__snapshots__/Login.test.tsx.snap index b50466a34..0288029f6 100644 --- a/src/routes/__snapshots__/Login.test.tsx.snap +++ b/src/routes/__snapshots__/Login.test.tsx.snap @@ -64,48 +64,52 @@ exports[`routes/Login.tsx should render itself & its children 1`] = ` > Login with
- - + + + + + OAuth App + +
, @@ -169,48 +173,52 @@ exports[`routes/Login.tsx should render itself & its children 1`] = ` > Login with
- - + + + + + OAuth App + +
, "debug": [Function], diff --git a/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap b/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap index 5d4c7ad11..019385d81 100644 --- a/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap +++ b/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap @@ -82,28 +82,32 @@ exports[`routes/LoginWithOAuthApp.tsx renders correctly 1`] = `
- + + Create new OAuth App + + @@ -157,50 +161,56 @@ exports[`routes/LoginWithOAuthApp.tsx renders correctly 1`] = `
- - + + + + + +
@@ -285,28 +295,32 @@ exports[`routes/LoginWithOAuthApp.tsx renders correctly 1`] = `
- + + Create new OAuth App + + @@ -360,50 +374,56 @@ exports[`routes/LoginWithOAuthApp.tsx renders correctly 1`] = `
- - + + + + + +
diff --git a/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap b/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap index dd3492692..0c805bf24 100644 --- a/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap +++ b/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap @@ -107,27 +107,31 @@ exports[`routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] = ` >
- + + Generate a PAT + + @@ -145,50 +149,56 @@ exports[`routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] = `
- - + + + + + Login + +
@@ -297,27 +307,31 @@ exports[`routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] = ` >
- + + Generate a PAT + + @@ -335,50 +349,56 @@ exports[`routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] = `
- - + + + + + Login + +
diff --git a/src/routes/__snapshots__/Settings.test.tsx.snap b/src/routes/__snapshots__/Settings.test.tsx.snap index 58ff65ece..cbf0c0dc6 100644 --- a/src/routes/__snapshots__/Settings.test.tsx.snap +++ b/src/routes/__snapshots__/Settings.test.tsx.snap @@ -163,30 +163,36 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = ` > Zoom: - + + + 100 % - - + + + + + +
Open Links: + + +
- + + Gitify + v0.0.1 + + +