Conversation
主要改动 - 增加了 `showHotSearch` 的「显示热搜榜」设置项 - 在 `SearchDefault` 中根据设置决定是否获取热搜数据和显示热搜榜 同时也改了一些其它东西 - 在 `settings.ts` 中,将 `showSearchHistory` 移动到了与搜索框有关的设置一起 - 需要「使用在线服务」才能显示「搜索关键词建议」和「显示热搜榜」的设置项 - 修改「搜索关键词建议」的描述 - 修复了「展示搜索历史」关闭且不展示热搜榜时,`SearchDefault` 仍会显示(一条小栏)
Summary of ChangesHello, 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! 此拉取请求主要引入了一个新的配置选项,允许用户控制是否在搜索框的默认视图中显示热门搜索列表。通过将搜索历史和热搜榜的显示逻辑与用户设置和在线服务状态紧密结合,提升了搜索功能的灵活性和用户体验。此外,还对相关设置项的组织和描述进行了优化,并修复了一个界面显示的小问题。 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
The pull request refactors the display logic for search history and hot search in the SearchDefault.vue component by introducing dedicated computed properties (isShowSearchHistory, isShowHotSearch). It also adds a new user setting, showHotSearch, to control the visibility of the hot search list, and updates the showSearchHistory and enableSearchKeyword settings with descriptions and conditional visibility based on online service usage. The getSearchHotData function was also updated to respect the new showHotSearch setting.
There was a problem hiding this comment.
Pull request overview
该 PR 为搜索默认面板增加了「是否显示热搜榜」的设置开关,并在搜索默认内容渲染/数据获取上根据设置与在线服务状态进行联动控制,以优化搜索默认面板在不同配置下的展示行为。
Changes:
- 新增设置项
showHotSearch(显示热搜榜),并加入设置默认值与类型定义 - 设置页「搜索设置」中增加「显示热搜榜」开关,并将其与「在线服务」状态绑定展示
SearchDefault中按设置决定是否拉取热搜数据、是否展示热搜区域,并修复特定组合下仍显示空栏的问题
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/stores/setting.ts | 增加 showHotSearch 设置字段并补齐默认值;调整 showSearchHistory 字段在设置结构中的位置 |
| src/components/Setting/config/general.ts | 在设置页新增「显示热搜榜」开关;将与在线服务强相关的设置项改为仅在启用在线服务时展示 |
| src/components/Search/SearchDefault.vue | 依据设置决定热搜榜区域显示与热搜数据拉取;修正默认面板的显示条件避免空栏 |
You can also share your feedback on Copilot code review. Take the survey.
| // 获取热搜数据 | ||
| const getSearchHotData = async () => { | ||
| if (!settingStore.useOnlineService) return; | ||
| if (!settingStore.useOnlineService || !settingStore.showHotSearch) return; | ||
| const result = await getCacheData(searchHot, { | ||
| key: "searchHotData", |
There was a problem hiding this comment.
聚焦搜索框是 SearchDefault 显示的必要条件,用户无法在 SearchDefault 打开时跑到设置去把 showHotSearch 打开,这个没有必要
主要改动
showHotSearch的「显示热搜榜」设置项SearchDefault中根据设置决定是否获取热搜数据和显示热搜榜同时也改了一些其它东西
settings.ts中,将showSearchHistory移动到了与搜索框有关的设置一起SearchDefault仍会显示(一条小栏)