Repository navigation
将原本在astro文件里的bangumi展示配置项放到config文件里面 - #511
Conversation
✅ Deploy Preview for demo-firefly ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Reviewer's Guide本次 PR 将 Bangumi 分类启用/禁用配置从 File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience访问你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's GuideThis PR moves Bangumi category enable/disable configuration out of the bangumi.astro page into the shared site config, adds typing support for it, and wires bangumi.astro to read from this config while also making a minor nav bar comment correction. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并给出了一些整体反馈:
BangumiConfig.bangumi.categories上的注释说明未设置的分类默认启用,但在bangumi.astro中,real的默认值是false;建议统一默认值,或者调整注释以避免产生混淆。navBarConfig.ts中对评论标签的修改与将 Bangumi 显示设置迁移到配置中无关;建议将这些更改拆分到单独的 PR 中,以保持本次修改范围聚焦。
供 AI 代理使用的提示词
Please address the comments from this code review:
## Overall Comments
- The comment on `BangumiConfig.bangumi.categories` says unset categories default to enabled, but `real` is defaulted to `false` in `bangumi.astro`; consider aligning the default value or adjusting the comment to avoid confusion.
- The changes to comment labels in `navBarConfig.ts` are unrelated to moving Bangumi display settings into config; consider splitting those into a separate PR to keep the scope focused.
## Individual Comments
### Comment 1
<location path="src/types/siteConfig.ts" line_range="154-160" />
<code_context>
apiUrl?: string; // Bangumi API 地址
subjectBaseUrl?: string; // 条目详情页地址
categoryOrder?: ("anime" | "game" | "book" | "music" | "real")[]; // 条目类型排序顺序
+ // 各分类的显示启用状态,未设置时默认启用
+ categories?: {
+ book?: boolean;
+ anime?: boolean;
+ music?: boolean;
+ game?: boolean;
+ real?: boolean;
+ };
};
</code_context>
<issue_to_address>
**issue (bug_risk):** The doc comment says categories default to enabled, but `real` is actually defaulted to disabled in `bangumiConfig`.
In `bangumi.astro`, `real` resolves to `siteConfig.bangumi?.categories?.real ?? false`, so when `real` is not set it is disabled, contradicting the comment’s "未设置时默认启用". Please either update the comment to mention the special-case default for `real`, or change the default in `bangumiConfig` to `true` to match the documented behavior.
</issue_to_address>帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The comment on
BangumiConfig.bangumi.categoriessays unset categories default to enabled, butrealis defaulted tofalseinbangumi.astro; consider aligning the default value or adjusting the comment to avoid confusion. - The changes to comment labels in
navBarConfig.tsare unrelated to moving Bangumi display settings into config; consider splitting those into a separate PR to keep the scope focused.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The comment on `BangumiConfig.bangumi.categories` says unset categories default to enabled, but `real` is defaulted to `false` in `bangumi.astro`; consider aligning the default value or adjusting the comment to avoid confusion.
- The changes to comment labels in `navBarConfig.ts` are unrelated to moving Bangumi display settings into config; consider splitting those into a separate PR to keep the scope focused.
## Individual Comments
### Comment 1
<location path="src/types/siteConfig.ts" line_range="154-160" />
<code_context>
apiUrl?: string; // Bangumi API 地址
subjectBaseUrl?: string; // 条目详情页地址
categoryOrder?: ("anime" | "game" | "book" | "music" | "real")[]; // 条目类型排序顺序
+ // 各分类的显示启用状态,未设置时默认启用
+ categories?: {
+ book?: boolean;
+ anime?: boolean;
+ music?: boolean;
+ game?: boolean;
+ real?: boolean;
+ };
};
</code_context>
<issue_to_address>
**issue (bug_risk):** The doc comment says categories default to enabled, but `real` is actually defaulted to disabled in `bangumiConfig`.
In `bangumi.astro`, `real` resolves to `siteConfig.bangumi?.categories?.real ?? false`, so when `real` is not set it is disabled, contradicting the comment’s "未设置时默认启用". Please either update the comment to mention the special-case default for `real`, or change the default in `bangumiConfig` to `true` to match the documented behavior.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| // 各分类的显示启用状态,未设置时默认启用 | ||
| categories?: { | ||
| book?: boolean; | ||
| anime?: boolean; | ||
| music?: boolean; | ||
| game?: boolean; | ||
| real?: boolean; |
There was a problem hiding this comment.
issue (bug_risk): 文档注释说明分类在未设置时默认启用,但在 bangumiConfig 中,real 实际上是默认禁用的。
在 bangumi.astro 中,real 的取值为 siteConfig.bangumi?.categories?.real ?? false,因此当 real 未设置时会被视为禁用,这与注释中“未设置时默认启用”的描述相矛盾。请更新注释以说明 real 的特殊默认值,或者将 bangumiConfig 中的默认值改为 true,以与文档说明保持一致。
Original comment in English
issue (bug_risk): The doc comment says categories default to enabled, but real is actually defaulted to disabled in bangumiConfig.
In bangumi.astro, real resolves to siteConfig.bangumi?.categories?.real ?? false, so when real is not set it is disabled, contradicting the comment’s "未设置时默认启用". Please either update the comment to mention the special-case default for real, or change the default in bangumiConfig to true to match the documented behavior.
|
fix: 修复navBar配置项中文注释错误 这个已经在#509 merge了,忽略即可 |
* fix: 修复navBar配置项中文注释错误 * feat: 将原本在astro里面的bangumi条目开关转移到config,方便配置
Type of change
Checklist
Changes
修改了
src/config/siteConfig.ts添加example(已注释掉,如果需要禁用某一类别请取消注释)src/pages/bangumi.astro从配置文件读取src/types/siteConfig.ts添加是否显示类型为bool效果等同于直接改原本的
src/pages/bangumi.astro文件,将categories.game:true->falseHow To Test
如上取消注释掉
src/config/siteConfig.ts里的categories即可Screenshots (if applicable)
Additional Notes
其实就是把配置项放到了config里面,方便修改(bangumi里太多galgame不方便展示就想到取消展示game界面,不过config里面一直找不到)
Summary by Sourcery
通过共享站点配置,使 Bangumi 分类的可见性可配置。
新功能:
siteConfig启用或禁用单个 Bangumi 分类,而不是在 bangumi 页面中将其硬编码。改进:
Original summary in English
Summary by Sourcery
Make Bangumi category visibility configurable via the shared site configuration.
New Features:
Enhancements: