Skip to content

refactor(site): optimize info tips and interaction of ai infographic - #52

Merged
Aarebecca merged 2 commits into
mainfrom
refactor/ai-infographic
Dec 1, 2025
Merged

Aarebecca merged 2 commits into
mainfrom
refactor/ai-infographic

Conversation

@Aarebecca

Copy link
Copy Markdown
Contributor

优化 AI Infographic

  • 调整样式
  • 重试 支持编辑文本,添加删除按钮
  • 优化重试 交互逻辑
  • 提供详细的错误提示
image

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Aarebecca, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在全面优化AI Infographic功能的用户体验和健壮性。通过引入更结构化的历史记录管理系统,用户现在可以更灵活地处理生成请求,例如编辑并重试失败的请求,或直接删除不需要的记录。同时,增强的错误处理和更详细的错误提示,使得用户能够更好地理解和解决生成过程中遇到的问题。

Highlights

  • 历史记录管理: 重构了AI Infographic的历史记录管理,引入了新的HistoryRecord类型,并支持从旧的ChatMessage格式迁移。
  • 重试功能优化: 优化了重试(Retry)功能,现在支持编辑历史记录中的文本后再进行重试,并能识别正在重试的记录ID。
  • 新增删除功能: 为历史记录项添加了删除按钮,允许用户移除不需要的记录。
  • 错误提示增强: 改进了错误提示机制,现在可以显示更详细的错误信息,包括模型返回的解析错误或网络错误,并在UI中以Tooltip形式展示。
  • UI/UX改进: 调整了ChatPanel的样式,包括错误状态下的内边距,并为部分文本添加了select-none样式以优化用户体验。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

本次 PR 对 AI Infographic 功能进行了重要的重构,显著改善了历史记录管理、重试交互和错误提示。数据模型的重构(从 ChatMessage[] 到 HistoryRecord[])非常清晰,并且通过 normalizeLegacyMessages 和 normalizeStoredHistory 很好地处理了向后兼容性。新的重试和删除逻辑健壮,考虑了多种边缘情况。整体而言,这是一次高质量的更新,提升了代码的可维护性和用户体验。我只提出了一处关于代码去重的建议,以供参考。

@Aarebecca
Aarebecca merged commit e54f21c into main Dec 1, 2025
2 checks passed
@Aarebecca
Aarebecca deleted the refactor/ai-infographic branch December 1, 2025 11:03
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.

2 participants