Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
692f9df
refactor: 抽取采样与计算核心服务并补充单元测试
Starsky16 Sep 14, 2026
9020606
refactor: 组件改用共享采样服务并精简组件设置
Starsky16 Sep 14, 2026
4efa976
feat: 新增分贝阈值提醒(通知提供方 + 渠道 + 组件提示)
Starsky16 Sep 14, 2026
b9dbc92
feat: 新增插件设置页并将校准上收为全局设置
Starsky16 Sep 14, 2026
9813e0c
ci: 新增集成测试工作流并调整构建/测试工作流
Starsky16 Sep 14, 2026
737592e
chore: 忽略 cipx/ 打包产物并移除 0 字节占位文件(与 dev 对齐)
Starsky16 Sep 17, 2026
5a6e0ab
fix: 组件定时器改随视觉树启停并移除 IDisposable,修复组件重建后无法回收的内存泄漏
Starsky16 Sep 17, 2026
9dc0277
feat: 接入 KeyboardCapture 键盘事件契约包
Starsky16 Sep 19, 2026
e660196
refactor: Services 按测量/提醒职责拆分目录与命名空间
Starsky16 Sep 19, 2026
2752de1
feat: 新增平均音量判定与判定源框架及单测
Starsky16 Sep 19, 2026
c359732
feat: 新增热键筛选窗口与提醒运行时编排服务
Starsky16 Sep 19, 2026
f513235
feat: 新增判定源设置页与组件筛选窗口指示
Starsky16 Sep 19, 2026
582e09b
feat: 分贝组件改用单一提醒状态点并补全判定源设置项
Starsky16 Sep 20, 2026
3e96eb0
feat: 热键筛选窗口开启时组件状态点改为红绿闪动
Starsky16 Sep 20, 2026
4c263c9
feat: 新增提醒状态点合并与滞回纯逻辑解析器及单测
Starsky16 Sep 26, 2026
7f4b3a9
feat: 提醒运行时接入状态点解析器并按设备可用性判定无采样
Starsky16 Sep 26, 2026
75d0a38
feat: 提醒状态点改用形状与呼吸表达,数字颜色随判据变化
Starsky16 Sep 26, 2026
b4ca1eb
docs: 更新状态点形状对照表与相关文案
Starsky16 Sep 26, 2026
4666b63
docs: 修正 README 与注释中已失效的设置项与配置位置
Starsky16 Sep 26, 2026
086daea
fix: 冷却期内判定源不再计入正在超阈值,状态点保持空心方
Starsky16 Sep 26, 2026
0b48d50
feat: 新增时段闸门,课间与上课初期抑制提醒
Starsky16 Sep 26, 2026
f2aca05
fix: 组件状态点改为自持最近一次应用值比对,修复脉冲漏读导致形状冻结
Starsky16 Sep 27, 2026
aae301a
fix: 修复热键确认被超时丢弃,超时改进入冷却并作废闸门遗留窗口
Starsky16 Sep 27, 2026
94289f0
feat: 提醒正文时长改为在通知提供方配置,冷却时长下限提升至 60 秒
Starsky16 Sep 27, 2026
367159e
refactor: 删除已无读取方的 IndicatorStateChanged 及其失效注释
Starsky16 Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ on:
push:
workflow_dispatch:
pull_request:
types: [closed]


jobs:
build_app:
runs-on: windows-latest
name: Build
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
Expand All @@ -26,23 +25,26 @@ jobs:
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Build
run: pwsh -ep bypass ./tools/publish.ps1

- name: Test
run: dotnet test Tests/Decibel_Monitor.Tests/Decibel_Monitor.Tests.csproj -c Release

- name: Md5Checksum
run: pwsh -ep bypass ./tools/generate-md5.ps1 cipx/

- name: Upload APP to release
uses: ncipollo/release-action@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
artifacts: "./cipx/*.cipx"
draft: true
generateReleaseNotes: true
body: ./cipx/checksums.md
bodyFile: ./cipx/checksums.md
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/IntegrationTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Integration Test

# 集成冒烟测试:用官方 Release 版 ClassIsland 启动并加载本插件,
# 验证插件入口 Initialize 能完整执行(注册组件/提醒提供方无异常)。
# 运行时功能(麦克风采样、UI 交互)在无头 CI 环境中无法验证。

on:
push:
workflow_dispatch:

jobs:
integration-test:
runs-on: windows-latest
name: Launch in ClassIsland
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Publish plugin
shell: pwsh
run: dotnet publish Decibel_Monitor.csproj -c Release -o "$env:RUNNER_TEMP\plugin"

- name: Download & extract ClassIsland (official release 2.1.0.1)
shell: pwsh
run: |
$zip = Join-Path $env:RUNNER_TEMP "classisland.zip"
$dest = Join-Path $env:RUNNER_TEMP "classisland"
Invoke-WebRequest -Uri "https://github.com/ClassIsland/ClassIsland/releases/download/2.1.0.1/ClassIsland_app_windows_x64_full_folder.zip" -OutFile $zip
Expand-Archive -Path $zip -DestinationPath $dest -Force
$exe = Get-ChildItem -Path $dest -Recurse -Filter "ClassIsland.Desktop.exe" | Select-Object -First 1
if (-not $exe) { throw "未在解压目录中找到 ClassIsland.Desktop.exe" }
Write-Host "ClassIsland.Desktop.exe: $($exe.FullName)"
Add-Content -Path $env:GITHUB_ENV -Value "CI_CLASSISLAND_EXE=$($exe.FullName)"

- name: Launch ClassIsland with plugin & verify load marker
shell: pwsh
env:
DECIBEL_MONITOR_CI_MARKER: "1"
run: |
$exe = $env:CI_CLASSISLAND_EXE
$exeDir = Split-Path $exe
# folder 打包:AppPackageRoot = exeDir/.., AppRoot = AppPackageRoot/data,
# 插件配置目录 = AppRoot/Config/Plugins/<manifest.id>
$appRoot = (Resolve-Path (Join-Path $exeDir "..")).Path
$marker = Join-Path $appRoot "data\Config\Plugins\Decibel_Monitor\loaded.marker"
$pluginDir = Join-Path $env:RUNNER_TEMP "plugin"
Write-Host "插件目录: $pluginDir"
Write-Host "期望标记文件: $marker"

$proc = Start-Process -FilePath $exe -ArgumentList @("-epp", $pluginDir, "--skip-oobe", "--quiet") -PassThru -WindowStyle Hidden
try {
$deadline = (Get-Date).AddSeconds(150)
$found = $false
while ((Get-Date) -lt $deadline) {
if (Test-Path $marker) { $found = $true; break }
if ($proc.HasExited) {
Write-Host "ClassIsland 进程已退出, ExitCode=$($proc.ExitCode)"
break
}
Start-Sleep -Seconds 5
}
if (-not $found) {
Write-Host "ClassIsland 进程是否存活: $(-not $proc.HasExited)"
Write-Host "AppRoot 下内容:"
if (Test-Path $appRoot) { Get-ChildItem $appRoot -Recurse -Depth 3 | Select-Object -ExpandProperty FullName | Out-String | Write-Host }
throw "插件未能在 ClassIsland 中成功加载(标记文件不存在: $marker)"
}
Write-Host "✅ 插件加载成功,标记文件: $marker"
Get-Content $marker
} finally {
if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue }
}
34 changes: 8 additions & 26 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ on:
push:
workflow_dispatch:
pull_request:
types: [closed]


jobs:
build_app:
test:
runs-on: windows-latest
name: Build
name: Test
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
Expand All @@ -26,26 +25,9 @@ jobs:
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Build
run: pwsh -ep bypass ./tools/publish.ps1

- name: Checksum
run: pwsh -ep bypass ./tools/generate-md5.ps1 cipx/
- name: Build main project
run: dotnet build Decibel_Monitor.csproj -c Release

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: |
./cipx/*.cipx
./cipx/checksums.md
name: Decibel_Monitor-Actions

- name: Upload APP to release
uses: ncipollo/release-action@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
artifacts: "./cipx/*.cipx"
draft: true
bodyFile: ./cipx/checksums.md
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run unit tests
run: dotnet test Tests/Decibel_Monitor.Tests/Decibel_Monitor.Tests.csproj -c Release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ x86/
bld/
[Bb]in/
[Oo]bj/
# ClassIsland 插件打包产物
cipx/
[Oo]ut/
[Ll]og/
[Ll]ogs/
Expand Down
Loading