Skip to content

fix: show all sidebar pin icons only on hover - #1056

Merged
hotlong merged 2 commits into
mainfrom
copilot/update-sidebar-pin-icons-hover
Mar 9, 2026
Merged

fix: show all sidebar pin icons only on hover#1056
hotlong merged 2 commits into
mainfrom
copilot/update-sidebar-pin-icons-hover

Conversation

Copilot AI commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Pinned navigation items permanently display the PinOff icon, cluttering the sidebar when many items are pinned.

  • Changed showOnHover={!item.pinned}showOnHover on both SidebarMenuAction instances in NavigationRenderer.tsx (action-type and leaf items)
  • Updated ROADMAP.md to reflect the new behavior

Previously, !item.pinned evaluated to false for pinned items, keeping the unpin icon always visible. Now all pin/unpin icons are hover-only. Users still identify pinned items via the Favorites section.

Original prompt

This section details on the original issue you should resolve

<issue_title>Sidebar导航项已Pin状态下图钉图标过多,统一hover时显示</issue_title>
<issue_description>## 背景
用户反馈:侧边栏导航项右侧的小图钉太多,视觉上显得非常拥挤(见截图)。目前所有已Pin项都会一直显示“取消Pin”图标。

侧边栏导航拥挤问题

问题代码

  • NavigationRenderer.tsx 的 pin 交互逻辑导致所有已Pin项一直显示图钉(PinOff),造成界面不美观。

方案(A):全部图钉仅在hover时显示

  • 调整 SidebarMenuActionshowOnHover 属性,让所有pin/unpin按钮都只在hover时显示,无论当前项是否已Pin。
  • 用户依然可以通过Favorites顶部区域区分已Pin项。

期望效果

  • 侧边栏更加简洁,用户hover再决定Pin/Unpin。
  • Favorites区仍然展示已Pin项。

截图

侧边栏导航拥挤问题

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel

vercel Bot commented Mar 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Mar 9, 2026 9:56am
objectui-demo Ready Ready Preview, Comment Mar 9, 2026 9:56am
objectui-storybook Ready Ready Preview, Comment Mar 9, 2026 9:56am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update sidebar pin icons to show on hover fix: show all sidebar pin icons only on hover Mar 9, 2026
@hotlong
hotlong marked this pull request as ready for review March 9, 2026 08:28
Copilot AI review requested due to automatic review settings March 9, 2026 08:28
@hotlong
hotlong merged commit 2a6af06 into main Mar 9, 2026
2 of 4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a cluttered sidebar UX where all currently-pinned navigation items permanently displayed a "PinOff" (unpin) icon. By changing showOnHover={!item.pinned} to showOnHover (always true) on both SidebarMenuAction instances, all pin/unpin icons now only appear on hover. Users still identify their pinned items via the Favorites section.

Changes:

  • Pin/unpin icons in the sidebar are now hover-only for all items (pinned or not), eliminating visual clutter when many items are pinned.
  • ROADMAP.md updated to reflect the new, corrected behavior description.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/layout/src/NavigationRenderer.tsx Removes the conditional !item.pinned from showOnHover on both the action-type and leaf-type SidebarMenuAction instances, making all pin/unpin icons hover-only.
ROADMAP.md Updates the P2.9 changelog entry to accurately describe the new always-hover behavior instead of the previous conditional description.

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.

Sidebar导航项已Pin状态下图钉图标过多,统一hover时显示

3 participants