Skip to content

Commit 4eba4e7

Browse files
authored
Feat/munet UI (#39)
* init * 关于界面 * 更多 MuNET UI * 更多输入组件 * feat(mcm): add cst scrollbar class, virtua dependency, and migration plan * feat: Wave 2 partial - migrate ModManager, MusicEdit, MusicList, Sidebar to @munet/ui - ModManager: all components migrated (ConfigEntry, ConfigEditor, AquaMaiConfigurator, sectionPanelOverrides) - MusicEdit: AudioPreviewEditor, AcbAwb, SetMovieButton, index migrated - MusicList: BatchActionButton, MusicEntry, ConflictDisplay, index migrated - Sidebar: new component created - Fix TS errors: addToast signature, NumberInput props, duplicate imports, moduleResolution bundler * Wave 2+3: complete naive-ui migration, fix syntax errors, remove Providers from App.tsx * fix * ignore sisyphus * fix: 弹窗移动到独立页面 * refactor: 目录结构 * sidebar label * 样式优化 * 样式和 i18n * 恢复难度面板,工具转换成页面 * bump packages * 全局化 mod 配置 * 修改谱面管理布局 * 重构 opt 管理界面 * feat: splash * versionInput 显示效果修改 * 独立窗口预览谱面 * copyToButton fix * opt 管理 dropdown * 选择提示 * 各种按钮修复 * 动画 * padding fix * 谱面管理页修的差不多了 * mod 界面修
2 parents dd39d7c + 0f8963f commit 4eba4e7

155 files changed

Lines changed: 5825 additions & 4922 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ riderModule.iml
99
/MaiChartManager/Resources/AquaMai.dll
1010
node_modules
1111
nul
12+
.sisyphus

.vscode/tasks.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Backend",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": ["run", "--project", "${workspaceFolder}/MaiChartManager"],
9+
"isBackground": true,
10+
"problemMatcher": {
11+
"base": "$msCompile",
12+
"background": {
13+
"activeOnStart": true,
14+
"beginsPattern": ".",
15+
"endsPattern": "."
16+
}
17+
},
18+
"runOptions": { "reevaluateOnRerun": true },
19+
"presentation": { "reveal": "always", "panel": "dedicated" },
20+
"icon": { "id": "server-process" }
21+
},
22+
{
23+
"label": "Dev Server",
24+
"type": "shell",
25+
"command": "pnpm dev",
26+
"options": { "cwd": "${workspaceFolder}/MaiChartManager/Front" },
27+
"isBackground": true,
28+
"problemMatcher": [],
29+
"presentation": { "reveal": "always", "panel": "dedicated" },
30+
"icon": { "id": "play" }
31+
},
32+
{
33+
"label": "Gen Client",
34+
"type": "shell",
35+
"command": "pnpm genClient",
36+
"options": { "cwd": "${workspaceFolder}/MaiChartManager/Front" },
37+
"problemMatcher": [],
38+
"presentation": { "reveal": "always", "panel": "shared" },
39+
"icon": { "id": "refresh" }
40+
}
41+
]
42+
}

AGENTS.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# PROJECT KNOWLEDGE BASE
2+
3+
**Generated:** 2026-02-26
4+
**Commit:** 1cb9a70
5+
**Branch:** feat/munet-ui
6+
7+
## OVERVIEW
8+
9+
MaiChartManager (Sitreamai) — maimai 音游谱面管理工具。C# ASP.NET Core 后端 + WinForms 桌面壳 + Vue 3 前端 SPA,内嵌本地 web server。
10+
11+
## STRUCTURE
12+
13+
```
14+
Sitreamai/
15+
├── MaiChartManager/ # 主程序:ASP.NET Core + WinForms 混合桌面应用
16+
│ ├── Controllers/ # REST API 控制器(按领域分子目录)
17+
│ ├── Front/ # Vue 3 + TypeScript 前端 SPA
18+
│ ├── Models/ # DTO / XML 数据模型
19+
│ ├── Services/ # 业务逻辑服务
20+
│ ├── Utils/ # 音频/视频/图片转换、CRI 工具
21+
│ ├── WannaCRI/ # CRI 音频格式处理(Python 打包)
22+
│ ├── Python/ # 嵌入式 Python 运行时
23+
│ └── FFMpeg/ # 嵌入式 FFmpeg
24+
├── MaiChartManager.CLI/ # 命令行工具 (mcm),Spectre.Console
25+
├── AquaMai/ # [submodule] BepInEx/MelonLoader 游戏 mod
26+
├── MaiLib/ # [submodule] maimai 谱面解析库
27+
├── SimaiSharp/ # [submodule] Simai 谱面格式解析
28+
├── SonicAudioTools/ # [submodule] CRI 音频工具库
29+
├── XV2-Tools/ # [submodule] ACB/HCA 音频格式处理
30+
└── Packaging/ # MSIX 打包脚本和资源
31+
```
32+
33+
## WHERE TO LOOK
34+
35+
| Task | Location | Notes |
36+
|------|----------|-------|
37+
| 添加/修改 API 接口 | `MaiChartManager/Controllers/` | 按领域分目录,见子目录 AGENTS.md |
38+
| 前端 UI 修改 | `MaiChartManager/Front/src/` | Vue 3 + Naive UI,见子目录 AGENTS.md |
39+
| 音频处理逻辑 | `MaiChartManager/Utils/Audio*.cs`, `CriUtils.cs` | FFmpeg + CRI SDK |
40+
| 谱面导入/解析 | `MaiChartManager/Services/`, `MaiLib/`, `SimaiSharp/` | MaiLib 和 SimaiSharp 是 submodule |
41+
| 应用启动流程 | `MaiChartManager/Program.cs``AppMain.cs``ServerManager.cs` | WinForms 单实例 + Kestrel |
42+
| 桌面窗口 | `Browser.cs`, `Launcher.cs` | WinForms,WebView2 嵌入前端 |
43+
| IAP/授权 | `IapManager.cs`, `OfflineReg.cs` | Windows Store IAP |
44+
| CLI 工具 | `MaiChartManager.CLI/` | `makeusm`, `makeacb` 命令 |
45+
| AquaMai mod 配置 | `Controllers/Mod/`, `Models/AquaMaiConfigDto.cs` | 管理游戏 mod 的安装和配置 |
46+
| 打包发布 | `Packaging/Build.ps1` | PowerShell,MSIX 打包 |
47+
48+
## CONVENTIONS
49+
50+
- 构建配置:Debug / Release / Crack(三种,Crack 是特殊功能解锁)
51+
- 平台:仅 x64
52+
- 5 个 git submodule,各自有独立仓库,勿直接修改 submodule 内代码
53+
- 前端 API client 由 `genClient.ts` 自动生成,勿手动编辑 `apiGen.ts`
54+
- 前端包管理用 pnpm
55+
- 后端 ASP.NET Core 控制器按领域分子目录(App/AssetDir/Catagory/Charts/Mod/Music/Tools)
56+
- 注意:`Catagory` 是 typo(应为 Category),但已是既定命名,保持一致
57+
58+
## ANTI-PATTERNS
59+
60+
- 不要修改 submodule 内的代码(AquaMai/MaiLib/SimaiSharp/SonicAudioTools/XV2-Tools)
61+
- 不要手动编辑 `Front/src/client/apiGen.ts``aquaMaiVersionConfigApiGen.ts`
62+
- 不要修改 `*.Designer.cs` 文件(WinForms 自动生成)
63+
64+
## COMMANDS
65+
66+
```bash
67+
# 构建(需要 Visual Studio 或 dotnet CLI)
68+
dotnet build Sitreamai.sln -c Release
69+
70+
# 前端开发
71+
cd MaiChartManager/Front && pnpm install && pnpm dev
72+
73+
# 前端构建
74+
cd MaiChartManager/Front && pnpm build
75+
76+
# 生成 API client
77+
cd MaiChartManager/Front && npx ts-node genClient.ts
78+
79+
# 打包
80+
powershell Packaging/Build.ps1
81+
```
82+
83+
## NOTES
84+
85+
- 项目混合了 WinForms(桌面壳)+ ASP.NET Core(本地 API server)+ Vue 3(前端 SPA)的非常规架构
86+
- Browser.cs 用 WebView2 加载前端,前端通过 localhost API 与后端通信
87+
- Python 和 FFmpeg 是嵌入式运行时,打包在应用内
88+
- MaiChartManager.CLI 共享主项目的部分代码,但是独立的 csproj

MaiChartManager/AGENTS.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# MaiChartManager 主程序目录
2+
3+
## OVERVIEW
4+
5+
主应用目录,ASP.NET Core + WinForms 混合桌面应用的核心代码。包含后端 API、前端 SPA、业务逻辑、工具类等所有主体代码。
6+
7+
## STRUCTURE
8+
9+
```
10+
MaiChartManager/
11+
├── *.cs # 根级文件:启动流程、窗口、配置、授权
12+
├── Controllers/ # REST API 控制器(见子目录 AGENTS.md)
13+
├── Front/ # Vue 3 前端 SPA(见子目录 AGENTS.md)
14+
├── Models/ # DTO / XML 数据模型
15+
├── Services/ # 业务逻辑服务
16+
├── Utils/ # 音频/视频/图片转换工具
17+
├── Attributes/ # 自定义 Attribute
18+
├── Locale/ # i18n 资源文件
19+
├── Libs/ # 打包进来的第三方库
20+
├── Python/ # 嵌入式 Python 运行时(勿修改)
21+
├── FFMpeg/ # 嵌入式 FFmpeg(勿修改)
22+
├── WannaCRI/ # CRI 音频工具,Python 打包(勿修改)
23+
├── Resources/ # 应用资源
24+
└── wwwroot/ # 前端构建产物(勿手动修改)
25+
```
26+
27+
## WHERE TO LOOK
28+
29+
| 任务 | 文件 | 说明 |
30+
|------|------|------|
31+
| 应用启动流程 | `Program.cs``AppMain.cs``ServerManager.cs` | 单实例 WinForms + Kestrel 启动 |
32+
| 桌面窗口 | `Browser.cs`, `Launcher.cs` | Browser.cs 用 WebView2 嵌入前端 |
33+
| Kestrel 配置 | `ServerManager.cs` | 本地 web server 设置 |
34+
| 应用配置 | `Config.cs`, `StaticSettings.cs` | 运行时配置和静态常量 |
35+
| IAP / 授权 | `IapManager.cs`, `OfflineReg.cs` | Windows Store IAP,离线注册 |
36+
| 请求鉴权 | `AuthenticationMiddleware.cs` | ASP.NET Core 中间件 |
37+
| XML 数据模型 | `Models/MusicXml.cs`, `GenreXml.cs`, `VersionXml.cs` | maimai 谱面元数据结构 |
38+
| AquaMai 配置模型 | `Models/AquaMaiConfigDto.cs` | mod 配置 DTO |
39+
| Simai 谱面导入 | `Services/MaidataImportService.cs` | 解析并导入 Simai 格式谱面 |
40+
| 音频处理 | `Utils/Audio.cs`, `AudioConvert.cs`, `CriUtils.cs` | FFmpeg + CRI SDK 封装 |
41+
| 视频/图片处理 | `Utils/VideoConvert.cs`, `ImageConvert.cs` | 媒体转换工具 |
42+
| maimai 工具函数 | `Utils/MaiUtils.cs` | 谱面相关通用工具 |
43+
| Windows 工具函数 | `Utils/WinUtils.cs` | Win32 API 封装 |
44+
| AquaMai 工具 | `Utils/AquaMaiConfigExtensions.cs`, `AquaMaiSignatureV2.cs` | mod 配置扩展和签名 |
45+
| i18n | `Locale/Locale.resx`, `zh-hans/`, `zh-hant/` | 简体/繁体中文本地化 |
46+
47+
## CONVENTIONS
48+
49+
- 启动顺序:`Program.cs`(入口)→ `AppMain.cs`(生命周期管理)→ `ServerManager.cs`(启动 Kestrel)
50+
- `Browser.cs` 通过 WebView2 加载前端,前端通过 localhost API 与后端通信
51+
- `*.Designer.cs` 是 WinForms 自动生成文件,**不要手动编辑**
52+
- Controllers 按领域分 7 个子目录:App / AssetDir / Catagory / Charts / Mod / Music / Tools
53+
- `Catagory` 是已知 typo(应为 Category),但已是既定命名,**保持一致,不要修改**
54+
- `wwwroot/``Front/` 构建产物,不要手动修改,通过 `pnpm build` 生成
55+
56+
## ANTI-PATTERNS
57+
58+
- 不要修改 `Python/``FFMpeg/``WannaCRI/` 目录内容(嵌入式运行时)
59+
- 不要手动编辑 `wwwroot/`(前端构建产物)
60+
- 不要手动编辑 `*.Designer.cs`(WinForms 自动生成)
61+
- 不要在 `Models/` 里写业务逻辑,只放纯数据结构
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# CONTROLLERS 知识库
2+
3+
## OVERVIEW
4+
5+
ASP.NET Core REST API 控制器,按业务领域分 7 个子目录,共 25 个控制器文件。
6+
7+
## STRUCTURE
8+
9+
| 子目录 | 职责 | 主要文件 |
10+
|--------|------|----------|
11+
| `App/` | 应用状态、授权、版本、本地化 | AppLicenseController, AppStatusController, AppVersionController, LocaleController |
12+
| `AssetDir/` | 资源目录管理、冲突检测、本地资源、曲目列表 | AssetDirController, CheckConflictController, LocalAssetsController, MusicListController |
13+
| `Catagory/` | 版本分类、曲风分类管理 | AddVersionController, GenreController |
14+
| `Charts/` | 谱面 CRUD、预览、导入 | ChartController, ChartPreviewController, ImportChartController |
15+
| `Mod/` | AquaMai mod 配置、安装、路径管理 | ConfigurationController, InstallationController, ManualInstallController, ModPaths |
16+
| `Music/` | 音乐 CRUD、音频/视频转换、批量操作、迁移、VRC 处理 | MusicController, MusicBatchController, CueConvertController, MovieConvertController, MusicTransferController, VrcProcessController |
17+
| `Tools/` | 独立音频/视频转换工具接口 | AudioConvertToolController, VideoConvertToolController |
18+
19+
## WHERE TO LOOK
20+
21+
| 任务 | 去哪里 |
22+
|------|--------|
23+
| 应用授权 / IAP 状态查询 | `App/AppLicenseController.cs` |
24+
| 应用版本检查 / 更新 | `App/AppVersionController.cs` |
25+
| 多语言 / 本地化 | `App/LocaleController.cs` |
26+
| 资源目录增删改查 | `AssetDir/AssetDirController.cs` |
27+
| 导入时冲突检测 | `AssetDir/CheckConflictController.cs` |
28+
| 曲目列表读取 | `AssetDir/MusicListController.cs` |
29+
| 版本/曲风分类管理 | `Catagory/AddVersionController.cs`, `Catagory/GenreController.cs` |
30+
| 谱面增删改查 | `Charts/ChartController.cs` |
31+
| 谱面预览生成 | `Charts/ChartPreviewController.cs` |
32+
| 谱面导入(Simai/Ma2) | `Charts/ImportChartController.cs` |
33+
| AquaMai mod 配置读写 | `Mod/ConfigurationController.cs` |
34+
| AquaMai mod 安装/卸载 | `Mod/InstallationController.cs` |
35+
| 音乐增删改查 | `Music/MusicController.cs` |
36+
| 音乐批量操作 | `Music/MusicBatchController.cs` |
37+
| 音频格式转换(ACB/USM) | `Music/CueConvertController.cs` |
38+
| 视频转换(movie) | `Music/MovieConvertController.cs` |
39+
| 曲目迁移(跨目录) | `Music/MusicTransferController.cs` |
40+
| VRC 音频处理 | `Music/VrcProcessController.cs` |
41+
| 独立音频转换工具 | `Tools/AudioConvertToolController.cs` |
42+
| 独立视频转换工具 | `Tools/VideoConvertToolController.cs` |
43+
44+
## CONVENTIONS
45+
46+
- 新增控制器请放入对应业务子目录,不要堆在根目录
47+
- `Catagory/` 是历史 typo(正确拼写应为 Category),已是既定命名,保持一致,勿重命名
48+
- 前端 API client(`Front/src/client/apiGen.ts`)由 `genClient.ts` 从这些控制器自动生成,修改接口后需重新运行生成脚本
49+
- `Mod/ModPaths.cs` 不是控制器,是 Mod 子目录的路径常量辅助类

MaiChartManager/Front/.idea/copilot.data.migration.ask2agent.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MaiChartManager/Front/AGENTS.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# FRONTEND KNOWLEDGE BASE
2+
3+
## OVERVIEW
4+
5+
Vue 3 + TypeScript 前端 SPA,通过 localhost API 与 ASP.NET Core 后端通信,内嵌于 WebView2 桌面窗口。
6+
7+
## STRUCTURE
8+
9+
```
10+
Front/
11+
├── src/
12+
│ ├── client/ # API 客户端层
13+
│ │ ├── api.ts # 手写 API 封装
14+
│ │ ├── apiGen.ts # ⚠️ 自动生成,禁止手动编辑
15+
│ │ └── aquaMaiVersionConfigApiGen.ts # ⚠️ 自动生成,禁止手动编辑
16+
│ ├── components/ # 可复用组件:DragDropDispatcher/, Sidebar/, Splash/, VersionInfo/
17+
│ ├── hooks/ # Vue composables
18+
│ ├── icons/ # 图标组件
19+
│ ├── locales/ # i18n 翻译文件
20+
│ ├── plugins/ # Vue 插件(posthog, sentry, i18n)
21+
│ ├── store/ # 状态管理:仅 refs.ts 单文件
22+
│ ├── utils/ # 工具函数
23+
│ ├── views/ # 页面视图:BatchAction/, Charts/, GenreVersionManager/, ModManager/, Tools/
24+
│ └── assets/ # 静态资源
25+
├── genClient.ts # API client 代码生成器
26+
├── vite.config.ts # Vite 配置
27+
├── uno.config.ts # UnoCSS 配置
28+
└── tsconfig.json # TypeScript 配置(strict,@ → ./src)
29+
```
30+
31+
## WHERE TO LOOK
32+
33+
| 任务 | 位置 |
34+
|------|------|
35+
| 调用后端 API | `src/client/api.ts`(手写封装)|
36+
| 添加新页面 | `src/views/` 对应子目录 |
37+
| 全局状态 | `src/store/refs.ts` |
38+
| 复用组件 | `src/components/` |
39+
| 国际化文本 | `src/locales/` |
40+
| 重新生成 API client | 运行 `npx ts-node genClient.ts` |
41+
42+
## CONVENTIONS
43+
44+
- 包管理器:pnpm
45+
- UI 组件库:Naive UI
46+
- 样式方案:UnoCSS(原子化 CSS)
47+
- 路径别名:`@``./src`
48+
- 状态管理极简,所有全局 ref 集中在 `src/store/refs.ts`
49+
- API client 由 `genClient.ts` 读取后端控制器自动生成,输出到 `apiGen.ts`
50+
51+
## ANTI-PATTERNS
52+
53+
- 禁止手动编辑 `src/client/apiGen.ts``aquaMaiVersionConfigApiGen.ts`,修改会在下次生成时被覆盖
54+
- 需要新增 API 调用时,在后端添加控制器后运行 `genClient.ts` 重新生成,再在 `api.ts` 中封装
55+
- 不要用 npm 或 yarn,统一使用 pnpm

MaiChartManager/Front/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>MaiChartManager</title>
7+
<link rel="icon" href="/favicon.ico" />
78
</head>
89
<body>
910
<div id="app"></div>

0 commit comments

Comments
 (0)