From 33d83d5f65117adf776578b952e86a78e5b6508c Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Mon, 9 Nov 2026 15:53:00 -0500 Subject: [PATCH 01/13] depend on notify-rust directly --- package.json | 1 - pnpm-lock.yaml | 238 +++++++++++++--------------- src-tauri/Cargo.lock | 81 ++++------ src-tauri/Cargo.toml | 4 +- src-tauri/capabilities/default.json | 1 - src-tauri/src/lib.rs | 1 - 6 files changed, 147 insertions(+), 179 deletions(-) diff --git a/package.json b/package.json index fd43d817..cd1780dd 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@tauri-apps/api": "^2.12.4", "@tauri-apps/plugin-deep-link": "~2.6.3", "@tauri-apps/plugin-fs": "~2.7.1", - "@tauri-apps/plugin-notification": "~2.8.1", "@tauri-apps/plugin-opener": "^2.7.3", "@tauri-apps/plugin-os": "~2.4.0", "@tauri-apps/plugin-process": "~2.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93277581..e104007b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -195,7 +195,7 @@ importers: version: 0.4.2(svelte@5.59.2(@typescript-eslint/types@8.74.0)) '@tailwindcss/vite': specifier: ^4.3.5 - version: 4.3.5(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + version: 4.3.5(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) '@tanstack/svelte-hotkeys': specifier: ^0.24.0 version: 0.24.1(svelte@5.59.2(@typescript-eslint/types@8.74.0)) @@ -208,9 +208,6 @@ importers: '@tauri-apps/plugin-fs': specifier: ~2.7.1 version: 2.7.1 - '@tauri-apps/plugin-notification': - specifier: ~2.8.1 - version: 2.8.1 '@tauri-apps/plugin-opener': specifier: ^2.7.3 version: 2.7.3 @@ -237,7 +234,7 @@ importers: version: 0.1.0-beta.1(@ui-sdk/core@0.1.0-beta.1)(svelte@5.59.2(@typescript-eslint/types@8.74.0)) colord: specifier: ^2.14.0 - version: 2.14.0 + version: 2.14.1 dayjs: specifier: ^1.11.23 version: 1.11.23 @@ -264,7 +261,7 @@ importers: version: 4.3.5 tldts: specifier: ^7.5.2 - version: 7.5.5 + version: 7.6.2 valibot: specifier: ^1.5.0 version: 1.5.0(typescript@6.0.3) @@ -283,19 +280,19 @@ importers: version: 3.12.4 '@sveltejs/adapter-static': specifier: ^4.0.1 - version: 4.0.1(@sveltejs/kit@3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)) + version: 4.0.1(@sveltejs/kit@3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)) '@sveltejs/kit': specifier: ^3.2.0 - version: 3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) + version: 3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) '@tauri-apps/cli': specifier: ^2.12.4 version: 2.12.6 '@types/node': specifier: ^26.6.6 - version: 26.6.7 + version: 26.6.11 eslint-plugin-perfectionist: specifier: ^5.13.0 - version: 5.14.0(eslint@10.15.0(jiti@2.7.0))(typescript@6.0.3) + version: 5.14.0(eslint@10.16.0(jiti@2.7.0))(typescript@6.0.3) svelte: specifier: ^5.57.3 version: 5.59.2(@typescript-eslint/types@8.74.0) @@ -304,7 +301,7 @@ importers: version: 4.7.8(picomatch@4.0.7)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) tailwind-variants: specifier: ^4.0.2 - version: 4.0.2 + version: 4.1.0 tw-animate-css: specifier: ^1.4.0 version: 1.4.0 @@ -313,16 +310,16 @@ importers: version: 6.0.3 unplugin-icons: specifier: ^24.0.0 - version: 24.0.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)) + version: 24.0.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)) vite: specifier: 'catalog:' - version: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + version: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' vite-plugin-devtools-json: specifier: ^1.1.2 - version: 1.1.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + version: 1.1.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) vite-plus: specifier: 'catalog:' - version: 1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) + version: 1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) packages: @@ -354,8 +351,8 @@ packages: resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.29.15': - resolution: {integrity: sha512-304gsbbGVmQc+cNGHzwHBlqepYdWLKj3VXCQBGt/EGcV7PUPfKI7kAUNW1FZEOCwlQiLvQjg1JEaAlRQ616h+Q==} + '@babel/runtime@7.29.16': + resolution: {integrity: sha512-LKBjGopxrQE0aFucNL69OyyyF143MOWUULEOftU3oCgyD35Sy84UUpVnt/sNvTb7ZmCyALSt7om+fojlW35zYQ==} engines: {node: '>=6.9.0'} '@blazediff/core@1.10.0': @@ -396,12 +393,12 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.12.3': - resolution: {integrity: sha512-R76UKbvsqI68DJJVTVyqFKqU98CN4+B+acxNfEA2IFarSzP0SjtKf/3+fFiXzTyv5Fj3PxLkGHe2wnVWWMxobQ==} + '@eslint-community/regexpp@4.12.4': + resolution: {integrity: sha512-1qH3WeISXHFS8P3QI0lntHlMrlfTh1OarxlRbPNDEkSCqoyXC3apBE7MDyRKOL8HpuW48aQtff30wvEFww/4ww==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.23.6': - resolution: {integrity: sha512-WrTH7nioI9QPY4NZGnsywmecswJdgeq4BCM76qok9VgjTO29ZgUzUvcuJLVPYVQM4uDbaPBU0M33R9DIxI8X3w==} + '@eslint/config-array@0.23.7': + resolution: {integrity: sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/config-helpers@0.7.0': @@ -1005,9 +1002,6 @@ packages: '@tauri-apps/plugin-fs@2.7.1': resolution: {integrity: sha512-4TBVjpi/q8PuNzjpkAc2iBGXMTLjOrAyfTiiOL8ORaJCZJRG3tjzmQ4sqs2CMG75FvLyRkOkERfP7AyY4iBNwQ==} - '@tauri-apps/plugin-notification@2.8.1': - resolution: {integrity: sha512-B+OCJv17XCFQxAhe2+fn2bHqQ1fz/hGnYHeT++yv8+q0daOH5o1ghX7MmxWgoGFp7POaNn4UMONclHeZn65mJA==} - '@tauri-apps/plugin-opener@2.7.3': resolution: {integrity: sha512-Nm+v7vLBCDzYZxrmCJhpMgtPsPsKt5myMs7SMU/aBjPOmAFI1RrHfhMz7t5KlxjMOzRcelyNq1/j0pmC9SmBVA==} @@ -1103,14 +1097,14 @@ packages: '@types/esrecurse@4.3.1': resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} - '@types/estree@1.0.10': - resolution: {integrity: sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==} + '@types/estree@1.0.11': + resolution: {integrity: sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/node@26.6.7': - resolution: {integrity: sha512-tovuRfrUILu6v46bMG+BgXxMvsqPBx2WO2as8Rpln+JTff1dbexMtAM4KFTejmL0axsnSWViCW7MecUQpLuBRA==} + '@types/node@26.6.11': + resolution: {integrity: sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ==} '@typescript-eslint/project-service@8.74.0': resolution: {integrity: sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==} @@ -1449,8 +1443,8 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - colord@2.14.0: - resolution: {integrity: sha512-eSdMel9EBvdFxnchObp7gljRoqYQLr+zXhaxjkym7syVphw1FIhfQwgsA5Bv3jArflZPJEa1rmQtGpa7NRc7Rw==} + colord@2.14.1: + resolution: {integrity: sha512-oAnRdUZtIoONz9y5JZEM/Ogg4m/eYIvpCvzFZIFOPfraLqVYTmevf61yeIhcLq/9EXztGOwF4O36pCu143BqGw==} confbox@0.1.8: resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} @@ -1547,8 +1541,8 @@ packages: resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} - eslint@10.15.0: - resolution: {integrity: sha512-+5Wg4p+ze3sG1WErYgUO/3H1IQIfFBymVUA0Fo/XTeBOLS6UQIUekpSJ8sdRkn7O7wjh84b55w/roqavH2aScg==} + eslint@10.16.0: + resolution: {integrity: sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} hasBin: true peerDependencies: @@ -1943,8 +1937,8 @@ packages: resolution: {integrity: sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==} engines: {node: '>=14.19.0'} - postcss@8.5.33: - resolution: {integrity: sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==} + postcss@8.5.34: + resolution: {integrity: sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw==} engines: {node: ^10 || ^12 || >=14} prelude-ls@1.2.1: @@ -2055,8 +2049,8 @@ packages: resolution: {integrity: sha512-XsSgJYzoRJ1GfD5IOJorwRy77eIEv8I1p+3wDQGkDIEbVd8BFXCy4PTQ8diPtuazRRHq6IWidBg2m3rDrqNtcA==} engines: {node: '>=18'} - tailwind-variants@4.0.2: - resolution: {integrity: sha512-sZvOFkfe5LlYG/crRX5IvP3oUHmJPu+7WmrLQFvF0kCRq51C+lurlzFMm/jURG/5keT7VOJ/it0N3jkzYux85w==} + tailwind-variants@4.1.0: + resolution: {integrity: sha512-oAYpaB3eFFpitkhcaVD+q9Q+evW2L2AHC6uNuIMHqa8WZGVi17OanN4j5d1l99fGDYBWq9LYg0ew/458XVXWlQ==} engines: {node: '>=16.9.x', pnpm: '>=7.x'} tailwindcss@4.3.5: @@ -2086,11 +2080,11 @@ packages: resolution: {integrity: sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==} engines: {node: '>=14.0.0'} - tldts-core@7.5.5: - resolution: {integrity: sha512-rEJz/8cJFY/bdF354gl14yxavbrIbvM+FcbkYVQ6CSCMQTJdUFUIm39TTWSiGPvcpQh7/F6qHrD3SkwwdgtDCw==} + tldts-core@7.6.2: + resolution: {integrity: sha512-/ZG+gignPzfgtpWNnbS7AKcU1ptt9jDqhIlr7vHOaw/Psz6HjXyB2CeFS3RrUGYwER/Q4F6IS8+9rZuYfRUz+Q==} - tldts@7.5.5: - resolution: {integrity: sha512-Hy6IImaWALzJOgCIss4gIFi4G0M9lqk95pFKCUVxQPZw+biZ1Pv6f28JpYgahpJB+BufA0HYsIU/aP/WIx3KRg==} + tldts@7.6.2: + resolution: {integrity: sha512-IylRLICacWmPVf5tQIOvKkZzf2Vp8qJT3bAZox+3bWXj5P/pn45PC1a9l86loP7D/ywbSt/h/NnyIoR0fg4utA==} hasBin: true totalist@3.0.1: @@ -2316,8 +2310,8 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} - ws@8.23.0: - resolution: {integrity: sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==} + ws@8.23.1: + resolution: {integrity: sha512-1rzWDSN0NOi3tpwgHsQExjWRoKUGtjCkJ2gZRaaRtzhYLboMytOI9pj9PU7yCgY37auqdd4OyLofZDbkeuZmPA==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -2375,7 +2369,7 @@ snapshots: '@babel/helper-validator-identifier@7.29.7': {} - '@babel/runtime@7.29.15': {} + '@babel/runtime@7.29.16': {} '@blazediff/core@1.10.0': {} @@ -2434,14 +2428,14 @@ snapshots: svelte: 5.59.2(@typescript-eslint/types@8.74.0) tslib: 2.9.1 - '@eslint-community/eslint-utils@4.10.1(eslint@10.15.0(jiti@2.7.0))': + '@eslint-community/eslint-utils@4.10.1(eslint@10.16.0(jiti@2.7.0))': dependencies: - eslint: 10.15.0(jiti@2.7.0) + eslint: 10.16.0(jiti@2.7.0) eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.12.3': {} + '@eslint-community/regexpp@4.12.4': {} - '@eslint/config-array@0.23.6': + '@eslint/config-array@0.23.7': dependencies: '@eslint/object-schema': 3.0.5 debug: 4.4.3 @@ -2688,16 +2682,16 @@ snapshots: dependencies: acorn: 8.19.0 - '@sveltejs/adapter-static@4.0.1(@sveltejs/kit@3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3))': + '@sveltejs/adapter-static@4.0.1(@sveltejs/kit@3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3))': dependencies: - '@sveltejs/kit': 3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) + '@sveltejs/kit': 3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) - '@sveltejs/kit@3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)': + '@sveltejs/kit@3.4.1(@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)))(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@rolldown/pluginutils': 1.1.1 '@standard-schema/spec': 1.1.0 - '@sveltejs/vite-plugin-svelte': 7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)) + '@sveltejs/vite-plugin-svelte': 7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)) cookie: 2.0.2 devalue: 5.9.4 esm-env: 1.2.2 @@ -2705,19 +2699,19 @@ snapshots: mrmime: 2.0.1 sirv: 3.0.2 svelte: 5.59.2(@typescript-eslint/types@8.74.0) - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' optionalDependencies: typescript: 6.0.3 '@sveltejs/load-config@0.2.3': {} - '@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))': + '@sveltejs/vite-plugin-svelte@7.3.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0))': dependencies: deepmerge: 4.3.1 obug: 3.0.0 svelte: 5.59.2(@typescript-eslint/types@8.74.0) - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' - vitefu: 1.1.4(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' + vitefu: 1.1.4(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) '@swc/helpers@0.5.24': {} @@ -2782,12 +2776,12 @@ snapshots: '@tailwindcss/oxide-win32-arm64-msvc': 4.3.5 '@tailwindcss/oxide-win32-x64-msvc': 4.3.5 - '@tailwindcss/vite@4.3.5(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))': + '@tailwindcss/vite@4.3.5(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))': dependencies: '@tailwindcss/node': 4.3.5 '@tailwindcss/oxide': 4.3.5 tailwindcss: 4.3.5 - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' '@tanstack/hotkeys@0.30.0': {} @@ -2853,10 +2847,6 @@ snapshots: dependencies: '@tauri-apps/api': 2.12.5 - '@tauri-apps/plugin-notification@2.8.1': - dependencies: - '@tauri-apps/api': 2.12.5 - '@tauri-apps/plugin-opener@2.7.3': dependencies: '@tauri-apps/api': 2.12.5 @@ -2893,7 +2883,7 @@ snapshots: '@testing-library/dom@10.4.2': dependencies: '@babel/code-frame': 7.29.7 - '@babel/runtime': 7.29.15 + '@babel/runtime': 7.29.16 '@types/aria-query': 5.0.4 aria-query: 5.3.0 dom-accessibility-api: 0.5.16 @@ -2940,11 +2930,11 @@ snapshots: '@types/esrecurse@4.3.1': {} - '@types/estree@1.0.10': {} + '@types/estree@1.0.11': {} '@types/json-schema@7.0.15': {} - '@types/node@26.6.7': + '@types/node@26.6.11': dependencies: undici-types: 8.9.0 @@ -2983,13 +2973,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.74.0(eslint@10.15.0(jiti@2.7.0))(typescript@6.0.3)': + '@typescript-eslint/utils@8.74.0(eslint@10.16.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.15.0(jiti@2.7.0)) + '@eslint-community/eslint-utils': 4.10.1(eslint@10.16.0(jiti@2.7.0)) '@typescript-eslint/scope-manager': 8.74.0 '@typescript-eslint/types': 8.74.0 '@typescript-eslint/typescript-estree': 8.74.0(typescript@6.0.3) - eslint: 10.15.0(jiti@2.7.0) + eslint: 10.16.0(jiti@2.7.0) typescript: 6.0.3 transitivePeerDependencies: - '@typescript/native' @@ -3007,44 +2997,44 @@ snapshots: '@ui-sdk/core': 0.1.0-beta.1 svelte: 5.59.2(@typescript-eslint/types@8.74.0) - '@vitest/browser-preview@5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0)': + '@vitest/browser-preview@5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0)': dependencies: '@testing-library/dom': 10.4.2 '@testing-library/user-event': 14.6.13(@testing-library/dom@10.4.2) - '@vitest/browser': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) - vitest: 5.1.0(@types/node@26.6.7)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + '@vitest/browser': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) + vitest: 5.1.0(@types/node@26.6.11)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) transitivePeerDependencies: - bufferutil - msw - utf-8-validate - vite - '@vitest/browser@5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0)': + '@vitest/browser@5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0)': dependencies: '@blazediff/core': 1.10.0 - '@vitest/mocker': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + '@vitest/mocker': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) '@vitest/ui': 5.1.0(vitest@5.1.0) '@vitest/utils': 5.1.0 magic-string: 1.4.5 pngjs: 7.0.0 sirv: 3.0.2 tinyrainbow: 3.2.0 - vitest: 5.1.0(@types/node@26.6.7)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) - ws: 8.23.0 + vitest: 5.1.0(@types/node@26.6.11)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) + ws: 8.23.1 transitivePeerDependencies: - bufferutil - msw - utf-8-validate - vite - '@vitest/mocker@5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))': + '@vitest/mocker@5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@vitest/spy': 5.1.0 estree-walker: 3.0.3 magic-string: 1.4.5 optionalDependencies: - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' '@vitest/pretty-format@5.1.0': dependencies: @@ -3067,7 +3057,7 @@ snapshots: pathe: 2.0.3 sirv: 3.0.2 tinyrainbow: 3.2.0 - vitest: 5.1.0(@types/node@26.6.7)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + vitest: 5.1.0(@types/node@26.6.11)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) '@vitest/utils@5.1.0': dependencies: @@ -3075,15 +3065,15 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.2.0 - '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)': + '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)': dependencies: '@oxc-project/runtime': 0.159.0 '@oxc-project/types': 0.159.0 lightningcss: 1.33.0 - postcss: 8.5.33 + postcss: 8.5.34 yuku-parser: 0.19.0 optionalDependencies: - '@types/node': 26.6.7 + '@types/node': 26.6.11 '@voidzero-dev/vite-plus-darwin-arm64': 1.7.0 '@voidzero-dev/vite-plus-darwin-x64': 1.7.0 '@voidzero-dev/vite-plus-linux-arm64-gnu': 1.7.0 @@ -3207,7 +3197,7 @@ snapshots: clsx@2.1.1: {} - colord@2.14.0: {} + colord@2.14.1: {} confbox@0.1.8: {} @@ -3258,13 +3248,13 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-plugin-perfectionist@5.14.0(eslint@10.15.0(jiti@2.7.0))(typescript@6.0.3): + eslint-plugin-perfectionist@5.14.0(eslint@10.16.0(jiti@2.7.0))(typescript@6.0.3): dependencies: '@typescript-eslint/types': 8.74.0 - '@typescript-eslint/utils': 8.74.0(eslint@10.15.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/utils': 8.74.0(eslint@10.16.0(jiti@2.7.0))(typescript@6.0.3) natural-orderby: 5.0.0 optionalDependencies: - eslint: 10.15.0(jiti@2.7.0) + eslint: 10.16.0(jiti@2.7.0) transitivePeerDependencies: - '@typescript/native' - supports-color @@ -3273,7 +3263,7 @@ snapshots: eslint-scope@9.1.2: dependencies: '@types/esrecurse': 4.3.1 - '@types/estree': 1.0.10 + '@types/estree': 1.0.11 esrecurse: 4.3.0 estraverse: 5.3.0 @@ -3281,18 +3271,18 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@10.15.0(jiti@2.7.0): + eslint@10.16.0(jiti@2.7.0): dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.15.0(jiti@2.7.0)) - '@eslint-community/regexpp': 4.12.3 - '@eslint/config-array': 0.23.6 + '@eslint-community/eslint-utils': 4.10.1(eslint@10.16.0(jiti@2.7.0)) + '@eslint-community/regexpp': 4.12.4 + '@eslint/config-array': 0.23.7 '@eslint/config-helpers': 0.7.0 '@eslint/core': 1.2.1 '@eslint/plugin-kit': 0.7.3 '@humanfs/node': 0.16.8 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 - '@types/estree': 1.0.10 + '@types/estree': 1.0.11 ajv: 6.15.0 cross-spawn: 7.0.6 debug: 4.4.3 @@ -3344,7 +3334,7 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.10 + '@types/estree': 1.0.11 esutils@2.0.3: {} @@ -3434,7 +3424,7 @@ snapshots: is-reference@3.0.3: dependencies: - '@types/estree': 1.0.10 + '@types/estree': 1.0.11 isexe@2.0.0: {} @@ -3583,7 +3573,7 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 - oxfmt@0.79.0(svelte@5.59.2(@typescript-eslint/types@8.74.0))(vite-plus@1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)): + oxfmt@0.79.0(svelte@5.59.2(@typescript-eslint/types@8.74.0))(vite-plus@1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)): dependencies: tinypool: 2.2.0 optionalDependencies: @@ -3607,9 +3597,9 @@ snapshots: '@oxfmt/binding-win32-ia32-msvc': 0.79.0 '@oxfmt/binding-win32-x64-msvc': 0.79.0 svelte: 5.59.2(@typescript-eslint/types@8.74.0) - vite-plus: 1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) + vite-plus: 1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) - oxlint@1.94.0(vite-plus@1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)): + oxlint@1.94.0(vite-plus@1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)): optionalDependencies: '@oxlint/binding-android-arm-eabi': 1.94.0 '@oxlint/binding-android-arm64': 1.94.0 @@ -3630,7 +3620,7 @@ snapshots: '@oxlint/binding-win32-arm64-msvc': 1.94.0 '@oxlint/binding-win32-ia32-msvc': 1.94.0 '@oxlint/binding-win32-x64-msvc': 1.94.0 - vite-plus: 1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) + vite-plus: 1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3) p-limit@3.1.0: dependencies: @@ -3672,7 +3662,7 @@ snapshots: pngjs@7.0.0: {} - postcss@8.5.33: + postcss@8.5.34: dependencies: nanoid: 3.3.20 picocolors: 1.1.1 @@ -3782,7 +3772,7 @@ snapshots: '@jridgewell/remapping': 2.3.5 '@jridgewell/sourcemap-codec': 1.6.0 '@sveltejs/acorn-typescript': 1.0.13(acorn@8.19.0) - '@types/estree': 1.0.10 + '@types/estree': 1.0.11 acorn: 8.19.0 aria-query: 5.3.1 axobject-query: 4.1.0 @@ -3797,7 +3787,7 @@ snapshots: transitivePeerDependencies: - '@typescript-eslint/types' - tailwind-variants@4.0.2: {} + tailwind-variants@4.1.0: {} tailwindcss@4.3.5: {} @@ -3816,11 +3806,11 @@ snapshots: tinyrainbow@3.2.0: {} - tldts-core@7.5.5: {} + tldts-core@7.6.2: {} - tldts@7.5.5: + tldts@7.6.2: dependencies: - tldts-core: 7.5.5 + tldts-core: 7.6.2 totalist@3.0.1: {} @@ -3853,13 +3843,13 @@ snapshots: undici-types@8.9.0: {} - unplugin-icons@24.0.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)): + unplugin-icons@24.0.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(svelte@5.59.2(@typescript-eslint/types@8.74.0)): dependencies: '@antfu/install-pkg': 1.1.0 '@iconify/utils': 3.1.7 local-pkg: 1.2.1 obug: 2.2.1 - unplugin: 3.7.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + unplugin: 3.7.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) optionalDependencies: svelte: 5.59.2(@typescript-eslint/types@8.74.0) transitivePeerDependencies: @@ -3874,14 +3864,14 @@ snapshots: - vite - webpack - unplugin@3.7.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)): + unplugin@3.7.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)): dependencies: '@jridgewell/remapping': 2.3.5 '@rolldown/pluginutils': 1.1.1 picomatch: 4.0.7 webpack-virtual-modules: 0.6.2 optionalDependencies: - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' uri-js@4.4.1: dependencies: @@ -3897,28 +3887,28 @@ snapshots: optionalDependencies: svelte: 5.59.2(@typescript-eslint/types@8.74.0) - vite-plugin-devtools-json@1.1.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)): + vite-plugin-devtools-json@1.1.2(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)): dependencies: uuid: 14.0.3 - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' - vite-plus@1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3): + vite-plus@1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3): dependencies: '@oxc-project/runtime': 0.159.0 '@oxc-project/types': 0.159.0 '@oxlint/plugins': 1.94.0 - '@vitest/browser': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) - '@vitest/browser-preview': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) - '@vitest/mocker': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + '@vitest/browser': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) + '@vitest/browser-preview': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) + '@vitest/mocker': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) '@vitest/pretty-format': 5.1.0 '@vitest/snapshot': 5.1.0 '@vitest/spy': 5.1.0 '@vitest/utils': 5.1.0 - oxfmt: 0.79.0(svelte@5.59.2(@typescript-eslint/types@8.74.0))(vite-plus@1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)) - oxlint: 1.94.0(vite-plus@1.7.0(@types/node@26.6.7)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)) + oxfmt: 0.79.0(svelte@5.59.2(@typescript-eslint/types@8.74.0))(vite-plus@1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)) + oxlint: 1.94.0(vite-plus@1.7.0(@types/node@26.6.11)(@vitest/ui@5.1.0)(jiti@2.7.0)(svelte@5.59.2(@typescript-eslint/types@8.74.0))(typescript@6.0.3)) tsrs: 7.1.0-beta.tsrs2 - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' - vitest: 5.1.0(@types/node@26.6.7)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' + vitest: 5.1.0(@types/node@26.6.11)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) optionalDependencies: '@voidzero-dev/vite-plus-darwin-arm64': 1.7.0 '@voidzero-dev/vite-plus-darwin-x64': 1.7.0 @@ -3964,14 +3954,14 @@ snapshots: - vue-tsc - yaml - vitefu@1.1.4(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)): + vitefu@1.1.4(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)): optionalDependencies: - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' - vitest@5.1.0(@types/node@26.6.7)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)): + vitest@5.1.0(@types/node@26.6.11)(@vitest/browser-preview@5.1.0)(@vitest/ui@5.1.0)(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)): dependencies: '@types/chai': 5.2.3 - '@vitest/mocker': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)) + '@vitest/mocker': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)) chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -3982,11 +3972,11 @@ snapshots: tinybench: 6.2.5 tinyexec: 1.4.0 tinyglobby: 0.2.17 - vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3)' + vite: '@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3)' why-is-node-running: 3.2.1 optionalDependencies: - '@types/node': 26.6.7 - '@vitest/browser-preview': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.7)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) + '@types/node': 26.6.11 + '@vitest/browser-preview': 5.1.0(@voidzero-dev/vite-plus-core@8.3.8000(@types/node@26.6.11)(jiti@2.7.0)(typescript@6.0.3))(vitest@5.1.0) '@vitest/ui': 5.1.0(vitest@5.1.0) transitivePeerDependencies: - msw @@ -4003,7 +3993,7 @@ snapshots: word-wrap@1.2.5: {} - ws@8.23.0: {} + ws@8.23.1: {} yocto-queue@0.1.0: {} diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 023db655..ac42d543 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -575,17 +575,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" -[[package]] -name = "chacha20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" -dependencies = [ - "cfg-if", - "cpufeatures 0.3.1", - "rand_core 0.10.1", -] - [[package]] name = "chrono" version = "0.4.45" @@ -1460,6 +1449,12 @@ version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" +[[package]] +name = "futures-timer" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" + [[package]] name = "futures-util" version = "0.3.34" @@ -1629,7 +1624,6 @@ dependencies = [ "js-sys", "libc", "r-efi 6.0.0", - "rand_core 0.10.1", "wasm-bindgen", ] @@ -2037,6 +2031,7 @@ dependencies = [ "futures", "keyring", "mimalloc", + "notify-rust", "percent-encoding", "reqwest 0.12.28", "rusqlite", @@ -2048,7 +2043,6 @@ dependencies = [ "tauri-build", "tauri-plugin-deep-link", "tauri-plugin-fs", - "tauri-plugin-notification", "tauri-plugin-opener", "tauri-plugin-os", "tauri-plugin-process", @@ -2648,6 +2642,24 @@ dependencies = [ "uuid", ] +[[package]] +name = "mac-usernotifications" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08adbb1b9e11709f9ce628dd7471208e5dd3ad35a245dbc81e59a36dce3f3780" +dependencies = [ + "block2", + "futures-channel", + "futures-lite", + "futures-timer", + "log", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-user-notifications", + "thiserror 2.0.21", +] + [[package]] name = "markup5ever" version = "0.39.0" @@ -2859,6 +2871,7 @@ dependencies = [ "futures-lite", "log", "mac-notification-sys", + "mac-usernotifications", "serde", "tauri-winrt-notification", "zbus 6.3.0", @@ -3034,7 +3047,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.13.2", + "block2", "dispatch2", + "libc", "objc2", ] @@ -3173,7 +3188,10 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" dependencies = [ + "bitflags 2.13.2", + "block2", "objc2", + "objc2-core-location", "objc2-foundation", ] @@ -3694,17 +3712,6 @@ dependencies = [ "rand_core 0.9.5", ] -[[package]] -name = "rand" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6fa277c67e6ea590466f04c3fe82cb509f0864fe470643e5570de9514a9b11" -dependencies = [ - "chacha20", - "getrandom 0.4.3", - "rand_core 0.10.1", -] - [[package]] name = "rand_chacha" version = "0.3.1" @@ -3743,12 +3750,6 @@ dependencies = [ "getrandom 0.3.4", ] -[[package]] -name = "rand_core" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" - [[package]] name = "raw-window-handle" version = "0.6.2" @@ -5022,26 +5023,6 @@ dependencies = [ "url", ] -[[package]] -name = "tauri-plugin-notification" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a226bfb8189ec4ab2c1936e66330ad06c44d9f6c54a674338208491dee177f" -dependencies = [ - "log", - "notify-rust", - "rand 0.10.4", - "serde", - "serde_json", - "serde_repr", - "tauri", - "tauri-plugin", - "thiserror 2.0.21", - "time", - "url", - "zbus 5.19.0", -] - [[package]] name = "tauri-plugin-opener" version = "2.7.3" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ff278c2a..d5468dd5 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -28,7 +28,9 @@ tauri-build = { version = "2", features = [] } anyhow = "1.0.104" either = "1.19.0" futures = "0.3.34" +keyring = "4.2.0" mimalloc = "0.1" +notify-rust = { version = "4.19.0", features = ["preview-macos-un"] } reqwest = { version = "0.12.28", features = ["json"] } rusqlite = { version = "0.40.2", features = ["bundled"] } rustc-hash = "2.1.3" @@ -40,7 +42,6 @@ time = { version = "0.3", features = ["formatting", "local-offset"] } tauri = { version = "2", features = [] } tauri-plugin-deep-link = "2" tauri-plugin-fs = "2" -tauri-plugin-notification = "2" tauri-plugin-opener = "2" tauri-plugin-os = "2" tauri-plugin-process = "2" @@ -52,7 +53,6 @@ tracing = "0.1" tracing-appender = "0.2" tracing-subscriber = { version = "0.3", features = ["env-filter", "time"] } twitch_oauth2 = { version = "0.15", features = ["reqwest"] } -keyring = "4.2.0" zstd = "0.14.3" percent-encoding = "2.3" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 57fb2095..5b10bb81 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -27,7 +27,6 @@ } ] }, - "notification:default", "opener:default", "os:default", { diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 29d7bdcd..64750765 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -85,7 +85,6 @@ pub fn run() { builder .plugin(tauri_plugin_deep_link::init()) .plugin(tauri_plugin_fs::init()) - .plugin(tauri_plugin_notification::init()) .plugin(tauri_plugin_opener::init()) .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_process::init()) From a42890dc0218306139bcd4c3f36c2b4790635cd3 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Mon, 9 Nov 2026 17:34:49 -0500 Subject: [PATCH 02/13] minimal example --- src-tauri/src/lib.rs | 45 +++++++++++++++++++++++++++++ src-tauri/tauri.conf.json | 5 +++- src/lib/app.svelte.ts | 8 +++++ src/lib/handlers/pubsub/whispers.ts | 5 +++- 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 64750765..a78e2572 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -4,6 +4,7 @@ use auth::{IntegrityState, PendingToken}; use cache::Cache; use connection::Connection; use irc::IrcClient; +use notify_rust::Notification; use pubsub::PubSubClient; use seventv::SeventTvClient; use tauri::Manager; @@ -159,6 +160,49 @@ pub fn run() { .expect("error while running tauri application"); } +// Must stay async: sync commands run on the main thread, and a panic there +// aborts the whole process instead of just failing the invoke. +#[tauri::command] +#[tracing::instrument(skip(app))] +async fn notify(#[allow(unused_variables)] app: tauri::AppHandle) -> Result<(), error::Error> { + let mut notification = Notification::new(); + + notification + .summary("Hyperion") + .body("Test notification from Hyperion"); + + #[cfg(target_os = "macos")] + if !notify_rust::request_auth() + .await + .map_err(anyhow::Error::from)? + { + return Err(anyhow::anyhow!("notification permission denied").into()); + } + + #[cfg(not(windows))] + notification + .show_async() + .await + .map_err(anyhow::Error::from)?; + + #[cfg(windows)] + { + let exe = std::env::current_exe().map_err(anyhow::Error::from)?; + + let in_target = exe + .parent() + .is_some_and(|dir| dir.ends_with("target/debug") || dir.ends_with("target/release")); + + if !in_target { + notification.app_id(&app.config().identifier); + } + + notification.show().map_err(anyhow::Error::from)? + }; + + Ok(()) +} + fn get_handler() -> impl Fn(Invoke) -> bool { tauri::generate_handler![ api::join, @@ -181,5 +225,6 @@ fn get_handler() -> impl Fn(Invoke) -> bool { pubsub::connect_pubsub, seventv::connect_seventv, seventv::sync_seventv, + notify, ] } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 5d28d9a5..3a758cef 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -40,7 +40,10 @@ "icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png" - ] + ], + "macOS": { + "signingIdentity": "-" + } }, "plugins": { "deep-link": { diff --git a/src/lib/app.svelte.ts b/src/lib/app.svelte.ts index 0637cee9..3bad2fde 100644 --- a/src/lib/app.svelte.ts +++ b/src/lib/app.svelte.ts @@ -90,6 +90,14 @@ class App { return id ? (this.channels.get(id) ?? null) : null; } + public async notify() { + try { + await invoke("notify"); + } catch (error) { + log.warn("Failed to show notification", error); + } + } + /** * Restores the session stored by the backend. Resolves to the signed in * user or `null` if they have to sign in again. diff --git a/src/lib/handlers/pubsub/whispers.ts b/src/lib/handlers/pubsub/whispers.ts index d1a6a9c4..1bc3ce3e 100644 --- a/src/lib/handlers/pubsub/whispers.ts +++ b/src/lib/handlers/pubsub/whispers.ts @@ -48,6 +48,9 @@ export default defineHandler("pubsub", { data.id, ); - if (incoming) whisper.unread++; + if (incoming) { + whisper.unread++; + await app.notify(); + } }, }); From bc07e1ed5b8816e9504e37e0fd570278b92b771b Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Wed, 11 Nov 2026 11:51:07 -0500 Subject: [PATCH 03/13] add mention & whisper notifs --- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 7 +- src-tauri/src/lib.rs | 47 +---- src-tauri/src/notify.rs | 283 ++++++++++++++++++++++++++++ src/lib/app.svelte.ts | 13 +- src/lib/handlers/irc/privmsg.ts | 13 ++ src/lib/handlers/pubsub/whispers.ts | 27 +-- src/lib/highlights.ts | 11 +- src/lib/models/chat.svelte.ts | 20 +- src/lib/notifications.ts | 128 +++++++++++++ 10 files changed, 481 insertions(+), 70 deletions(-) create mode 100644 src-tauri/src/notify.rs create mode 100644 src/lib/notifications.ts diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ac42d543..519333ee 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2030,6 +2030,7 @@ dependencies = [ "either", "futures", "keyring", + "mac-usernotifications", "mimalloc", "notify-rust", "percent-encoding", @@ -2871,7 +2872,6 @@ dependencies = [ "futures-lite", "log", "mac-notification-sys", - "mac-usernotifications", "serde", "tauri-winrt-notification", "zbus 6.3.0", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d5468dd5..cd52d847 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -30,7 +30,6 @@ either = "1.19.0" futures = "0.3.34" keyring = "4.2.0" mimalloc = "0.1" -notify-rust = { version = "4.19.0", features = ["preview-macos-un"] } reqwest = { version = "0.12.28", features = ["json"] } rusqlite = { version = "0.40.2", features = ["bundled"] } rustc-hash = "2.1.3" @@ -60,3 +59,9 @@ percent-encoding = "2.3" tauri-plugin-single-instance = { version = "2", features = ["deep-link"] } tauri-plugin-updater = "2" tauri-plugin-window-state = "2" + +[target.'cfg(target_os = "macos")'.dependencies] +mac-usernotifications = { version = "0.3.1", default-features = false } + +[target.'cfg(not(target_os = "macos"))'.dependencies] +notify-rust = "4.19.0" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a78e2572..1b7bb74f 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -4,7 +4,6 @@ use auth::{IntegrityState, PendingToken}; use cache::Cache; use connection::Connection; use irc::IrcClient; -use notify_rust::Notification; use pubsub::PubSubClient; use seventv::SeventTvClient; use tauri::Manager; @@ -21,6 +20,7 @@ mod connection; mod error; mod irc; mod log; +mod notify; mod popout; mod pubsub; mod seventv; @@ -160,49 +160,6 @@ pub fn run() { .expect("error while running tauri application"); } -// Must stay async: sync commands run on the main thread, and a panic there -// aborts the whole process instead of just failing the invoke. -#[tauri::command] -#[tracing::instrument(skip(app))] -async fn notify(#[allow(unused_variables)] app: tauri::AppHandle) -> Result<(), error::Error> { - let mut notification = Notification::new(); - - notification - .summary("Hyperion") - .body("Test notification from Hyperion"); - - #[cfg(target_os = "macos")] - if !notify_rust::request_auth() - .await - .map_err(anyhow::Error::from)? - { - return Err(anyhow::anyhow!("notification permission denied").into()); - } - - #[cfg(not(windows))] - notification - .show_async() - .await - .map_err(anyhow::Error::from)?; - - #[cfg(windows)] - { - let exe = std::env::current_exe().map_err(anyhow::Error::from)?; - - let in_target = exe - .parent() - .is_some_and(|dir| dir.ends_with("target/debug") || dir.ends_with("target/release")); - - if !in_target { - notification.app_id(&app.config().identifier); - } - - notification.show().map_err(anyhow::Error::from)? - }; - - Ok(()) -} - fn get_handler() -> impl Fn(Invoke) -> bool { tauri::generate_handler![ api::join, @@ -225,6 +182,6 @@ fn get_handler() -> impl Fn(Invoke) -> bool { pubsub::connect_pubsub, seventv::connect_seventv, seventv::sync_seventv, - notify, + notify::notify, ] } diff --git a/src-tauri/src/notify.rs b/src-tauri/src/notify.rs new file mode 100644 index 00000000..0a176fef --- /dev/null +++ b/src-tauri/src/notify.rs @@ -0,0 +1,283 @@ +use serde::{Deserialize, Serialize}; +use tauri::{AppHandle, Manager}; + +use crate::MAIN_WINDOW_LABEL; +use crate::error::Error; + +const REPLY_ACTION: &str = "__reply"; +const REPLY_LABEL: &str = "Reply"; + +#[derive(Debug, Deserialize)] +pub struct NotifyAction { + id: String, + label: String, +} + +#[derive(Debug, Clone, Copy, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum NotifyUrgency { + Low, + Normal, + Critical, +} + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct NotifyOptions { + title: String, + subtitle: Option, + #[serde(default)] + body: String, + #[serde(default)] + actions: Vec, + reply: Option, + urgency: Option, + timeout: Option, +} + +#[derive(Debug, Serialize)] +#[serde(tag = "type", rename_all = "lowercase")] +pub enum NotifyResponse { + /// The notification itself was clicked. + Default, + /// One of the notification's actions was clicked. + Action { id: String }, + /// The user replied. `text` is `None` where the platform has no inline + /// reply field and the user clicked the "Reply" button instead. + Reply { text: Option }, + /// The notification was dismissed or expired. + Closed, +} + +impl NotifyResponse { + /// Whether the user expects the app to come to the front, which is + /// anything but a dismissal or a reply sent from the notification. + fn activates(&self) -> bool { + matches!( + self, + Self::Default | Self::Action { .. } | Self::Reply { text: None } + ) + } +} + +#[tauri::command] +#[tracing::instrument(skip_all, fields(title = %options.title))] +pub async fn notify(app: AppHandle, options: NotifyOptions) -> Result { + let response = platform::show(&app, &options).await?; + + if response.activates() { + focus_main_window(&app); + } + + Ok(response) +} + +fn focus_main_window(app: &AppHandle) { + let Some(window) = app.get_webview_window(MAIN_WINDOW_LABEL) else { + return; + }; + + let focused = window + .unminimize() + .and_then(|()| window.show()) + .and_then(|()| window.set_focus()); + + if let Err(err) = focused { + tracing::error!(%err, "Failed to focus the main window"); + } +} + +#[cfg(target_os = "macos")] +mod platform { + use std::time::Duration; + + use mac_usernotifications::{Action, InterruptionLevel, Notification, NotificationResponse}; + use tauri::AppHandle; + + use super::{NotifyOptions, NotifyResponse, NotifyUrgency, REPLY_ACTION, REPLY_LABEL}; + + pub async fn show(_app: &AppHandle, options: &NotifyOptions) -> anyhow::Result { + if !mac_usernotifications::request_auth().await? { + anyhow::bail!("notification permission denied"); + } + + let handle = build(options).send().await?; + + // Resolves from the delegate on the main run loop, so nothing is + // blocked while the user hasn't responded. + Ok(handle.response().await?.into()) + } + + fn build(options: &NotifyOptions) -> Notification { + let mut notification = Notification::new() + .title(&options.title) + .message(&options.body) + .maybe_subtitle(options.subtitle.as_deref()); + + if let Some(urgency) = options.urgency { + notification = notification.interruption_level(urgency.into()); + } + + // Without a timeout the notification stays in Notification Center. + if let Some(ms) = options.timeout.filter(|&ms| ms > 0) { + notification = notification.timeout(Duration::from_millis(ms.into())); + } + + for action in &options.actions { + notification = notification.action(Action::button(&action.id, &action.label)); + } + + if let Some(placeholder) = &options.reply { + notification = notification.action(Action::reply( + REPLY_ACTION, + REPLY_LABEL, + "Send", + placeholder, + )); + } + + notification + } + + impl From for InterruptionLevel { + fn from(urgency: NotifyUrgency) -> Self { + match urgency { + NotifyUrgency::Low => InterruptionLevel::Passive, + NotifyUrgency::Normal => InterruptionLevel::Active, + NotifyUrgency::Critical => InterruptionLevel::TimeSensitive, + } + } + } + + impl From for NotifyResponse { + fn from(response: NotificationResponse) -> Self { + if response.is_reply() { + Self::Reply { + text: response.reply_text, + } + } else if response.close_reason.is_some() { + Self::Closed + } else if response.is_default_action() { + Self::Default + } else { + Self::Action { + id: response.action_identifier, + } + } + } + } +} + +#[cfg(not(target_os = "macos"))] +mod platform { + use notify_rust::{Notification, NotificationResponse, Timeout, Urgency}; + use tauri::AppHandle; + + use super::{NotifyOptions, NotifyResponse, NotifyUrgency, REPLY_ACTION, REPLY_LABEL}; + + #[cfg(unix)] + pub async fn show(_app: &AppHandle, options: &NotifyOptions) -> anyhow::Result { + let handle = build(options).show_async().await?; + let mut response = None; + + // Listens for the server's signals on the handle's D-Bus connection, + // so nothing is blocked while the user hasn't responded. + handle + .wait_for_action_async(|res: &NotificationResponse| response = Some(res.clone())) + .await; + + Ok(response.map_or(NotifyResponse::Closed, NotifyResponse::from)) + } + + #[cfg(windows)] + pub async fn show(app: &AppHandle, options: &NotifyOptions) -> anyhow::Result { + let mut notification = build(options); + + let exe = std::env::current_exe()?; + + let in_target = exe + .parent() + .is_some_and(|dir| dir.ends_with("target/debug") || dir.ends_with("target/release")); + + // Unbundled builds have no registered app id, so let them fall back + // to PowerShell's instead of failing. + if !in_target { + notification.app_id(&app.config().identifier); + } + + let handle = notification.show()?; + + // Windows only offers a blocking wait, which ends once the toast is + // clicked, dismissed, or times out into Action Center. + let response = tauri::async_runtime::spawn_blocking(move || { + let mut response = None; + + handle.wait_for_response(|res: &NotificationResponse| response = Some(res.clone()))?; + + Ok::<_, notify_rust::error::Error>(response) + }) + .await??; + + Ok(response.map_or(NotifyResponse::Closed, NotifyResponse::from)) + } + + fn build(options: &NotifyOptions) -> Notification { + let mut notification = Notification::new(); + + notification.summary(&options.title).body(&options.body); + + if let Some(subtitle) = &options.subtitle { + notification.subtitle(subtitle); + } + + if let Some(urgency) = options.urgency { + notification.urgency(urgency.into()); + } + + if let Some(timeout) = options.timeout { + notification.timeout(match timeout { + 0 => Timeout::Never, + ms => Timeout::Milliseconds(ms), + }); + } + + // XDG servers only report clicks on the body when a "default" action + // exists. Most don't show it as a button. + #[cfg(unix)] + notification.action("default", "Open"); + + for action in &options.actions { + notification.action(&action.id, &action.label); + } + + if options.reply.is_some() { + notification.action(REPLY_ACTION, REPLY_LABEL); + } + + notification + } + + impl From for Urgency { + fn from(urgency: NotifyUrgency) -> Self { + match urgency { + NotifyUrgency::Low => Urgency::Low, + NotifyUrgency::Normal => Urgency::Normal, + NotifyUrgency::Critical => Urgency::Critical, + } + } + } + + impl From for NotifyResponse { + fn from(response: NotificationResponse) -> Self { + match response { + NotificationResponse::Default => Self::Default, + NotificationResponse::Reply(text) => Self::Reply { text: Some(text) }, + NotificationResponse::Closed(_) => Self::Closed, + NotificationResponse::Action(id) if id == REPLY_ACTION => { + Self::Reply { text: None } + } + NotificationResponse::Action(id) => Self::Action { id }, + } + } + } +} diff --git a/src/lib/app.svelte.ts b/src/lib/app.svelte.ts index 3bad2fde..84a5f2c2 100644 --- a/src/lib/app.svelte.ts +++ b/src/lib/app.svelte.ts @@ -6,6 +6,7 @@ import { page } from "$app/state"; import type { Channel } from "./models/channel.svelte"; import type { Followed } from "./models/current-user.svelte"; +import type { NotificationOptions, NotificationResponse } from "./notifications"; import type { DispatchPayload } from "./seventv"; import type { IrcMessage } from "./twitch/irc"; import type { PubSubMessage } from "./twitch/pubsub"; @@ -90,11 +91,19 @@ class App { return id ? (this.channels.get(id) ?? null) : null; } - public async notify() { + /** + * Shows a system notification. Resolves with the user's response, or + * `null` if the notification couldn't be shown. + * + * It only resolves once the user responds, which may be never, so don't + * await it where that would hold up other work. + */ + public async notify(options: NotificationOptions) { try { - await invoke("notify"); + return await invoke("notify", { options }); } catch (error) { log.warn("Failed to show notification", error); + return null; } } diff --git a/src/lib/handlers/irc/privmsg.ts b/src/lib/handlers/irc/privmsg.ts index fe4e6f80..60ad2f0c 100644 --- a/src/lib/handlers/irc/privmsg.ts +++ b/src/lib/handlers/irc/privmsg.ts @@ -1,5 +1,7 @@ import { app } from "#lib/app.svelte.js"; +import { mentions } from "#lib/highlights.js"; import { UserMessage } from "#lib/models/message/user-message.svelte.js"; +import { notifyMention } from "#lib/notifications.js"; import { defineHandler } from "../helper"; @@ -21,5 +23,16 @@ export default defineHandler("irc", { if (data.custom_reward_id) { channel.chat.redemptions.attachMessage(data.custom_reward_id, data.sender.id, message); } + + const user = app.user; + + if ( + user && + !data.is_recent && + data.sender.id !== user.id && + mentions(message.text, user.username) + ) { + void notifyMention(message); + } }, }); diff --git a/src/lib/handlers/pubsub/whispers.ts b/src/lib/handlers/pubsub/whispers.ts index 1bc3ce3e..33dfb7f7 100644 --- a/src/lib/handlers/pubsub/whispers.ts +++ b/src/lib/handlers/pubsub/whispers.ts @@ -1,6 +1,7 @@ import { app } from "#lib/app.svelte.js"; import { Badge } from "#lib/models/badge.js"; import { Whisper } from "#lib/models/whisper.svelte.js"; +import { notifyWhisper } from "#lib/notifications.js"; import { defineHandler } from "../helper"; @@ -35,22 +36,22 @@ export default defineHandler("pubsub", { () => new Whisper(app.twitch, data.thread_id, other), ); - whisper.add( - { - id: data.message_id, - createdAt: new Date(data.sent_ts * 1000), - badges: data.tags.badges - .map((badge) => app.badges.get(Badge.key(badge.id, badge.version))) - .filter((badge) => badge != null), - user: incoming ? other : user, - text: data.body, - }, - data.id, - ); + const message = { + id: data.message_id, + createdAt: new Date(data.sent_ts * 1000), + badges: data.tags.badges + .map((badge) => app.badges.get(Badge.key(badge.id, badge.version))) + .filter((badge) => badge != null), + user: incoming ? other : user, + text: data.body, + }; + + whisper.add(message, data.id); if (incoming) { whisper.unread++; - await app.notify(); + + void notifyWhisper(whisper, message); } }, }); diff --git a/src/lib/highlights.ts b/src/lib/highlights.ts index f4dea872..8e4350b9 100644 --- a/src/lib/highlights.ts +++ b/src/lib/highlights.ts @@ -101,10 +101,15 @@ export function defaultHighlights() { ) as Record; } -export function highlightOf(text: string, viewer: Viewer, username: string | undefined) { - const hasMention = username && new RegExp(`@${RegExp.escape(username)}\\b`, "i").test(text); +/** + * Whether the text @-mentions the given username. + */ +export function mentions(text: string, username: string | undefined) { + return !!username && new RegExp(`@${RegExp.escape(username)}\\b`, "i").test(text); +} - if (hasMention) return "mention"; +export function highlightOf(text: string, viewer: Viewer, username: string | undefined) { + if (mentions(text, username)) return "mention"; if (viewer.new) return "new"; if (viewer.returning) return "returning"; if (viewer.broadcaster) return "broadcaster"; diff --git a/src/lib/models/chat.svelte.ts b/src/lib/models/chat.svelte.ts index 0b43148c..a4b6af19 100644 --- a/src/lib/models/chat.svelte.ts +++ b/src/lib/models/chat.svelte.ts @@ -67,6 +67,12 @@ interface SendOptions { * @default false */ pin?: boolean; + + /** + * The message to reply to. Defaults to the current reply target, which is + * cleared on send. + */ + replyTo?: UserMessage; } export class Chat { @@ -310,7 +316,7 @@ export class Chat { } try { - await this.#sendText(text); + await this.#sendText(text, options?.replyTo); } catch (error) { log.error(`Failed to send message in ${this.channel.user.username}`, error); throw new CommandError("Your message could not be sent."); @@ -329,13 +335,17 @@ export class Chat { void app.user?.sendPresence(this.channel.id); } - async #sendText(message: string) { + async #sendText(message: string, replyTo?: UserMessage) { const text = this.#prepare(message); if (text === null) return; - // Clear the reply before sending so the UI doesn't wait on it. - const replyId = this.replyTarget?.id; - this.replyTarget = null; + let replyId = replyTo?.id; + + if (!replyTo) { + // Clear the reply before sending so the UI doesn't wait on it. + replyId = this.replyTarget?.id; + this.replyTarget = null; + } const { sent } = await this.channel.client.gql(sendMessageMutation, { input: { diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts new file mode 100644 index 00000000..3e149e04 --- /dev/null +++ b/src/lib/notifications.ts @@ -0,0 +1,128 @@ +import { goto } from "$app/navigation"; +import { resolve } from "$app/paths"; +import { page } from "$app/state"; + +import type { UserMessage } from "./models/message/user-message.svelte"; +import type { Whisper, WhisperMessage } from "./models/whisper.svelte"; + +import { app } from "./app.svelte"; +import { log } from "./log"; + +export interface NotificationAction { + /** + * Reported back in the response when the action is clicked. + */ + id: string; + label: string; +} + +export type NotificationUrgency = "low" | "normal" | "critical"; + +export interface NotificationOptions { + title: string; + + /** + * Shown below the title on macOS and Windows. + */ + subtitle?: string; + body?: string; + actions?: NotificationAction[]; + + /** + * Placeholder of an inline reply field. + */ + reply?: string; + urgency?: NotificationUrgency; + + /** + * How long the notification stays up in milliseconds, `0` keeps it until + * dismissed. Platforms may round it or ignore it. + */ + timeout?: number; +} + +/** + * How the user responded to a notification. The app is brought to the front + * for everything but `closed` and replies with text. + */ +export type NotificationResponse = + | { type: "default" } + | { type: "action"; id: string } + | { type: "reply"; text: string | null } + | { type: "closed" }; + +export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { + const { sender } = whisper; + + const viewing = + document.hasFocus() && + page.route.id === "/(main)/whispers/[id]" && + page.params.id === sender.id; + + if (viewing) return; + + const response = await app.notify({ + title: sender.displayName, + subtitle: "Whisper", + body: message.text, + actions: [{ id: "view", label: "View" }], + reply: `Reply to ${sender.displayName}`, + }); + + if (response?.type === "reply" && response.text) { + try { + await whisper.send(response.text); + await whisper.markRead(); + } catch (error) { + log.error("Failed to send whisper reply", error); + + void app.notify({ + title: "Whisper not sent", + body: `Your reply to ${sender.displayName} could not be sent.`, + }); + } + + return; + } + + if (response && response.type !== "closed") { + await goto(resolve("/(main)/whispers/[id]", { id: sender.id })); + } +} + +export async function notifyMention(message: UserMessage) { + const { channel, author } = message; + + if (document.hasFocus() && app.focused === channel) return; + + const response = await app.notify({ + title: author.displayName, + subtitle: `Mentioned you in ${channel.user.displayName}`, + body: message.text, + reply: `Reply to ${author.displayName}`, + }); + + if (response?.type === "reply" && response.text) { + try { + await channel.chat.send(response.text, { replyTo: message }); + } catch (error) { + log.error("Failed to send mention reply", error); + + void app.notify({ + title: "Reply not sent", + body: `Your reply in ${channel.user.displayName} could not be sent.`, + }); + } + + return; + } + + if (!response || response.type === "closed") return; + + await app.open(channel); + + // Without an inline reply field, pick the reply in the chat input instead. + if (response.type === "reply") { + channel.chat.replyTarget = message; + } +} From ba718f1f8fddbc4c9252033e636ca0d156eb86d2 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Thu, 19 Nov 2026 15:46:15 -0500 Subject: [PATCH 04/13] move `mentions` to util --- src/lib/handlers/irc/privmsg.ts | 2 +- src/lib/highlights.ts | 9 ++------- src/lib/util/index.ts | 4 ++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lib/handlers/irc/privmsg.ts b/src/lib/handlers/irc/privmsg.ts index 60ad2f0c..6fd4a6cf 100644 --- a/src/lib/handlers/irc/privmsg.ts +++ b/src/lib/handlers/irc/privmsg.ts @@ -1,7 +1,7 @@ import { app } from "#lib/app.svelte.js"; -import { mentions } from "#lib/highlights.js"; import { UserMessage } from "#lib/models/message/user-message.svelte.js"; import { notifyMention } from "#lib/notifications.js"; +import { mentions } from "#lib/util/index.js"; import { defineHandler } from "../helper"; diff --git a/src/lib/highlights.ts b/src/lib/highlights.ts index 8e4350b9..07b933f4 100644 --- a/src/lib/highlights.ts +++ b/src/lib/highlights.ts @@ -14,6 +14,8 @@ import { import type { Viewer } from "./models/viewer.svelte"; +import { mentions } from "./util/index.js"; + export interface HighlightConfig { enabled: boolean; color: string; @@ -101,13 +103,6 @@ export function defaultHighlights() { ) as Record; } -/** - * Whether the text @-mentions the given username. - */ -export function mentions(text: string, username: string | undefined) { - return !!username && new RegExp(`@${RegExp.escape(username)}\\b`, "i").test(text); -} - export function highlightOf(text: string, viewer: Viewer, username: string | undefined) { if (mentions(text, username)) return "mention"; if (viewer.new) return "new"; diff --git a/src/lib/util/index.ts b/src/lib/util/index.ts index d29bf79e..55f3390e 100644 --- a/src/lib/util/index.ts +++ b/src/lib/util/index.ts @@ -40,3 +40,7 @@ export async function openMenu(event: MouseEvent, menufn: () => Promise) { const menu = await menufn(); await menu.popup(); } + +export function mentions(text: string, username: string | undefined) { + return !!username && new RegExp(`@${RegExp.escape(username)}\\b`, "i").test(text); +} From e75a5cd857fd792ed5d13187253a6f99530e4ca1 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Thu, 19 Nov 2026 16:15:25 -0500 Subject: [PATCH 05/13] remove urgency field --- src-tauri/src/notify.rs | 43 +++------------------------------------- src/lib/notifications.ts | 3 --- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/src-tauri/src/notify.rs b/src-tauri/src/notify.rs index 0a176fef..58283c03 100644 --- a/src-tauri/src/notify.rs +++ b/src-tauri/src/notify.rs @@ -13,14 +13,6 @@ pub struct NotifyAction { label: String, } -#[derive(Debug, Clone, Copy, Deserialize)] -#[serde(rename_all = "lowercase")] -pub enum NotifyUrgency { - Low, - Normal, - Critical, -} - #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct NotifyOptions { @@ -31,7 +23,6 @@ pub struct NotifyOptions { #[serde(default)] actions: Vec, reply: Option, - urgency: Option, timeout: Option, } @@ -94,7 +85,7 @@ mod platform { use mac_usernotifications::{Action, InterruptionLevel, Notification, NotificationResponse}; use tauri::AppHandle; - use super::{NotifyOptions, NotifyResponse, NotifyUrgency, REPLY_ACTION, REPLY_LABEL}; + use super::{NotifyOptions, NotifyResponse, REPLY_ACTION, REPLY_LABEL}; pub async fn show(_app: &AppHandle, options: &NotifyOptions) -> anyhow::Result { if !mac_usernotifications::request_auth().await? { @@ -114,10 +105,6 @@ mod platform { .message(&options.body) .maybe_subtitle(options.subtitle.as_deref()); - if let Some(urgency) = options.urgency { - notification = notification.interruption_level(urgency.into()); - } - // Without a timeout the notification stays in Notification Center. if let Some(ms) = options.timeout.filter(|&ms| ms > 0) { notification = notification.timeout(Duration::from_millis(ms.into())); @@ -139,16 +126,6 @@ mod platform { notification } - impl From for InterruptionLevel { - fn from(urgency: NotifyUrgency) -> Self { - match urgency { - NotifyUrgency::Low => InterruptionLevel::Passive, - NotifyUrgency::Normal => InterruptionLevel::Active, - NotifyUrgency::Critical => InterruptionLevel::TimeSensitive, - } - } - } - impl From for NotifyResponse { fn from(response: NotificationResponse) -> Self { if response.is_reply() { @@ -170,10 +147,10 @@ mod platform { #[cfg(not(target_os = "macos"))] mod platform { - use notify_rust::{Notification, NotificationResponse, Timeout, Urgency}; + use notify_rust::{Notification, NotificationResponse, Timeout}; use tauri::AppHandle; - use super::{NotifyOptions, NotifyResponse, NotifyUrgency, REPLY_ACTION, REPLY_LABEL}; + use super::{NotifyOptions, NotifyResponse, REPLY_ACTION, REPLY_LABEL}; #[cfg(unix)] pub async fn show(_app: &AppHandle, options: &NotifyOptions) -> anyhow::Result { @@ -230,10 +207,6 @@ mod platform { notification.subtitle(subtitle); } - if let Some(urgency) = options.urgency { - notification.urgency(urgency.into()); - } - if let Some(timeout) = options.timeout { notification.timeout(match timeout { 0 => Timeout::Never, @@ -257,16 +230,6 @@ mod platform { notification } - impl From for Urgency { - fn from(urgency: NotifyUrgency) -> Self { - match urgency { - NotifyUrgency::Low => Urgency::Low, - NotifyUrgency::Normal => Urgency::Normal, - NotifyUrgency::Critical => Urgency::Critical, - } - } - } - impl From for NotifyResponse { fn from(response: NotificationResponse) -> Self { match response { diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts index 3e149e04..9d83cea1 100644 --- a/src/lib/notifications.ts +++ b/src/lib/notifications.ts @@ -16,8 +16,6 @@ export interface NotificationAction { label: string; } -export type NotificationUrgency = "low" | "normal" | "critical"; - export interface NotificationOptions { title: string; @@ -32,7 +30,6 @@ export interface NotificationOptions { * Placeholder of an inline reply field. */ reply?: string; - urgency?: NotificationUrgency; /** * How long the notification stays up in milliseconds, `0` keeps it until From eb8b417ed0122c53be4c1dc787796bdc9bf92a81 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Thu, 19 Nov 2026 16:43:50 -0500 Subject: [PATCH 06/13] update titles --- src/lib/notifications.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts index 9d83cea1..62fa9ff6 100644 --- a/src/lib/notifications.ts +++ b/src/lib/notifications.ts @@ -60,7 +60,6 @@ export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { const response = await app.notify({ title: sender.displayName, - subtitle: "Whisper", body: message.text, actions: [{ id: "view", label: "View" }], reply: `Reply to ${sender.displayName}`, @@ -93,8 +92,7 @@ export async function notifyMention(message: UserMessage) { if (document.hasFocus() && app.focused === channel) return; const response = await app.notify({ - title: author.displayName, - subtitle: `Mentioned you in ${channel.user.displayName}`, + title: `${author.displayName} (in @${channel.user.displayName})`, body: message.text, reply: `Reply to ${author.displayName}`, }); From 8bd18759711c485c2242adf386c6af1a7bdb0aa4 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Thu, 19 Nov 2026 17:13:43 -0500 Subject: [PATCH 07/13] escape markdown in body --- src-tauri/src/notify.rs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/notify.rs b/src-tauri/src/notify.rs index 58283c03..7ec3735e 100644 --- a/src-tauri/src/notify.rs +++ b/src-tauri/src/notify.rs @@ -201,7 +201,14 @@ mod platform { fn build(options: &NotifyOptions) -> Notification { let mut notification = Notification::new(); - notification.summary(&options.title).body(&options.body); + // XDG servers may parse the body as markup. + #[cfg(unix)] + let body = &escape_markup(&options.body); + + #[cfg(windows)] + let body = options.body.as_str(); + + notification.summary(&options.title).body(body); if let Some(subtitle) = &options.subtitle { notification.subtitle(subtitle); @@ -230,6 +237,22 @@ mod platform { notification } + #[cfg(unix)] + fn escape_markup(text: &str) -> String { + let mut escaped = String::with_capacity(text.len()); + + for ch in text.chars() { + match ch { + '&' => escaped.push_str("&"), + '<' => escaped.push_str("<"), + '>' => escaped.push_str(">"), + _ => escaped.push(ch), + } + } + + escaped + } + impl From for NotifyResponse { fn from(response: NotificationResponse) -> Self { match response { From cbb77d071186b2f25eeddd51d3c3f5ec9fce3c46 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Thu, 19 Nov 2026 17:16:19 -0500 Subject: [PATCH 08/13] differentiate send status and errors --- src/lib/models/chat.svelte.ts | 14 ++++++++------ src/lib/notifications.ts | 6 +++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/lib/models/chat.svelte.ts b/src/lib/models/chat.svelte.ts index a4b6af19..90d286f7 100644 --- a/src/lib/models/chat.svelte.ts +++ b/src/lib/models/chat.svelte.ts @@ -304,19 +304,19 @@ export class Chat { }); } - public async send(text: string, options?: SendOptions) { + public async send(text: string, options?: SendOptions): Promise { if (options?.pin) { await this.#sendPinned(text); - return; + return true; } if (text.startsWith("/") && !options?.raw) { await execute(this.channel, text.slice(1)); - return; + return true; } try { - await this.#sendText(text, options?.replyTo); + return await this.#sendText(text, options?.replyTo); } catch (error) { log.error(`Failed to send message in ${this.channel.user.username}`, error); throw new CommandError("Your message could not be sent."); @@ -337,7 +337,7 @@ export class Chat { async #sendText(message: string, replyTo?: UserMessage) { const text = this.#prepare(message); - if (text === null) return; + if (text === null) return false; let replyId = replyTo?.id; @@ -369,13 +369,15 @@ export class Chat { this.notice(`Your message was not sent: ${reason}`); } - return; + return false; } if (sent?.message) { log.info("Message sent"); void app.user?.sendPresence(this.channel.id); } + + return !!sent?.message; } #prepare(message: string) { diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts index 62fa9ff6..f9f8de59 100644 --- a/src/lib/notifications.ts +++ b/src/lib/notifications.ts @@ -98,11 +98,15 @@ export async function notifyMention(message: UserMessage) { }); if (response?.type === "reply" && response.text) { + let sent = false; + try { - await channel.chat.send(response.text, { replyTo: message }); + sent = await channel.chat.send(response.text, { replyTo: message }); } catch (error) { log.error("Failed to send mention reply", error); + } + if (!sent) { void app.notify({ title: "Reply not sent", body: `Your reply in ${channel.user.displayName} could not be sent.`, From dc7f0f987da917de18322a90543975b66008ddf2 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Thu, 19 Nov 2026 17:17:42 -0500 Subject: [PATCH 09/13] seperate whisper errors --- src/lib/models/whisper.svelte.ts | 6 +++++- src/lib/notifications.ts | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/lib/models/whisper.svelte.ts b/src/lib/models/whisper.svelte.ts index 63e806e0..2d6a5f50 100644 --- a/src/lib/models/whisper.svelte.ts +++ b/src/lib/models/whisper.svelte.ts @@ -177,13 +177,17 @@ export class Whisper { public async send(message: string) { if (!message) return; - await this.client.gql(sendWhisperMutation, { + const { sendWhisper } = await this.client.gql(sendWhisperMutation, { input: { message, recipientUserID: this.sender.id, nonce: crypto.randomUUID(), }, }); + + if (sendWhisper?.error) { + throw new Error(`Whisper not sent: ${sendWhisper.error.code}`); + } } async #loadHistory(buffered: WhisperMessage[]) { diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts index f9f8de59..3a764278 100644 --- a/src/lib/notifications.ts +++ b/src/lib/notifications.ts @@ -68,7 +68,6 @@ export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { if (response?.type === "reply" && response.text) { try { await whisper.send(response.text); - await whisper.markRead(); } catch (error) { log.error("Failed to send whisper reply", error); @@ -76,8 +75,11 @@ export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { title: "Whisper not sent", body: `Your reply to ${sender.displayName} could not be sent.`, }); + + return; } + await whisper.markRead().catch(log.swallow("Failed to mark whisper as read")); return; } @@ -89,7 +91,11 @@ export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { export async function notifyMention(message: UserMessage) { const { channel, author } = message; - if (document.hasFocus() && app.focused === channel) return; + // The split view keeps its focused channel on other pages, where the chat + // isn't visible. + const viewing = document.hasFocus() && page.route.id === "/(main)" && app.focused === channel; + + if (viewing) return; const response = await app.notify({ title: `${author.displayName} (in @${channel.user.displayName})`, From 70f41b747221d097aa1c120685db3db1855f69ee Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Sat, 28 Nov 2026 16:38:17 -0500 Subject: [PATCH 10/13] manage notification listeners --- src-tauri/src/lib.rs | 1 + src-tauri/src/notify/listeners.rs | 249 +++++++++++++++++++++ src-tauri/src/{notify.rs => notify/mod.rs} | 32 ++- src/lib/notifications.ts | 3 + 4 files changed, 281 insertions(+), 4 deletions(-) create mode 100644 src-tauri/src/notify/listeners.rs rename src-tauri/src/{notify.rs => notify/mod.rs} (90%) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 1b7bb74f..bfb15be7 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -115,6 +115,7 @@ pub fn run() { } app.manage(Cache::open(&cache_dir.join("cache.db"))); + app.manage(notify::Listeners::default()); let http = reqwest::Client::builder().timeout(HTTP_TIMEOUT).build()?; let mut state = AppState::new(http); diff --git a/src-tauri/src/notify/listeners.rs b/src-tauri/src/notify/listeners.rs new file mode 100644 index 00000000..4ea9cfee --- /dev/null +++ b/src-tauri/src/notify/listeners.rs @@ -0,0 +1,249 @@ +use std::collections::HashMap; +use std::future::Future; +use std::sync::Mutex; +use std::time::Duration; + +use futures::future::{AbortHandle, Abortable}; + +/// How long a listener waits for a response before it gives up. A response +/// that arrives later is ignored. +const DEFAULT_TTL: Duration = Duration::from_secs(15 * 60); + +/// How many listeners may wait at once. Registering another one aborts the +/// oldest. +const DEFAULT_MAX_ACTIVE: usize = 25; + +#[derive(Debug)] +pub struct Listeners { + ttl: Duration, + max_active: usize, + state: Mutex, +} + +#[derive(Debug, Default)] +struct State { + next_seq: u64, + active: HashMap, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +enum Key { + /// Supplied by the caller, so a later notification with the same id + /// replaces this one. + Named(String), + /// Never collides with another listener. + Anonymous(u64), +} + +#[derive(Debug)] +struct Listener { + /// Orders listeners by registration, so the oldest is evicted first. + seq: u64, + abort: AbortHandle, +} + +impl Listeners { + pub fn new(ttl: Duration, max_active: usize) -> Self { + assert!(max_active > 0, "max_active must be at least 1"); + + Self { + ttl, + max_active, + state: Mutex::default(), + } + } + + /// Awaits `future` as a tracked listener. Resolves to `None` if the + /// listener expires, is replaced by a listener with the same `id`, or is + /// evicted to stay within the limit. + /// + /// The previous listener with the same `id` is aborted before `future` + /// is first polled. + pub async fn track(&self, id: Option, future: F) -> Option { + let (abort, registration) = AbortHandle::new_pair(); + let entry = self.register(id, abort); + + match tokio::time::timeout(self.ttl, Abortable::new(future, registration)).await { + Ok(Ok(output)) => Some(output), + Ok(Err(_aborted)) => None, + Err(_elapsed) => { + tracing::debug!(key = ?entry.key, "Notification listener expired"); + None + } + } + } + + fn register(&self, id: Option, abort: AbortHandle) -> Entry<'_> { + let mut state = self.state.lock().expect("lock poisoned"); + + let seq = state.next_seq; + state.next_seq += 1; + + let key = id.map_or(Key::Anonymous(seq), Key::Named); + + if let Some(previous) = state.active.remove(&key) { + tracing::debug!(?key, "Notification listener replaced"); + previous.abort.abort(); + } + + while state.active.len() >= self.max_active { + let oldest = state + .active + .iter() + .min_by_key(|(_, listener)| listener.seq) + .map(|(key, _)| key.clone()) + .expect("active is non-empty while at the limit"); + + if let Some(evicted) = state.active.remove(&oldest) { + tracing::debug!(key = ?oldest, "Notification listener evicted"); + evicted.abort.abort(); + } + } + + state.active.insert(key.clone(), Listener { seq, abort }); + + Entry { + listeners: self, + key, + seq, + } + } + + #[cfg(test)] + fn active(&self) -> usize { + self.state.lock().expect("lock poisoned").active.len() + } +} + +impl Default for Listeners { + fn default() -> Self { + Self::new(DEFAULT_TTL, DEFAULT_MAX_ACTIVE) + } +} + +/// Removes a listener from the map once its future ends or is dropped. +struct Entry<'a> { + listeners: &'a Listeners, + key: Key, + seq: u64, +} + +impl Drop for Entry<'_> { + fn drop(&mut self) { + let Ok(mut state) = self.listeners.state.lock() else { + return; + }; + + // A replacement registers under the same key before this entry drops, + // so only remove the listener this entry registered. + if state + .active + .get(&self.key) + .is_some_and(|listener| listener.seq == self.seq) + { + state.active.remove(&self.key); + } + } +} + +#[cfg(test)] +mod tests { + use std::future; + use std::sync::Arc; + + use super::*; + + const LONG: Duration = Duration::from_secs(60); + + async fn settle() { + tokio::time::sleep(Duration::from_millis(10)).await; + } + + #[tokio::test] + async fn returns_output_and_untracks() { + let listeners = Listeners::new(LONG, 4); + let output = listeners.track(Some("a".into()), async { 1 }).await; + + assert_eq!(output, Some(1)); + assert_eq!(listeners.active(), 0); + } + + #[tokio::test] + async fn expires_after_ttl() { + let listeners = Listeners::new(Duration::from_millis(20), 4); + let output = listeners.track(None, future::pending::<()>()).await; + + assert_eq!(output, None); + assert_eq!(listeners.active(), 0); + } + + #[tokio::test] + async fn same_id_replaces_previous() { + let listeners = Arc::new(Listeners::new(LONG, 4)); + + let first = tokio::spawn({ + let listeners = Arc::clone(&listeners); + async move { + listeners + .track(Some("a".into()), future::pending::<()>()) + .await + } + }); + + settle().await; + + let second = tokio::spawn({ + let listeners = Arc::clone(&listeners); + async move { + listeners + .track(Some("a".into()), future::pending::<()>()) + .await + } + }); + + assert_eq!(first.await.expect("task panicked"), None); + + settle().await; + assert_eq!(listeners.active(), 1, "the replacement stays tracked"); + + second.abort(); + } + + #[tokio::test] + async fn evicts_oldest_at_limit() { + let listeners = Arc::new(Listeners::new(LONG, 2)); + let mut tasks = Vec::new(); + + for _ in 0..3 { + let listeners = Arc::clone(&listeners); + + tasks.push(tokio::spawn(async move { + listeners.track(None, future::pending::<()>()).await + })); + + settle().await; + } + + let oldest = tasks.remove(0); + + assert_eq!(oldest.await.expect("task panicked"), None); + assert_eq!(listeners.active(), 2); + + for task in tasks { + assert!(!task.is_finished(), "newer listeners keep waiting"); + task.abort(); + } + } + + #[tokio::test] + async fn dropped_future_untracks() { + let listeners = Listeners::new(LONG, 4); + + { + let tracked = listeners.track(None, future::pending::<()>()); + let _ = tokio::time::timeout(Duration::from_millis(10), tracked).await; + } + + assert_eq!(listeners.active(), 0); + } +} diff --git a/src-tauri/src/notify.rs b/src-tauri/src/notify/mod.rs similarity index 90% rename from src-tauri/src/notify.rs rename to src-tauri/src/notify/mod.rs index 7ec3735e..3ed1091a 100644 --- a/src-tauri/src/notify.rs +++ b/src-tauri/src/notify/mod.rs @@ -1,9 +1,12 @@ use serde::{Deserialize, Serialize}; -use tauri::{AppHandle, Manager}; +use tauri::{AppHandle, Manager, State}; +pub use self::listeners::Listeners; use crate::MAIN_WINDOW_LABEL; use crate::error::Error; +mod listeners; + const REPLY_ACTION: &str = "__reply"; const REPLY_LABEL: &str = "Reply"; @@ -16,6 +19,9 @@ pub struct NotifyAction { #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct NotifyOptions { + /// Showing another notification with the same id stops listening for + /// responses to this one. + id: Option, title: String, subtitle: Option, #[serde(default)] @@ -53,8 +59,20 @@ impl NotifyResponse { #[tauri::command] #[tracing::instrument(skip_all, fields(title = %options.title))] -pub async fn notify(app: AppHandle, options: NotifyOptions) -> Result { - let response = platform::show(&app, &options).await?; +pub async fn notify( + app: AppHandle, + listeners: State<'_, Listeners>, + options: NotifyOptions, +) -> Result { + let shown = platform::show(&app, &options); + + let Some(response) = listeners + .track(options.id.clone(), shown) + .await + .transpose()? + else { + return Ok(NotifyResponse::Closed); + }; if response.activates() { focus_main_window(&app); @@ -82,7 +100,7 @@ fn focus_main_window(app: &AppHandle) { mod platform { use std::time::Duration; - use mac_usernotifications::{Action, InterruptionLevel, Notification, NotificationResponse}; + use mac_usernotifications::{Action, Notification, NotificationResponse}; use tauri::AppHandle; use super::{NotifyOptions, NotifyResponse, REPLY_ACTION, REPLY_LABEL}; @@ -105,6 +123,12 @@ mod platform { .message(&options.body) .maybe_subtitle(options.subtitle.as_deref()); + // Reusing an identifier replaces the delivered notification, which + // matches the listener for it being replaced. + if let Some(id) = &options.id { + notification = notification.id(id); + } + // Without a timeout the notification stays in Notification Center. if let Some(ms) = options.timeout.filter(|&ms| ms > 0) { notification = notification.timeout(Duration::from_millis(ms.into())); diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts index 3a764278..8e762e4f 100644 --- a/src/lib/notifications.ts +++ b/src/lib/notifications.ts @@ -17,6 +17,7 @@ export interface NotificationAction { } export interface NotificationOptions { + id?: string; title: string; /** @@ -59,6 +60,7 @@ export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { if (viewing) return; const response = await app.notify({ + id: `whisper:${sender.id}`, title: sender.displayName, body: message.text, actions: [{ id: "view", label: "View" }], @@ -98,6 +100,7 @@ export async function notifyMention(message: UserMessage) { if (viewing) return; const response = await app.notify({ + id: `mention:${channel.id}`, title: `${author.displayName} (in @${channel.user.displayName})`, body: message.text, reply: `Reply to ${author.displayName}`, From 3f4b8bc66b96d4f95d10531945d4fc9973677113 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Fri, 4 Dec 2026 18:56:57 -0500 Subject: [PATCH 11/13] add settings --- .../schema/categories/notifications.ts | 46 +++++++++++++++++++ src/lib/icons.ts | 1 + src/lib/notifications.ts | 9 +++- src/lib/settings.ts | 7 +++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/lib/components/settings/schema/categories/notifications.ts diff --git a/src/lib/components/settings/schema/categories/notifications.ts b/src/lib/components/settings/schema/categories/notifications.ts new file mode 100644 index 00000000..3098a56f --- /dev/null +++ b/src/lib/components/settings/schema/categories/notifications.ts @@ -0,0 +1,46 @@ +import { IconNotifications } from "#lib/icons.js"; + +import type { SettingsCategory } from "../types"; + +export default { + order: 35, + label: "Notifications", + icon: IconNotifications, + fields: [ + { + type: "group", + fields: [ + { + id: "notifications.mentions", + type: "switch", + label: "Mentions", + description: + "Send a notification when someone mentions you in a joined channel you aren't viewing.", + keywords: ["ping", "alert"], + }, + { + id: "notifications.whispers", + type: "switch", + label: "Whispers", + description: + "Send a notification when you receive a whisper in a thread you aren't viewing.", + keywords: ["dm", "direct message", "alert"], + }, + ], + }, + { + type: "group", + label: "Privacy", + fields: [ + { + id: "notifications.preview", + type: "switch", + label: "Show message content", + description: + "Include the message in notifications. When disabled, only who sent it is shown.", + keywords: ["preview", "body", "hide"], + }, + ], + }, + ], +} satisfies SettingsCategory; diff --git a/src/lib/icons.ts b/src/lib/icons.ts index ba13668f..9d647b6a 100644 --- a/src/lib/icons.ts +++ b/src/lib/icons.ts @@ -47,6 +47,7 @@ export { default as IconChat } from "~icons/hugeicons/bubble-chat"; export { default as IconClearCache } from "~icons/hugeicons/clean"; export { default as IconHighlights } from "~icons/hugeicons/highlighter"; export { default as IconModeration } from "~icons/hugeicons/shield-01"; +export { default as IconNotifications } from "~icons/hugeicons/notification-01"; export { default as IconSplits } from "~icons/hugeicons/layout-01"; // Splits and tabs diff --git a/src/lib/notifications.ts b/src/lib/notifications.ts index 8e762e4f..dd9b9e3b 100644 --- a/src/lib/notifications.ts +++ b/src/lib/notifications.ts @@ -7,6 +7,7 @@ import type { Whisper, WhisperMessage } from "./models/whisper.svelte"; import { app } from "./app.svelte"; import { log } from "./log"; +import { settings } from "./settings"; export interface NotificationAction { /** @@ -50,6 +51,8 @@ export type NotificationResponse = | { type: "closed" }; export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { + if (!settings.state["notifications.whispers"]) return; + const { sender } = whisper; const viewing = @@ -62,7 +65,7 @@ export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { const response = await app.notify({ id: `whisper:${sender.id}`, title: sender.displayName, - body: message.text, + body: settings.state["notifications.preview"] ? message.text : "Sent you a whisper", actions: [{ id: "view", label: "View" }], reply: `Reply to ${sender.displayName}`, }); @@ -91,6 +94,8 @@ export async function notifyWhisper(whisper: Whisper, message: WhisperMessage) { } export async function notifyMention(message: UserMessage) { + if (!settings.state["notifications.mentions"]) return; + const { channel, author } = message; // The split view keeps its focused channel on other pages, where the chat @@ -102,7 +107,7 @@ export async function notifyMention(message: UserMessage) { const response = await app.notify({ id: `mention:${channel.id}`, title: `${author.displayName} (in @${channel.user.displayName})`, - body: message.text, + body: settings.state["notifications.preview"] ? message.text : "Mentioned you", reply: `Reply to ${author.displayName}`, }); diff --git a/src/lib/settings.ts b/src/lib/settings.ts index 5d5a18b5..d99785e5 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -41,6 +41,10 @@ export type Settings = { "highlights.viewers": Record; "highlights.keywords": KeywordHighlightConfig[]; + "notifications.mentions": boolean; + "notifications.whispers": boolean; + "notifications.preview": boolean; + "moderation.timeout.duration": string; "moderation.quickActions.show": boolean; "moderation.deleted.appearance": DeletedAppearance; @@ -77,6 +81,9 @@ const defaults: Settings = { "highlights.enabled": true, "highlights.viewers": defaultHighlights(), "highlights.keywords": [], + "notifications.mentions": true, + "notifications.whispers": true, + "notifications.preview": true, "moderation.timeout.duration": "10m", "moderation.quickActions.show": true, "moderation.deleted.appearance": "dim", From 5d7509c0ea935a5048d8ecf7b5820a69e82af1f0 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Fri, 4 Dec 2026 19:06:44 -0500 Subject: [PATCH 12/13] use from_mins --- src-tauri/src/notify/listeners.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/src/notify/listeners.rs b/src-tauri/src/notify/listeners.rs index 4ea9cfee..fef7dfed 100644 --- a/src-tauri/src/notify/listeners.rs +++ b/src-tauri/src/notify/listeners.rs @@ -7,7 +7,7 @@ use futures::future::{AbortHandle, Abortable}; /// How long a listener waits for a response before it gives up. A response /// that arrives later is ignored. -const DEFAULT_TTL: Duration = Duration::from_secs(15 * 60); +const DEFAULT_TTL: Duration = Duration::from_mins(15); /// How many listeners may wait at once. Registering another one aborts the /// oldest. From af16dbdbb28030f882b337a7c2b86c8d7f862938 Mon Sep 17 00:00:00 2001 From: Oliver Rose Date: Fri, 4 Dec 2026 19:13:13 -0500 Subject: [PATCH 13/13] use nonzerousize --- src-tauri/src/notify/listeners.rs | 39 +++++++++++++++++-------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src-tauri/src/notify/listeners.rs b/src-tauri/src/notify/listeners.rs index fef7dfed..6748c131 100644 --- a/src-tauri/src/notify/listeners.rs +++ b/src-tauri/src/notify/listeners.rs @@ -1,5 +1,6 @@ use std::collections::HashMap; use std::future::Future; +use std::num::NonZeroUsize; use std::sync::Mutex; use std::time::Duration; @@ -11,12 +12,12 @@ const DEFAULT_TTL: Duration = Duration::from_mins(15); /// How many listeners may wait at once. Registering another one aborts the /// oldest. -const DEFAULT_MAX_ACTIVE: usize = 25; +const DEFAULT_MAX_ACTIVE: NonZeroUsize = NonZeroUsize::new(25).unwrap(); #[derive(Debug)] pub struct Listeners { ttl: Duration, - max_active: usize, + max_active: NonZeroUsize, state: Mutex, } @@ -43,9 +44,7 @@ struct Listener { } impl Listeners { - pub fn new(ttl: Duration, max_active: usize) -> Self { - assert!(max_active > 0, "max_active must be at least 1"); - + pub fn new(ttl: Duration, max_active: NonZeroUsize) -> Self { Self { ttl, max_active, @@ -86,18 +85,18 @@ impl Listeners { previous.abort.abort(); } - while state.active.len() >= self.max_active { - let oldest = state + // Every insert happens here after making room, so evicting one is + // enough to stay within the limit. + if state.active.len() >= self.max_active.get() + && let Some(oldest) = state .active .iter() .min_by_key(|(_, listener)| listener.seq) .map(|(key, _)| key.clone()) - .expect("active is non-empty while at the limit"); - - if let Some(evicted) = state.active.remove(&oldest) { - tracing::debug!(key = ?oldest, "Notification listener evicted"); - evicted.abort.abort(); - } + && let Some(evicted) = state.active.remove(&oldest) + { + tracing::debug!(key = ?oldest, "Notification listener evicted"); + evicted.abort.abort(); } state.active.insert(key.clone(), Listener { seq, abort }); @@ -155,13 +154,17 @@ mod tests { const LONG: Duration = Duration::from_secs(60); + fn max(n: usize) -> NonZeroUsize { + NonZeroUsize::new(n).expect("limit is non-zero") + } + async fn settle() { tokio::time::sleep(Duration::from_millis(10)).await; } #[tokio::test] async fn returns_output_and_untracks() { - let listeners = Listeners::new(LONG, 4); + let listeners = Listeners::new(LONG, max(4)); let output = listeners.track(Some("a".into()), async { 1 }).await; assert_eq!(output, Some(1)); @@ -170,7 +173,7 @@ mod tests { #[tokio::test] async fn expires_after_ttl() { - let listeners = Listeners::new(Duration::from_millis(20), 4); + let listeners = Listeners::new(Duration::from_millis(20), max(4)); let output = listeners.track(None, future::pending::<()>()).await; assert_eq!(output, None); @@ -179,7 +182,7 @@ mod tests { #[tokio::test] async fn same_id_replaces_previous() { - let listeners = Arc::new(Listeners::new(LONG, 4)); + let listeners = Arc::new(Listeners::new(LONG, max(4))); let first = tokio::spawn({ let listeners = Arc::clone(&listeners); @@ -211,7 +214,7 @@ mod tests { #[tokio::test] async fn evicts_oldest_at_limit() { - let listeners = Arc::new(Listeners::new(LONG, 2)); + let listeners = Arc::new(Listeners::new(LONG, max(2))); let mut tasks = Vec::new(); for _ in 0..3 { @@ -237,7 +240,7 @@ mod tests { #[tokio::test] async fn dropped_future_untracks() { - let listeners = Listeners::new(LONG, 4); + let listeners = Listeners::new(LONG, max(4)); { let tracked = listeners.track(None, future::pending::<()>());