Skip to content

fix(theme): foucs first entry theme when then input is not empty#2589

Merged
erha19 merged 1 commit intomainfrom
fix/theme-quick-open-select-index
Apr 14, 2023
Merged

fix(theme): foucs first entry theme when then input is not empty#2589
erha19 merged 1 commit intomainfrom
fix/theme-quick-open-select-index

Conversation

@winjo
Copy link
Copy Markdown
Contributor

@winjo winjo commented Apr 14, 2023

Types

  • 🐛 Bug Fixes

Background or solution

🤖 Generated by Copilot at 3cd7bbf

  • Fix bugs in quick open menus for selecting themes and icons (link, link)

close #2209

Changelog

🤖 Generated by Copilot at 3cd7bbf

This pull request enhances the theme and icon selection features in the theme.contribution.ts file. It prevents the quick open menus from highlighting the current theme or icon when the user searches for a different one.
image

@winjo winjo requested a review from Ricbet April 14, 2023 08:38
@opensumi opensumi Bot added the 🐞 bug Something isn't working label Apr 14, 2023
@github-actions
Copy link
Copy Markdown
Contributor

ChatGPT Code Review:

CodeReview:

根据该 diff 文件,此次变更是修改 ThemeContribution 类中的 selectIndex 函数,主要修改了两个地方:

  1. 现在 selectIndex 函数接受一个参数 lookFor,用于判断当前有没有输入值,如果有则设置为 -1,否则和原来一样为默认选中值。
  2. 修改了 placeholder 的值。

这个变更主要是针对主题和图标选择的快捷面板,修复了一个问题:如果输入框里有字符串,应该默认选中第一个,否则默认选中当前使用的主题或图标。

此次变更比较简单,没有发现什么明显的问题或者需要改善的点。

修改建议:

  1. showPickWithPreview 函数的调用处,增加一些注释,让代码更易读。
  2. 可以考虑使用更加具有描述性的参数命名。

合适的 commit message:

fix(theme): focus first entry theme when the input is not empty

根据 Angular 规范,commit message 主要包括三部分:header,body 和 footer。其中,header 由 type、module 和 subject 三个字段组成,每个字段之间使用冒号分隔。具体到这次变更,type 是 fix,module 是 theme,subject 是修复了一个问题,即快捷主题选择面板在输入框不为空时的默认选项问题。因此,合适的 commit message 是 "fix(theme): focus first entry theme when the input is not empty"。

@opensumi opensumi Bot added the 🎨 feature feature required label Apr 14, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01 🎉

Comparison is base (d8f6806) 57.62% compared to head (3cd7bbf) 57.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2589      +/-   ##
==========================================
+ Coverage   57.62%   57.63%   +0.01%     
==========================================
  Files        1326     1326              
  Lines       83559    83559              
  Branches    17402    17402              
==========================================
+ Hits        48154    48163       +9     
+ Misses      32166    32158       -8     
+ Partials     3239     3238       -1     
Flag Coverage Δ
jsdom 52.65% <ø> (+0.01%) ⬆️
node 16.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@erha19 erha19 merged commit f5fdd64 into main Apr 14, 2023
@erha19 erha19 deleted the fix/theme-quick-open-select-index branch April 14, 2023 09:29
@erha19 erha19 added this to the 2.24 milestone Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working 🎨 feature feature required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 主题搜索框输入关键词后,默认生效的主题有误;vscode 是正确的。

3 participants