fix(fields): 让单行值渲染器的 truncate 真正生效并用 title 兜底全文 (#3466) - #3467
Merged
Conversation
裸行内 span.truncate 没有宽度框,overflow:hidden / text-overflow:ellipsis 永不触发 —— 详情页字段值(lookup 尤甚)超长时尾部被外层卡片无声裁掉, 既无省略号、悬浮也看不到全文(行容器的 title 被「双击编辑」占用)。 与 JsonCellRenderer(#2578)/ Grid LinkCell 同一根因,现将该修复范式收敛为 共享的 TruncatedText(block + max-w-full + truncate,title 携带全文): Text / Lookup×4 / User×3 / File / Json 各渲染器统一接入;Select 的 dot 分支给外层 inline-flex 补 max-w-full 并加 title;LookupField 触发按钮补 max-w-full,修掉内联编辑态选中标签把按钮撑出卡片右缘的附带问题。 值元素自身携带 title 后,悬浮文本优先显示全文(就近原则盖过行容器的 交互提示),交互提示仍由行 title + 铅笔按钮 tooltip 承载。 Fixes #3466 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019itDQ7HMpXML7UdtFhjnd8
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3466
根因
记录详情页字段值超长时尾部无声消失:多个 cell renderer(Text / Lookup / User / File / Select-dot)输出裸行内
span.truncate。行内盒没有宽度框,overflow:hidden/text-overflow:ellipsis永不触发 —— 值按内容宽渲染,溢出改由外层卡片裁掉,既无省略号、悬浮也看不到全文(行容器的title被「双击编辑」交互提示占用)。与
JsonCellRenderer(#2578)、GridLinkCell是同一根因,那两处已各自修过 —— 本 PR 把该修复范式收敛为单一实现。修改
packages/fields/src/index.tsxTruncatedTexthelper:block max-w-full truncate+title携带全文(块级化后有宽度框可裁;作为 flex 子项时overflow:hidden使自动最小尺寸归零、可收缩;title就近原则盖过行容器的交互提示)。TextCellRenderer、LookupCellRenderer(4 处)、UserCellRenderer(3 处)、FileCellRenderer、JsonCellRenderer统一接入。SelectCellRendererdot 分支:外层 inline-flex 补max-w-full并加title,内层标签补min-w-0。packages/fields/src/widgets/LookupField.tsx:触发按钮补max-w-full—— 修掉 issue 附带的内联编辑态(块级父容器中 inline-flex 按钮按内容定宽)选中标签把按钮撑出卡片右缘的问题。packages/fields/src/__tests__/cell-truncation.test.tsx:钉住每个单行值渲染器输出块级、max-w-full的截断 span 且title为全文。验证
packages/fields/全量:63 文件 / 956 测试全绿plugin-detail/plugin-grid/plugin-list/plugin-kanban/plugin-form:165 文件 / 1533 测试全绿纯 bug 修复,按仓库约定不写 changeset。
🤖 Generated with Claude Code
https://claude.ai/code/session_019itDQ7HMpXML7UdtFhjnd8
Generated by Claude Code