Skip to content

Commit 09840bf

Browse files
longsizhuogithub-actions[bot]claude
authored
fix(rank): Document History 列表加滚动,修内容溢出 (#358) (#360)
* fix(rank): 贡献者弹窗 Document History 列表加滚动,修内容溢出 Dialog.Content 的 className 同时写了 `grid` 和 `flex col`:grid/flex 都设 display (Tailwind 级联里 grid 胜出),且 `col` 不是合法 class,flex 列容器从未生效, Document History 列表无法滚动、内容溢出弹窗。 改为 `flex flex-col`,并把滚动子容器的 `min-h-[150px]` 换成 `min-h-0` (flex 子项默认 min-height:auto 会阻止收缩,min-h-0 才能让 overflow-y-auto 生效)。 Closes #358 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(rank): 文档标题加 min-w-0,长标题省略而非撑破弹窗 doc-title span 是 flex 子项,truncate 需配 min-w-0 才生效(flex 子项默认 min-width:auto 不收缩)。否则超长标题横向溢出、把外链图标挤出、撑破 max-w-lg 弹窗。 列表加滚动后长列表可达,此问题更易触发。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 260160b commit 09840bf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/components/rank/ContributorRow.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function ContributorRow({
6767

6868
<Dialog.Portal>
6969
<Dialog.Overlay className="fixed inset-0 bg-black/60 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" />
70-
<Dialog.Content className="fixed left-[50%] outline-none top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-2 border-[var(--foreground)] bg-[var(--background)] p-6 sm:p-8 shadow-[8px_8px_0px_0px_var(--foreground)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] max-h-[85vh] flex col">
70+
<Dialog.Content className="fixed left-[50%] outline-none top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-2 border-[var(--foreground)] bg-[var(--background)] p-6 sm:p-8 shadow-[8px_8px_0px_0px_var(--foreground)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] max-h-[85vh]">
7171
{/* 弹窗核心内容:左侧头像,右侧个人基础信息 */}
7272
<div className="flex justify-between items-start border-b-4 border-[var(--foreground)] pb-6 mb-4 shrink-0 relative">
7373
<div className="flex gap-5 md:gap-6 items-start w-full pr-12">
@@ -164,7 +164,7 @@ export function ContributorRow({
164164
</div>
165165

166166
{/* 文章贡献历史列表展示 */}
167-
<div className="overflow-y-auto pr-2 flex-grow min-h-[150px] relative">
167+
<div className="overflow-y-auto pr-2 flex-grow min-h-0 relative">
168168
<h4 className="font-mono text-xs uppercase tracking-widest mb-3 text-[#111111]/70 dark:text-neutral-400 flex items-center gap-2">
169169
Document History
170170
</h4>
@@ -193,7 +193,7 @@ export function ContributorRow({
193193
data-umami-event-doc={doc.title}
194194
data-umami-event-user={user.name}
195195
>
196-
<span className="font-mono text-sm text-[#111111] dark:text-neutral-200 group-hover/link:underline decoration-2 decoration-[#CC0000] underline-offset-4 truncate pr-4">
196+
<span className="font-mono text-sm text-[#111111] dark:text-neutral-200 group-hover/link:underline decoration-2 decoration-[#CC0000] underline-offset-4 truncate pr-4 min-w-0">
197197
{doc.title}
198198
</span>
199199
<ExternalLink className="h-4 w-4 text-[#111111]/50 dark:text-neutral-400 group-hover/link:text-[#CC0000] transition-colors shrink-0" />

0 commit comments

Comments
 (0)