Skip to content

feat: enhance HTML settings page with full IDE configuration support [IDE-1625]#348

Merged
nick-y-snyk merged 7 commits intomainfrom
feat/html-settings-ide-config
Jan 9, 2026
Merged

feat: enhance HTML settings page with full IDE configuration support [IDE-1625]#348
nick-y-snyk merged 7 commits intomainfrom
feat/html-settings-ide-config

Conversation

@nick-y-snyk
Copy link
Copy Markdown
Contributor

Summary

  • Enhanced HTML settings page to support full IDE configuration management from language server
  • Improved button styling with better color scheme using active hyperlink colors
  • Added comprehensive configuration parsing for all IDE settings including folder configs, trusted folders, and scan command configurations

Changes

Button Styling (BaseHtmlProvider.java)

  • Updated button colors to use active hyperlink theme color instead of inactive tab background
  • Added white foreground color for better contrast
  • Improved hover and secondary button styling

Settings Page Refactor (HTMLSettingsPreferencePage.java)

  • Implemented retry logic for loading HTML from language server
  • Added comprehensive IDE configuration data model (IdeConfigData) with proper JSON deserialization
  • Support for persisting folder-specific configurations including:
    • Organization preferences
    • Additional environment variables
    • Additional CLI parameters
    • Scan command configurations (pre/post scan commands)
  • Added trusted folders management
  • Proper handling of fallback form vs full form data
  • Implemented singleton pattern for page instance access
  • Simplified browser function initialization
  • Removed redundant location and progress listeners

Test plan

  • Verify HTML settings page loads correctly with language server HTML
  • Test fallback HTML loads when language server is unavailable
  • Verify all configuration fields persist correctly
  • Test folder-specific configuration settings
  • Verify button styling appears correctly in both light and dark themes
  • Test login/logout functionality
  • Verify toolbar UI updates after saving settings

@nick-y-snyk nick-y-snyk requested review from a team as code owners December 30, 2025 13:46
@snyk-io
Copy link
Copy Markdown

snyk-io bot commented Dec 30, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@Override
public void dispose() {
if (instance == this) {
instance = null;

Check warning

Code scanning / PMD

Assigning an Object to null is a code smell. Consider refactoring. Warning

Assigning an Object to null is a code smell. Consider refactoring.
- Add comprehensive IdeConfigData class with typed nested structures for all settings
- Implement retry logic (2 attempts, 2s delay) for loading LS HTML before fallback
- Add FolderConfig support with additionalEnv, additionalParameters, and scanCommandConfig
- Implement auth token notification to HTML page after successful authentication
- Fix UI hang by making updateConfiguration async in performOk
- Fix 10s timeout by checking LS connection before executeCommand in getConfigHtml
- Improve button styling with proper colors and contrast in BaseHtmlProvider
- Add static instance tracking for auth token callback from hasAuthenticated event
@nick-y-snyk nick-y-snyk force-pushed the feat/html-settings-ide-config branch from 14e28fd to f5115e3 Compare December 30, 2025 16:34
- Extract duplicate string literal "#FFFFFF" to constant in BaseHtmlProvider
- Mark static instance field as volatile for thread safety in HTMLSettingsPreferencePage
- Extract loop logic into helper methods to avoid object instantiation in loops
- Replace reference equality (==) with equals() for object comparison
- Isolate null assignment in dedicated clearInstance() method
Comment thread plugin/src/main/java/io/snyk/eclipse/plugin/html/BaseHtmlProvider.java Outdated
if (commandService != null) {
// Refresh severity filter commands
commandService.refreshElements(
"io.snyk.eclipse.plugin.commands.snykFilterCritical", null);
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.

I wonder if we can use constants here that are synchronized with the plugin.xml definition, so we have compile-time validation and consistency.

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.

was there any resolution to this?

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.

yes

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.

... and what is the resolution? please expand and point me to the solution.

@rrama rrama changed the title feat: enhance HTML settings page with full IDE configuration support feat: enhance HTML settings page with full IDE configuration support [IDE-1625] Jan 2, 2026
- Replace fully qualified class name with import for HTMLSettingsPreferencePage
- Replace hardcoded command ID strings with constants from IHandlerCommands
- Fix theme constant usage: use proper Eclipse workbench colors instead of hyperlink colors for buttons
- Convert IdeConfigData and inner classes to Java records (eliminates ~300 lines of boilerplate)
- Remove unnecessary clearInstance() method in HTMLSettingsPreferencePage
- Add synchronization to prevent race conditions between login and logout operations
Comment on lines +332 to +336
new ScanCommandConfig(
configData.preScanCommand(),
Boolean.TRUE.equals(configData.preScanOnlyReferenceFolder()),
configData.postScanCommand(),
Boolean.TRUE.equals(configData.postScanOnlyReferenceFolder()));

Check warning

Code scanning / PMD

Avoid instantiating new objects inside loops Warning

Avoid instantiating new objects inside loops
@nick-y-snyk nick-y-snyk force-pushed the feat/html-settings-ide-config branch from f063812 to 934be4b Compare January 5, 2026 16:03
@nick-y-snyk nick-y-snyk merged commit e9c85d2 into main Jan 9, 2026
10 checks passed
@nick-y-snyk nick-y-snyk deleted the feat/html-settings-ide-config branch January 9, 2026 10:34
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.

3 participants