Skip to content

fix(vault): 限制主机列表行最大宽度,避免全屏时右侧空白误触 - #2860

Open
ice616 wants to merge 1 commit into
binaricat:mainfrom
ice616:fix/vault-list-row-max-width
Open

fix(vault): 限制主机列表行最大宽度,避免全屏时右侧空白误触#2860
ice616 wants to merge 1 commit into
binaricat:mainfrom
ice616:fix/vault-list-row-max-width

Conversation

@ice616

@ice616 ice616 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

窗口全屏或容器较宽时,主机列表(树形视图 / 列表视图)的每一行会撑满可用宽度,导致主机名后面出现大片空白,这块空白仍绑定了整行的点击事件(打开/选中主机),非常容易误触。

Type of Change

  • Bug fix

Related Issue (optional)

N/A

Changes Made

  • components/vault/VaultTreeRow.tsxVaultTreeGroupRow(分组行)和 VaultTreeItemRow(主机行)最外层容器加上 max-w-[480px]
  • components/vault/VaultHostListSection.tsx:列表模式(viewMode === "list")下的置顶主机、最近主机、分组、常规主机(含分组内)共 5 处卡片容器加上 max-w-[480px];网格(grid)视图分支未改动。

选中态背景、hover 背景均绘制在行容器自身,收窄宽度后会跟随收窄,不会出现背景与内容宽度不一致的问题。虚拟化列表的绝对定位父层未改动,仅调整内层实际渲染行的最大宽度。

Screenshots / Demo

该应用依赖 Electron 的 window.electron IPC 桥接获取真实主机数据,无法在独立浏览器预览环境中渲染验证(已尝试,页面为空白但无报错,属预期的环境限制)。改动为纯 Tailwind className 调整,无 JS 逻辑变化,已通过类型检查与 lint。建议在 npm run dev 启动的 Electron 环境中人工验证全屏下的实际效果。

Testing

  • I have tested these changes locally (npm run dev)
  • Linting passes (npm run lint)
  • Tests pass (npm test)
  • Generated capability tool specs are updated when applicable (npm run generate:capability-tools)
  • No new console errors or warnings, if this affects app behavior

Checklist

  • My code follows the existing project style
  • I have added or updated relevant documentation
  • I have not introduced any breaking changes (or I have described them above)

树形视图和列表视图的行容器此前会撑满可用宽度,全屏下右侧大片
空白仍会响应整行点击,容易误触打开/选中主机。为分组行、主机行
(树形)及置顶/最近/分组/常规主机卡片(列表模式)统一加上
max-w-[480px],网格视图不受影响。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant