Skip to content

chore(TabBar): 优化 TabBar 关闭按钮 hover 样式#157

Merged
LarryZhu-dev merged 1 commit intoAuto-Plugin:mainfrom
wxfengg:main
Feb 27, 2026
Merged

chore(TabBar): 优化 TabBar 关闭按钮 hover 样式#157
LarryZhu-dev merged 1 commit intoAuto-Plugin:mainfrom
wxfengg:main

Conversation

@wxfengg
Copy link
Contributor

@wxfengg wxfengg commented Feb 26, 2026

优化 TabBar 关闭按钮 hover 样式

image

Copilot AI review requested due to automatic review settings February 26, 2026 10:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本 PR 旨在优化工作区 TabBar 中关闭按钮的 hover 视觉效果,以提升交互反馈的一致性与可用性。

Changes:

  • 调整 TabBar 关闭按钮 hover 样式(为 iconfont 的 ::before 增加 padding/背景/圆角)。
  • 顺带对 TabBar.vue 的脚本与模板做了较大范围的格式化变更(引号、分号、换行等)。
  • 细微调整 cubic-bezier(...) 参数写法(数值规范化)。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 226 to +230
.closeIcon:hover {

span {
color: var(--text-color-1);

&::before {
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.closeIcon:hover span { color: var(--text-color-1) } is effectively overridden when the tab is hovered because the later &:hover .closeIcon span { color: var(--text-color-2) } selector is more specific and appears later in the file. If the intent is to change the close icon color on close-button hover, increase selector specificity (e.g. &:hover .closeIcon:hover span) and/or move the override after the tab hover block so it wins in the cascade.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +5
import { onMounted, onUnmounted, ref } from "vue";
import { vDraggable } from "vue-draggable-plus";
import useFile from "@/renderer/hooks/useFile";
import useTab from "@/renderer/hooks/useTab";
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is described as a hover-style tweak, but the script section also introduces broad non-functional reformatting (quote style + semicolons). Consider reverting unrelated formatting-only changes so the diff stays focused and easier to review/blame in the future.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to 32
window.addEventListener("keydown", handleCloseTabShortcut);

Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window.addEventListener('keydown', ...) is registered at setup evaluation time (outside onMounted). To avoid listeners being attached before mount (and to reduce leak risk if setup ever errors), register the handler inside onMounted and keep the corresponding removal in onUnmounted.

Suggested change
window.addEventListener("keydown", handleCloseTabShortcut);
onMounted(() => {
window.addEventListener("keydown", handleCloseTabShortcut);
});
onUnmounted(() => {
window.removeEventListener("keydown", handleCloseTabShortcut);
});

Copilot uses AI. Check for mistakes.
createNewFile();
}

async function handleCloseTab(id: string, event: Event) {
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleCloseTab is marked async but doesn't await anything. This returns a Promise unnecessarily and can be misleading; consider removing async (or await the confirm/close call if it is actually asynchronous).

Suggested change
async function handleCloseTab(id: string, event: Event) {
function handleCloseTab(id: string, event: Event) {

Copilot uses AI. Check for mistakes.
@LarryZhu-dev LarryZhu-dev merged commit 0862254 into Auto-Plugin:main Feb 27, 2026
3 of 4 checks passed
@github-actions
Copy link

🎉 Thank you for your contribution! If you have not yet joined our community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您对此项目非常感兴趣,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

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.

3 participants