Skip to content

feat: add respack export function - #886

Merged
Mivik merged 5 commits into
TeamFlos:mainfrom
SeRazon:respack-export
Sep 5, 2026
Merged

Mivik merged 5 commits into
TeamFlos:mainfrom
SeRazon:respack-export

Conversation

@SeRazon

@SeRazon SeRazon commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

概述

为非默认皮肤资源包增加导出功能,导出格式与导入格式完全一致(zip 压缩包)。

实现内容

  • 在资源包列表的信息按钮左侧新增导出按钮(仅非默认资源包显示)
  • 导出格式与导入格式完全一致:使用 compress_folder 将资源包目录压缩为 zip
  • 导出流程复用谱面导出的 request_export / resolve_export / take_export 机制,支持系统文件选择器
  • 导出文件名自动清理非法字符(/ \ : * ? " < > | → _)

按钮位置

导出按钮位于信息按钮左侧,与信息、删除按钮保持相同间距和样式:

respack export button

改动文件

  • phira/src/page/respack.rs:导出逻辑、按钮渲染、文件名清理
  • phira/src/icons.rs:注册导出图标
  • assets/export.png:导出图标资源

测试情况

  • 编译通过
  • 资源包导入功能正常(未受影响)
  • 资源包导出功能正常,导出的 zip 可重新导入
  • 默认资源包不显示导出按钮
  • cargo fmt --all --check 通过

Copilot AI lite review requested due to automatic review settings August 29, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an export capability for non-default resource packs, reusing the existing request_export / take_export / resolve_export flow so users can pick an output location and export a respack as an import-compatible .zip.

Changes:

  • Add an export button to the respack UI (only for non-default packs) and hook it into the shared export workflow.
  • Implement respack directory zipping via compress_folder and write the zip to the chosen export target.
  • Register a new export icon texture in the global Icons loader.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
phira/src/page/respack.rs Adds export button UI + export task handling and filename sanitization.
phira/src/icons.rs Registers export.png as a new Icons::export texture.
assets/export.png New icon asset used by the export button.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread phira/src/page/respack.rs
Comment thread phira/src/page/respack.rs
Comment thread phira/src/page/respack.rs
@Mivik
Mivik merged commit 468a44d into TeamFlos:main Sep 5, 2026
5 checks passed
@YuevUwU

YuevUwU commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Final Merged UI

Differs from the screenshot in the PR Description after "feat: adjust export button"

In non-built-in resource packs, the Export button icon appears in the upper right corner with the translatable text `export`.

@SeRazon

SeRazon commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Final Merged UI

Differs from the screenshot in the PR Description after "feat: adjust export button"

In non-built-in resource packs, the Export button icon appears in the upper right corner with the translatable text `export`.

Mivik changed the button position

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants