Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(hook): ♻️ 策略类重构消息发送 #126

Merged
merged 8 commits into from
Dec 26, 2024

Conversation

nongyehong
Copy link
Member

@nongyehong nongyehong commented Dec 26, 2024

💻 变更类型 | Change Type

  • ✨ feat | 新增功能
  • 🐛 fix | 修复缺陷
  • ♻️ refactor | 代码重构(不包括 bug 修复、功能新增)
  • 💄 style | 代码格式(不影响功能,例如空格、分号等格式修正)
  • 📦️ build | 构建流程、外部依赖变更(如升级 npm 包、修改 vite 配置等)
  • 🚀 perf | 性能优化
  • 📝 docs | 文档变更
  • 🧪 test | 添加疏漏测试或已有测试改动
  • ⚙️ ci | 修改 CI 配置、脚本
  • ↩️ revert | 回滚 commit
  • 🛠️ chore | 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)

🔀 变更说明 | Description of Change

📝 补充信息 | Additional Information

src/hooks/strategy/MessageStrategy.ts Fixed Show fixed Hide fixed
src/hooks/strategy/MessageStrategy.ts Fixed Show fixed Hide fixed
src/hooks/strategy/MessageStrategy.ts Fixed Show fixed Hide fixed
@nongyehong nongyehong changed the title Feature/upload file refactor(hook): ♻️ 策略类重构消息发送 Dec 26, 2024
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link
Member Author

@nongyehong nongyehong left a comment

Choose a reason for hiding this comment

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

审查一下策略类是否能跑通

@nongyehong nongyehong requested review from CHIMOOO and Aybrea December 26, 2024 02:52
@CHIMOOO
Copy link
Contributor

CHIMOOO commented Dec 26, 2024

此拉取请求在多个文件中引入了多项更改,以增强消息传递功能、更新依赖项并改进功能。以下是最重要的更改的摘要:

消息传递增强功能:

  • 添加了一个新的 AppException 类来处理特定于应用程序的错误(src/common/exception.ts)。
  • MessageStrategy.ts 中实现了各种消息策略(文本、图像、文件、不支持)来处理不同类型的消息(src/hooks/strategy/MessageStrategy.ts)。
  • 将消息策略集成到 useMsgInput 挂钩中以改进消息处理(src/hooks/useMsgInput.ts)。 [1] [2] [3]

依赖项更新:

  • 更新了 pnpm-lock.yaml 文件 (pnpm-lock.yaml) 中 @vitest/coverage-v8 的版本详细信息和依赖项。 [1] [2]

功能增强:

  • 为文件系统添加了新权限(fs:write-filesfs:allow-mkdirfs:read-dirsfs:read-filesfs:allow-copy-filefs:allow-read-text-filedefault.json 功能文件 (src-tauri/capabilities/default.json)。[1] [2]
  • 更新了功能架构以包含新的文件系统权限 (src-tauri/gen/schemas/capabilities.json)。

实用函数:

  • 添加了 saveCacheFile 函数以在本地缓存文件,并添加了 parseInnerText 函数以从 DOM 元素 (src/hooks/useCommon.ts) 解析内部文本。[1] [2] [3] [4] [5]

这些更改共同改善了应用程序的消息传递功能、更新了依赖项并增强了文件系统权限。

@nongyehong
Copy link
Member Author

使用 gh pr checkout 126 迁出本次提交到你本地跑一下,如果能正常启动或者登录发消息就可以,windows系统 @CHIMOOO

@CHIMOOO
Copy link
Contributor

CHIMOOO commented Dec 26, 2024

使用 gh pr checkout 126 迁出本次提交到你本地跑一下,如果能正常启动或者登录发消息就可以,windows系统 @CHIMOOO

可以了

Copy link
Contributor

@CHIMOOO CHIMOOO left a comment

Choose a reason for hiding this comment

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

window审查通过

@nongyehong
Copy link
Member Author

nongyehong commented Dec 26, 2024

mac没有问题,该分支对应功能后续完善

@nongyehong nongyehong enabled auto-merge (squash) December 26, 2024 04:00
@nongyehong nongyehong disabled auto-merge December 26, 2024 04:00
@nongyehong nongyehong merged commit 187071b into master Dec 26, 2024
9 checks passed
@nongyehong nongyehong deleted the feature/upload_file branch December 26, 2024 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants