Skip to content

优化 TwoLineListItem#5447

Open
Glavo wants to merge 7 commits intoHMCL-dev:mainfrom
Glavo:two-line
Open

优化 TwoLineListItem#5447
Glavo wants to merge 7 commits intoHMCL-dev:mainfrom
Glavo:two-line

Conversation

@Glavo
Copy link
Member

@Glavo Glavo commented Feb 5, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

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 optimizes the TwoLineListItem component by implementing lazy initialization for subtitle and tags properties, reducing memory footprint and improving performance for components that don't use all features.

Changes:

  • Refactored property management to use lazy initialization pattern with StringPropertyBase
  • Updated CSS selectors to reflect new tag container structure
  • Simplified component initialization by deferring creation of UI elements until needed

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java Implemented lazy initialization for subtitle and tags properties; removed dependency on AggregatedObservableList; streamlined property management using StringPropertyBase pattern
HMCL/src/main/resources/assets/css/root.css Updated CSS selectors to match new tag container structure (tags are now wrapped in a .tags HBox)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return lblTitle;
private ObservableList<Label> tags;

public ObservableList<Label> getTags() {
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

getTags exposes the internal representation stored in field tags. The value may be modified after this call to getTags.
getTags exposes the internal representation stored in field tags. The value may be modified after this call to getTags.
getTags exposes the internal representation stored in field tags. The value may be modified after this call to getTags.
getTags exposes the internal representation stored in field tags. The value may be modified after this call to getTags.
getTags exposes the internal representation stored in field tags. The value may be modified after this call to getTags.
getTags exposes the internal representation stored in field tags. The value may be modified after this call to getTags.
getTags exposes the internal representation stored in field tags. The value may be modified after this call to getTags.

Copilot uses AI. Check for mistakes.
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