Skip to content

Fix display of mod with extra long display name#6436

Open
ZZZank wants to merge 4 commits into
HMCL-dev:mainfrom
ZZZank:mod-display-length
Open

Fix display of mod with extra long display name#6436
ZZZank wants to merge 4 commits into
HMCL-dev:mainfrom
ZZZank:mod-display-length

Conversation

@ZZZank

@ZZZank ZZZank commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

共两个commits。第一个commit修复了在模组列表里名称(+译名)非常长的模组会将右侧的两个按钮挤走的问题:

上:PR前,下:PR改动后
cell-before
cell-after

既然列表里名字不一定是全名,那就另外需要一处可以展示全名的界面。第二个commit修复了详细信息页面里超长模组名的显示问题:

PR前(左右都截全了,就这样) PR改动后
dialog-before dialog-after

@github-actions github-actions Bot added the 1+ label Jul 19, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request improves text wrapping and truncation behavior in the UI. In TwoLineListItem, lblTitle is configured to grow with a minimum width of 0. In ModListPageSkin, text wrapping is enabled for the mod info dialog title, and text overrun is set to ellipsis for the mod info list cell. The review feedback suggests two layout refinements: setting HBox.setHgrow(tagsBox, Priority.NEVER) in TwoLineListItem to prevent premature truncation of the title, and setting HBox.setHgrow(title, Priority.ALWAYS) in ModInfoDialog to ensure the title properly wraps within the available width.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@github-actions github-actions Bot added 10+ and removed 1+ labels Jul 19, 2026
tagsBox.setAlignment(Pos.CENTER_LEFT);
tagsBox.setMinWidth(0);
HBox.setHgrow(tagsBox, Priority.ALWAYS);
tagsBox.setMinWidth(Region.USE_PREF_SIZE);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

此处修改再次导致 tag 会挤压 title。修改 TwoLineListItem 后请检查 TwoLineListItem 的各处用例(比如模组下载界面),确保修改不会导致其他位置布局出错。

@ZZZank ZZZank Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tag挤压title是故意的,因为title另有页面可以完全显示。但是其他使用的位置不一定有可以完全显示的代替页面,比如模组下载页面的条目与打开条目之后的页面里模组名字的显示都是过长就截断。

我看了几个下载页面以及几个管理页面,可以确定这个改动没有导致布局错误,但影响的范围有点大,都配置完全显示需要另开PR。这项改动实际上也只是可选的微调,如果觉得得不偿失可以revert

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tag挤压title是故意的,因为title另有页面可以完全显示。但是其他使用的位置不一定有可以完全显示的代替页面,比如模组下载页面的条目与打开条目之后的页面里模组名字的显示都是过长就截断。

我看了几个下载页面以及几个管理页面,可以确定这个改动没有导致布局错误,但影响的范围有点大,都配置完全显示需要另开PR。这项改动实际上也只是可选的微调,如果觉得得不偿失可以revert

title 挤压 tag 才是预期中的行为。title 的信息明显更加重要,让 tag 挤压 title 会让列表中根本看不到模组名称。

比如本 PR 修改后,模组下载页面中连锁采矿的名称直接被挤压没了,而且 tag 又把 UI 布局挤坏了。

image

@Minecraft269

Copy link
Copy Markdown

这个问题在 #5435 顺带修了 但是那个PR不知道什么时候才能合并 所以挺好

@github-actions github-actions Bot added 1+ and removed 10+ labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants