Skip to content

Conversation

devin-ai-integration[bot]
Copy link
Contributor

概述 / Overview

在前端侧栏添加 GitHub 星标数量显示组件,从 space.langbot.app API 获取仓库星标数量,点击时在新标签页打开 GitHub 仓库页面。

Added a GitHub star count component to the frontend sidebar that fetches star count from space.langbot.app API and opens the GitHub repository in a new tab when clicked.

主要变更 / Key Changes

  • 在侧栏底部添加 GitHub 星标组件,显示格式为 "GitHub 星标 (13,280)"
  • 通过 spaceClient.get('/api/v1/dist/info/repo') 获取星标数量
  • 点击组件打开 https://github.com/langbot-app/LangBot
  • 添加国际化文本 githubStars: 'GitHub 星标'
  • 遵循现有 SidebarChild 组件模式和样式

重点审查项 / Key Review Points

🔍 需要特别注意:

  • 外部 API 依赖: 依赖 space.langbot.app API,需要确认 API 稳定性和响应格式
  • 类型安全: 使用 as { repo: { stargazers_count: number } } 进行类型转换,如果 API 格式变更可能导致运行时错误
  • 用户体验: 组件在加载期间显示空文本,没有加载指示器
  • 错误处理: API 调用失败时只在控制台记录错误,用户无感知

🧪 测试建议:

  • 验证 API 调用正常工作并返回预期数据格式
  • 测试点击功能正确打开 GitHub 仓库(新标签页)
  • 确认组件在加载和加载完成状态下的显示效果
  • 检查国际化文本显示正确

📱 本地测试结果:

  • ✅ 组件正确显示星标数量 (13,280)
  • ✅ 点击功能正常工作
  • ✅ 样式与其他侧栏组件一致
  • ✅ 通过了 ESLint 检查

Link to Devin run: https://app.devin.ai/sessions/9be4e976932c4074bc03363659dc6ccb
Requested by: @RockChinQ

检查清单 / Checklist

PR 作者完成 / For PR author

请在方括号间写x以打勾 / Please tick the box with x

  • 阅读仓库贡献指引了吗? / Have you read the contribution guide?
  • 与项目所有者沟通过了吗? / Have you communicated with the project maintainer?
  • 我确定已自行测试所作的更改,确保功能符合预期。 / I have tested the changes and ensured they work as expected.

项目维护者完成 / For project maintainer

  • 相关 issues 链接了吗? / Have you linked the related issues?
  • 配置项写好了吗?迁移写好了吗?生效了吗? / Have you written the configuration items? Have you written the migration? Has it taken effect?
  • 依赖加到 pyproject.toml 和 core/bootutils/deps.py 了吗 / Have you added the dependencies to pyproject.toml and core/bootutils/deps.py?
  • 文档编写了吗? / Have you written the documentation?

- Add GitHub star component to sidebar bottom section
- Fetch star count from space.langbot.app API
- Display star count with proper internationalization
- Open GitHub repository in new tab when clicked
- Follow existing sidebar styling patterns

Co-Authored-By: Rock <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@0xzmz
Copy link
Contributor

0xzmz commented Aug 28, 2025

记得考虑请求超时及不通外网的情况

@RockChinQ RockChinQ merged commit 46b4482 into master Aug 28, 2025
1 check passed
@RockChinQ RockChinQ deleted the devin/1756366016-github-star-component branch August 28, 2025 13:04
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