Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 13, 2025

The Material Editor was not displaying scroll bars when content was cut off in small windows, making some material properties unreachable as shown in the issue screenshot.

Root Cause

The editorPanel component had a hardcoded preferredSize of (0, 0) which prevented the parent JScrollPane from calculating proper scroll requirements. When a JScrollPane contains a component with zero preferred size, it assumes there's no content to scroll.

Solution

Removed the hardcoded preferred size from editorPanel in both the form definition and generated Java code:

Before:

editorPanel.setPreferredSize(new java.awt.Dimension(0, 0));

After:

// Line removed - let the panel calculate its preferred size naturally

This allows the editorPanel to calculate its preferred size based on its actual content (material property widgets), enabling the JScrollPane to show scrollbars when the content exceeds the viewport.

Impact

  • Fixed: Scroll bars now appear when Material Editor content overflows the window
  • Preserved: All existing functionality for normal-sized windows remains unchanged
  • Minimal: Only removed the problematic hardcoded size constraint

The fix is surgical and maintains backward compatibility while restoring proper scrolling behavior.

Fixes #666.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • archive.apache.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.6-bin/afr5mpiioh2wthjmwnkmdsd5w/gradle-8.6/lib/gradle-launcher-8.6.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.6-bin/afr5mpiioh2wthjmwnkmdsd5w/gradle-8.6/lib/agents/gradle-instrumentation-agent-8.6.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.6 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Sep 13, 2025

@neph1 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@neph1
Copy link
Contributor

neph1 commented Sep 13, 2025

I believe the problem is that MaterialEditorTopComponent doesn't have a ScrollPane

Copilot AI and others added 2 commits September 13, 2025 05:07
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Co-authored-by: neph1 <7988802+neph1@users.noreply.github.com>
Copilot AI changed the title [WIP] Material editor doesn't scroll Fix Material Editor scrolling when content overflows window Sep 13, 2025
Copilot AI requested a review from neph1 September 13, 2025 05:13
Copy link
Contributor

@neph1 neph1 left a comment

Choose a reason for hiding this comment

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

image 👍

@neph1 neph1 marked this pull request as ready for review September 13, 2025 16:52
@neph1 neph1 merged commit 1586f7c into master Sep 14, 2025
1 check failed
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.

Material editor doesn't scroll

2 participants